~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
peerdb/tripe-newpeers.in (ConfigSection.items): Just return names.
[tripe]
/
peerdb
/
tripe-newpeers.in
diff --git
a/peerdb/tripe-newpeers.in
b/peerdb/tripe-newpeers.in
index
304d34a
..
b8cf681
100644
(file)
--- a/
peerdb/tripe-newpeers.in
+++ b/
peerdb/tripe-newpeers.in
@@
-287,9
+287,7
@@
class ConfigSection (object):
def items(me, resolvep = True):
"""
def items(me, resolvep = True):
"""
- Return a list of (NAME, VALUE) items in this section.
-
- This extends the default method by handling the inheritance chain.
+ Yield a list of item names in the section.
"""
## Initialize for a depth-first walk of the inheritance graph.
"""
## Initialize for a depth-first walk of the inheritance graph.
@@
-308,12
+306,8
@@
class ConfigSection (object):
if key == '@inherit': stack += value.replace(',', ' ').split()
else: d[key] = None
if key == '@inherit': stack += value.replace(',', ' ').split()
else: d[key] = None
- ## Now collect the values for the known keys, one by one.
- items = []
- for key in d: items.append((key, me.get(key, resolvep)))
-
## And we're done.
## And we're done.
- return
items
+ return
d.iterkeys()
class MyConfigParser (object):
"""
class MyConfigParser (object):
"""
@@
-439,7
+433,8
@@
class MyConfigParser (object):
resolve hostnames will fail!
"""
for sec in me.sections():
resolve hostnames will fail!
"""
for sec in me.sections():
- for key, value in sec.items(resolvep = False):
+ for key in sec.items():
+ value = sec.get(key, resolvep = False)
for match in RX_RESOLVE.finditer(value):
me._resolver.prepare(match.group(1))
me._resolver.run()
for match in RX_RESOLVE.finditer(value):
me._resolver.prepare(match.group(1))
me._resolver.run()
@@
-525,9
+520,9
@@
def output(conf, cdb):
except MissingKeyException: pass
else: cdb.add('U%s' % u)
url = M.URLEncode(laxp = True, semip = True)
except MissingKeyException: pass
else: cdb.add('U%s' % u)
url = M.URLEncode(laxp = True, semip = True)
- for key
, value in sorted(sec.items(), key = lambda (k, v): k
):
+ for key
in sorted(sec.items()
):
if not key.startswith('@'):
if not key.startswith('@'):
- url.encode(key, ' '.join(M.split(
value
)[0]))
+ url.encode(key, ' '.join(M.split(
sec.get(key)
)[0]))
cdb.add(label, url.result)
cdb.add('%AUTO', ' '.join(auto))
cdb.finish()
cdb.add(label, url.result)
cdb.add('%AUTO', ' '.join(auto))
cdb.finish()