self.Commander = CommanderBase();
self.commands = {
'list': [self.simpleC, 'Lists the nodes in xml file.'],
- 'boot':[self.nodeC, 'Bootstrap server. Options: all | x .'],
- 'start': [self.clientC, 'Start clients. Options: all | x | x,y .'],
- 'stop': [self.clientC, 'Stop clients. Options: all | x | x,y .'],
- 'status': [self.clientC,'Status clients. Options: all | x | x,y .'],
+ 'boot':[self.nodeC, 'Bootstrap server. Options: all | x'],
+ 'start': [self.clientC, 'Start clients. Options: all | x | x,y'],
+ 'stop': [self.clientC, 'Stop clients. Options: all | x | x,y'],
+ 'status': [self.clientC,'Status clients. Options: all | x | x,y'],
'archive': [self.nodeC, 'Archive output information of clients.'+\
- 'Options: all | x .'],
- 'getclients': [self.nodeC,'Get running clients. Options: all | x .'],
- 'getoutput': [self.nodeC,'Get clients output. Options: all | x .'],
+ 'Options: all | x'],
+ 'getclients': [self.nodeC,'Get running clients. Options: all | x'],
+ 'getoutput': [self.nodeC,'Get clients output. Options: all | x'],
'help': [self.simpleC, 'Show This Message.'],
'exit': [self.simpleC, 'Exit Commander.']
}
" KB/s" + ", Up:" +si.upload_limit + " KB/s" + ' )'
def about(self):
- print "Commander version 1.1.1"
+ print "Commander version 1.1"
print "Enter \"help\" for instructions"
if __name__ == "__main__":
def getClients(self, public_address, listen_port):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- GET_CLIENTS,
- "")
+ listen_port,
+ GET_CLIENTS,
+ "")
if msg_type == ACK_MSG:
return msg_data
else:
- error("get_clients", msg_data)
+ self.error("get_clients", msg_data)
except Exception, e:
print e
def getOutput(self, public_address, listen_port):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- GET_OUTPUT,
- "")
+ listen_port,
+ GET_OUTPUT,
+ "")
if msg_type == ACK_MSG:
return msg_data
else:
- error("get_output", msg_data)
+ self.error("get_output", msg_data)
except Exception, e:
print e
def archive(self, public_address, listen_port):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- ARCHIVE,
- "")
+ listen_port,
+ ARCHIVE,
+ "")
if msg_type == ACK_MSG:
return msg_data
else:
- error("archive", msg_data)
+ self.error("archive", msg_data)
except Exception, e:
print e
def start(self, public_address, listen_port, config_data):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- START_MSG,
- config_data)
+ listen_port,
+ START_MSG,
+ config_data)
if msg_type == ACK_MSG:
return msg_data
else:
- error("start_client", msg_data)
+ self.error("start_client", msg_data)
except Exception, e:
print e
def stop(self, public_address, listen_port, client_pid):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- STOP_MSG,
- client_pid)
+ listen_port,
+ STOP_MSG,
+ client_pid)
if msg_type == ACK_MSG:
return True
else:
- error("stop_client", msg_data)
+ self.error("stop_client", msg_data)
except Exception, e:
print e
def status(self, public_address, listen_port, client_pid):
try:
msg_type, msg_data = self.sendComm(public_address,
- listen_port,
- GET_STATUS,
- client_pid)
+ listen_port,
+ GET_STATUS,
+ client_pid)
if msg_type == ACK_MSG:
return msg_data
else:
- error("start_client", msg_data)
+ self.error("start_client", msg_data)
except Exception, e:
print e
def error(self, op, msg):
print "[Server Error]: The server denied the " + op + " operation"
print "[Server Error]: " + msg
-
\ No newline at end of file
+