@@ -74,7 +74,8 @@ parser.add_argument('command', nargs='?',
7474 python module/class to load if --server. If no command is \
7575 specified, a list of remote methods are displayed.' )
7676parser .add_argument ('params' , nargs = '*' ,
77- help = 'parameters for the remote call if --client (default)' )
77+ help = 'parameters for the remote call if --client \
78+ (default)' )
7879
7980
8081def setup_links (args , socket ):
@@ -91,6 +92,7 @@ def setup_links(args, socket):
9192 print 'connecting to "{0}"' .format (endpoint )
9293 socket .connect (endpoint )
9394
95+
9496def run_server (args ):
9597 server_obj_path = args .command
9698
@@ -109,17 +111,18 @@ def run_server(args):
109111 print 'serving "{0}"' .format (server_obj_path )
110112 return server .run ()
111113
114+
112115# this function does a really intricate job to keep backward compatibility
113- # with a previous version of zerorpc, and lazily retrieving results if possible...
116+ # with a previous version of zerorpc, and lazily retrieving results if possible
114117def zerorpc_inspect (client , method = None , long_doc = True , include_argspec = True ):
115118 try :
116119 remote_detailled_methods = client ._zerorpc_inspect (method ,
117120 long_doc )['methods' ]
118121
119122 if include_argspec :
120123 r = [(name + (inspect .formatargspec (* argspec ) if argspec else
121- '(...)' ), doc if doc else '<undocumented>' ) for name , argspec , doc
122- in remote_detailled_methods ]
124+ '(...)' ), doc if doc else '<undocumented>' )
125+ for name , argspec , doc in remote_detailled_methods ]
123126 else :
124127 r = [(name , doc if doc else '<undocumented>' )
125128 for name , argspec , doc in remote_detailled_methods ]
@@ -150,11 +153,13 @@ def zerorpc_inspect(client, method=None, long_doc=True, include_argspec=True):
150153 return (longest_name_len , ((name , doc ) for name , argspec , doc in
151154 remote_detailled_methods ()))
152155
153- r = [(name + (inspect .formatargspec (* argspec ) if argspec else '(...)' ), doc )
156+ r = [(name + (inspect .formatargspec (* argspec )
157+ if argspec else '(...)' ), doc )
154158 for name , argspec , doc in remote_detailled_methods ()]
155159 longest_name_len = max (len (name ) for name , doc in r )
156160 return (longest_name_len , r )
157161
162+
158163def run_client (args ):
159164 client = zerorpc .Client (timeout = args .timeout , heartbeat = args .heartbeat ,
160165 passive_heartbeat = not args .active_hb )
@@ -201,6 +206,7 @@ def run_client(args):
201206 for result in results :
202207 pprint (result )
203208
209+
204210def main ():
205211 args = parser .parse_args ()
206212 if args .bind or args .connect :
0 commit comments