#NEWLINE# def make_cmd( prefix , pth , pyjsversion , pyjspth , cmdname , txt ) : #NEWLINE# #INDENT# python = sys . executable #NEWLINE# ver = pyjsversion #NEWLINE# pyjssitepth = os . path . join ( pyjspth , 'site-packages' ) #NEWLINE# if ( sys . platform == 'win32' ) : #NEWLINE# #INDENT# cmd_name = ( cmdname + '.py' ) #NEWLINE# if ( batcmd == 'pyjd' ) : #NEWLINE# #INDENT# cmd_name = 'pyjd.bat' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# cmd_name = cmdname #NEWLINE# #UNINDENT# p = os . path . join ( prefix , 'bin' ) #NEWLINE# if ( not os . path . exists ( p ) ) : #NEWLINE# #INDENT# os . makedirs ( p ) #NEWLINE# #UNINDENT# cmd = os . path . join ( 'bin' , cmd_name ) #NEWLINE# cmd = os . path . join ( prefix , cmd ) #NEWLINE# if os . path . exists ( cmd ) : #NEWLINE# #INDENT# if ( ( sys . platform == 'win32' ) and hasattr ( os , 'chmod' ) ) : #NEWLINE# #INDENT# os . chmod ( cmd , 493 ) #NEWLINE# #UNINDENT# os . unlink ( cmd ) #NEWLINE# #UNINDENT# f = open ( cmd , 'w' ) #NEWLINE# f . write ( ( txt % locals ( ) ) ) #NEWLINE# f . close ( ) #NEWLINE# if hasattr ( os , 'chmod' ) : #NEWLINE# #INDENT# os . chmod ( cmd , 365 ) #NEWLINE# #UNINDENT# if ( ( sys . platform == 'win32' ) and ( cmdname != 'pyjd' ) ) : #NEWLINE# #INDENT# cmd = os . path . join ( 'bin' , cmdname ) #NEWLINE# cmd = os . path . join ( prefix , cmd ) #NEWLINE# cmd = os . path . abspath ( cmd ) #NEWLINE# batcmd = ( '%s.bat' % cmd ) #NEWLINE# f = open ( batcmd , 'w' ) #NEWLINE# f . write ( ( batcmdtxt % locals ( ) ) ) #NEWLINE# f . close ( )