[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[minion-cvs] Add an update-servers command to make Noise happy
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv22732/lib/mixminion
Modified Files:
ClientMain.py Main.py
Log Message:
Add an update-servers command to make Noise happy
Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ClientMain.py 7 Jan 2003 04:49:10 -0000 1.35
+++ ClientMain.py 7 Jan 2003 05:04:55 -0000 1.36
@@ -1172,3 +1172,29 @@
for line in keystore.listServers():
print line
+
+_UPDATE_SERVERS_USAGE = """\
+Usage: %s [options]
+Options:
+ -h, --help: Print this usage message and exit.
+ -f <file>, --config=<file> Use a configuration file other than ~/.mixminionrc
+ (You can also use MIXMINIONRC=FILE)
+""".strip()
+
+def updateServers(cmd, args):
+ options, args = getopt.getopt(args, "hf:", ['help', 'config='])
+ configFile = None
+ for o,v in options:
+ if o in ('-h', '--help'):
+ print _LIST_SERVERS_USAGE % cmd
+ sys.exit(1)
+ elif o in ('-f', '--config'):
+ configFile = v
+
+ config = readConfigFile(configFile)
+
+ userdir = os.path.expanduser(config['User']['UserDir'])
+ keystore = ClientKeystore(userdir)
+
+ keystore.updateDirectory(forceDownload=1)
+ print "Directory updated"
Index: Main.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Main.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- Main.py 6 Jan 2003 10:39:24 -0000 1.22
+++ Main.py 7 Jan 2003 05:04:55 -0000 1.23
@@ -119,6 +119,7 @@
"client" : ( 'mixminion.ClientMain', 'runClient' ),
"import-server" : ( 'mixminion.ClientMain', 'importServer' ),
"list-servers" : ( 'mixminion.ClientMain', 'listServers' ),
+ "update-servers" : ( 'mixminion.ClientMain', 'updateServers' ),
"server" : ( 'mixminion.server.ServerMain', 'runServer' ),
"server-keygen" : ( 'mixminion.server.ServerMain', 'runKeygen'),
"server-DELKEYS" : ( 'mixminion.server.ServerMain', 'removeKeys'),
@@ -133,6 +134,7 @@
" send [Send an anonymous message]\n"+
" import-server [Tell the client about a new server]\n"+
" list-servers [Print a list of currently known servers]\n"+
+ " update-servers [Download a fresh server directory]\n"+
" (For Servers)\n"+
" server [Begin running a Mixminon server]\n"+
" server-keygen [Generate keys for a Mixminion server]\n"+