@@ -28,35 +28,27 @@ def __init__(self):
2828 default = False ,
2929 help = "Show the running python version."
3030 )
31- self .parser .add_option (
32- "-b" , "--bin" ,
33- dest = "bin" ,
34- default = 'python' ,
35- help = "Use the specified script in python's bin directory."
36- )
37- self .parser .add_option (
38- "-o" , "--options" ,
39- dest = "options" ,
40- default = '' ,
41- help = "Options passed directly to runs script."
42- )
31+ self .parser .disable_interspersed_args ()
4332
4433 def run_command (self , options , args ):
4534 if not args :
4635 logger .info ("Unrecognized command line argument: argument not found." )
4736 sys .exit (1 )
48- python_file = args [0 ]
49-
5037 pythons = self ._get_pythons (options .pythons )
5138 for d in pythons :
52- path = os .path .join (PATH_PYTHONS , d , 'bin' , options .bin )
39+ if options .verbose :
40+ logger .info ('*** %s ***' % d )
41+ path = os .path .join (PATH_PYTHONS , d , 'bin' , args [0 ])
5342 if os .path .isfile (path ) and os .access (path , os .X_OK ):
54- if options .verbose :
55- logger .info ('*** %s ***' % d )
56- p = Popen ("%s %s %s" % (path , options .options , python_file ), shell = True )
43+ p = Popen ("%s %s" % (path , ' ' .join (args [1 :])), shell = True )
5744 p .wait ()
5845 else :
59- logger .info ('%s: No such file or directory.' % path )
46+ path = os .path .join (PATH_PYTHONS , d , 'bin' , 'python' )
47+ if os .path .isfile (path ) and os .access (path , os .X_OK ):
48+ p = Popen ("%s %s" % (path , ' ' .join (args )), shell = True )
49+ p .wait ()
50+ else :
51+ logger .info ('%s: No such file or directory.' % path )
6052
6153 def _get_pythons (self , _pythons ):
6254 pythons = [Package (p ).name for p in _pythons ]
0 commit comments