<s> import os , platform , shutil <EOL> from optparse import OptionParser <EOL> def main ( ) : <EOL> desc = "<STR_LIT>" <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> desc += "<STR_LIT>" <EOL> parser = OptionParser ( description = desc ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , default = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , action = "<STR_LIT:store_true>" , help = "<STR_LIT>" ) <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , default = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> src_dir = os . path . dirname ( os . path . realpath ( __file__ ) ) ; <EOL> templates = os . listdir ( os . path . join ( src_dir , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> prefix = os . path . expanduser ( options . prefix ) <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> from distutils . sysconfig import get_python_lib <EOL> site_packages_dir = get_python_lib ( ) <EOL> pyqt5_dir = os . path . join ( site_packages_dir , "<STR_LIT>" ) <EOL> cx_freeze_Path = os . path . join ( os . path . dirname ( os . path . dirname ( site_packages_dir ) ) , "<STR_LIT>" , "<STR_LIT>" ) <EOL> dist = os . path . expanduser ( options . dist ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" + prefix + "<STR_LIT>" ) <EOL> if os . path . exists ( prefix ) : <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> shutil . rmtree ( prefix ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> shutil . copytree ( os . path . join ( src_dir , "<STR_LIT>" ) , prefix , <EOL> ignore = shutil . ignore_patterns ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> shutil . copytree ( os . path . join ( src_dir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> os . path . join ( prefix , "<STR_LIT>" ) ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> for t in templates : <EOL> temp = os . path . join ( src_dir , "<STR_LIT>" , "<STR_LIT>" , t ) <EOL> pyname = "<STR_LIT>" + t . lower ( ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> os . system ( os . path . join ( pyqt5_dir , "<STR_LIT>" ) + "<STR_LIT>" + temp + "<STR_LIT>" + os . path . join ( prefix , pyname ) ) <EOL> else : <EOL> os . system ( "<STR_LIT>" + temp + "<STR_LIT>" + os . path . join ( prefix , pyname ) ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" + pyname ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> res_file = os . path . join ( src_dir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> pyname = "<STR_LIT>" <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> os . system ( os . path . join ( pyqt5_dir , "<STR_LIT>" ) + "<STR_LIT>" + res_file + "<STR_LIT>" + os . path . join ( prefix , pyname ) ) <EOL> else : <EOL> os . system ( "<STR_LIT>" + res_file + "<STR_LIT>" + os . path . join ( prefix , pyname ) ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" + pyname ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> if platform . system ( ) == "<STR_LIT>" and options . exe : <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" + dist + "<STR_LIT>" ) <EOL> if os . path . exists ( dist ) : <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> shutil . rmtree ( dist ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> icon_path = os . path . join ( src_dir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> os . system ( "<STR_LIT>" + cx_freeze_Path + "<STR_LIT>" + os . path . join ( prefix , "<STR_LIT>" ) + "<STR_LIT>" + <EOL> dist + "<STR_LIT>" + icon_path + "<STR_LIT>" ) <EOL> shutil . copy ( os . path . join ( pyqt5_dir , "<STR_LIT>" ) , dist ) <EOL> if options . verbose : <EOL> print ( "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
