adding server.load command
[electrum-server.git] / server.py
index 5846fba..c636c0c 100755 (executable)
--- a/server.py
+++ b/server.py
@@ -70,11 +70,18 @@ def run_rpc_command(command, stratum_tcp_port):
         if msg.find('\n') != -1: break
     s.close()
     r = json.loads(msg).get('result')
-    if command == 'stop': print r
-    elif command == 'info': 
+
+    if command == 'info': 
         now = time.time()
+        print 'type           address   sub  version  time' 
         for item in r:
-            print '%15s   %3s  %7s  %.2f'%( item.get('address'), item.get('subscriptions'), item.get('version'), (now - item.get('time')) )
+            print '%4s   %15s   %3s  %7s  %.2f'%( item.get('name'), 
+                                                  item.get('address'), 
+                                                  item.get('subscriptions'), 
+                                                  item.get('version'), 
+                                                  (now - item.get('time')) )
+    else:
+        print r
 
 if __name__ == '__main__':
     config = create_config()