|
From: <di...@us...> - 2007-01-26 18:10:40
|
Revision: 303
http://safekeep.svn.sourceforge.net/safekeep/?rev=303&view=rev
Author: dimi
Date: 2007-01-26 10:10:35 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
Transform the list of configurations into a dictionary.
It should make it easier to look through the known ids.
Modified Paths:
--------------
safekeep/trunk/safekeep
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2007-01-26 16:47:13 UTC (rev 302)
+++ safekeep/trunk/safekeep 2007-01-26 18:10:35 UTC (rev 303)
@@ -243,7 +243,7 @@
else:
print >> sys.stderr, 'Inaccessible configuration, ignoring:', cfg
- cfgs = []
+ cfgs = {}
for filepath in cfgfiles:
filename = os.path.splitext(os.path.basename(filepath))[0]
@@ -257,7 +257,7 @@
finally:
dom.unlink()
cfg['text'] = cfg_str
- cfgs.append(cfg)
+ cfgs[cfg['id']] = cfg
return cfgs
@@ -527,7 +527,7 @@
def do_server(cfgs):
debug("Do server main loop")
- for cfg in cfgs:
+ for cfg in cfgs.itervalues():
if cfg['host']:
if not os.path.isfile(cfg['key_ctrl']):
warn('Client %(id)s missing ctrl key %(key_ctrl)s, skipping' % cfg)
@@ -598,7 +598,7 @@
def do_keys(cfgs, ids, status, dump, deploy):
matches = []
- for cfg in cfgs:
+ for cfg in cfgs.itervalues():
id = cfg['id']
if ids and id not in ids: continue
info('Handling keys for client: %s' % id)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|