⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsrztbld.py

📁 linux下的一款播放器
💻 PY
📖 第 1 页 / 共 2 页
字号:
        g_rzt_apple_script.Append(                'end timeout',                'end tell'                )def Strip(platform, project, dirs):    # Windows doesn't seem to have problems w/symbols, and the    # cygnus strip command does strange things for me.    if (platform.type != 'unix'):        return 'no strip support for this platform'    temp_dir = os.path.join(project.src_root_path, project.module_dir)    temp_dir = os.path.join(temp_dir, temp_dir_name)    for dir in dirs:        target = os.path.join(temp_dir,dir[0])        target = os.path.join(target,dir[1])        if (platform.name == 'irix6'):            project.writeln('\t' + 'strip -f ' + target)        else:            project.writeln('\t' + 'strip ' + target)def CreateRZT(platform, project, rzt_file_name, bind_dirs):    if platform.name == 'win32' or platform.name == 'win16':        ##  MAKE ALL TEMP FILES WRITEABLE...        project.writeln('\tattrib -r ' + os.path.join(temp_dir_name, '*.*') + ' /s')        ##  RUN DISTCODE        if product_distcode != '' and product_executable != '':            project.writeln('\tdistcode ' + os.path.join(temp_dir_name, product_executable) + ' ' + product_distcode)    if (platform.name == 'win32'):        project.writeln('\tcd ' + temp_dir_name)                for bind_dir in bind_dirs:            project.writeln('\tcd ' + bind_dir)            project.writeln('\tEDITBIN /BIND:PATH=.;..\\ *.dll')            project.writeln('\tcd ' + os.pardir)                    project.writeln('\tcd ' + os.pardir)    if (platform.name == 'win32'):        pnpkg_path = project.target_dir    else:        pnpkg_path = os.path.join(project.src_root_path, 'pnpkg')        pnpkg_path = os.path.join(pnpkg_path, project.output_dir)    pnpkg_path = os.path.join(pnpkg_path, 'pnpkg')    ##  RUN PNPKG    if platform.name == 'win32' or platform.name == 'win16':        project.writeln('\tcd ' + temp_dir_name)        if USE_XTR_COMPRESSION == 0:                project.writeln('\t' + os.path.join(os.pardir, pnpkg_path) + ' -e ' + os.path.join(os.pardir, rzt_file_name) + '.hdr -f ' + os.path.join(os.pardir, rzt_file_name) + '.rzt ' + '*.*')        else:                project.writeln('\t' + os.path.join(os.pardir, pnpkg_path) + ' -c xtr -e ' + os.path.join(os.pardir, rzt_file_name) + '.hdr -f ' + os.path.join(os.pardir, rzt_file_name) + '.rzt ' + '*.*')        project.writeln('\tcd ' + os.pardir)    elif platform.type == 'unix':        ##  MAKE ALL TEMP FILES WRITEABLE...        project.writeln('\t(cd ' + temp_dir_name + '; chmod -R a+x *)')        ##  RUN DISTCODE        # if product_distcode != '' and product_executable != '':        #     project.writeln('\tdistcode ' + product_executable + ' ' + product_distcode)        ##  RUN PNPKG        path_to_pnpkg = os.path.join(os.pardir, os.pardir)        path_to_pnpkg = os.path.join(path_to_pnpkg, 'pnpkg')        path_to_pnpkg = os.path.join(path_to_pnpkg, project.output_dir)        path_to_archive = os.path.join(os.pardir, 'archive.rzt')        path_to_header =  os.path.join(os.pardir, rzt_file_name + '.hdr')        project.writeln('\t(cd ' + temp_dir_name + '; ' + os.path.join(path_to_pnpkg,'pnpkg')+ ' -ve ' + \            path_to_header + ' -f ' + path_to_archive + ' *)')    elif platform.name == 'mac':        # create a binary data file required by the PnPkg application        # create a unique name for each .bin file               datafile_path = os.path.join(project.src_root_path, project.module_dir, rzt_file_name + '.bin')        header_path = os.path.join(project.src_root_path, project.module_dir, rzt_file_name + '.hdr')        archive_path = os.path.join(project.src_root_path, project.module_dir, rzt_file_name + '.rzt')        temp_dir = os.path.join(project.src_root_path, project.module_dir, temp_dir_name)        o = open(datafile_path, 'wb')        items          = 0        tempstr        = temp_dir + ':' + '\000'        o.write(struct.pack('h', items+6))        o.write('pnpkg\000')        o.write('-e\000')        o.write(header_path + '\000')        o.write('-f\000')        o.write(archive_path + '\000')        o.write(tempstr)        o.close()        ## test to see if the pnpkg application built; if it didn't, then        ## don't try to call it because a dialog will pop up and hang the        ## remote build system; perhaps we should just sys.exit(1) at this        ## point so the build system knows not to try and run the script --JMP        if os.path.exists(pnpkg_path):            global g_rzt_apple_script            g_rzt_apple_script.Append(                    '-- Make the Archive',                    'tell application "%s"' % (pnpkg_path),                    'run',                    'with timeout of 99999 seconds',                    'open "%s"' % (datafile_path),                    'end timeout',                    'quit',                    'end tell')def CreateInstaller(platform, project):    rzt_src_path = os.path.join(project.src_root_path, project.module_dir)    rzt_src_path = os.path.join(rzt_src_path, project.target_name + '.rzt')    if platform.name == 'win32' or platform.name == 'win16':        project.writeln('\tcd ' + os.pardir)        project.writeln('\tcd ' + 'rssetshell')        project.writeln('\tnmake clean')        project.writeln('\tnmake depend')        ## Copy RZT file        project.writeln('\t' + platform.copy.cmd + ' ' + rzt_src_path + ' archive.rzt')        project.writeln('\tnmake')        project.writeln('\tcd ' + os.pardir)        project.writeln('\tcd ' + project.module_dir)    elif platform.type == 'unix':        inst_module = 'v80_%s_%s.bin' % (sysinfo.id, project.target_name)                setshell_base = os.path.join(project.src_root_path, 'rssetshell')         setshell_path = os.path.join(setshell_base, project.output_dir)        ## Copy RZT file        project.writeln('\tcp archive.rzt ' + setshell_path)        ## Create a self extracting exe file containing the archive.rzt file        project.writeln('\t(cd ' + setshell_path + '; python ../selfextr.py archive.rzt ../unix/archive.h)')        project.writeln('\t(cd ' + setshell_base + '; make clean)')        project.writeln('\t(cd ' + setshell_base + '; make)')        project.writeln('\t(cd ' + setshell_path + '; cat setup archive.rzt > ' + inst_module + ')')         project.writeln('\t(cd ' + setshell_path + '; chmod a+x '+ inst_module +')')    elif platform.name == 'mac':        temp_dir = os.path.join(project.src_root_path, project.module_dir)        temp_dir = os.path.join(temp_dir, temp_dir_name)        setshell_path1 = os.path.join(project.src_root_path, 'rssetshell', project.output_dir, 'rssetshell')        setshell_path2 = os.path.join(temp_dir, 'rssetshell')        global g_rzt_apple_script        g_rzt_apple_script.Append(                '-- Copy the archive',                'tell application "Finder"',                'with timeout of 99999 seconds',                                'try',                'AkuaCopy file "%s" to folder "%s"' % (setshell_path1, temp_dir),                'on error',                'error "The SETSHELL application did not build"',                'end try',                                'end timeout',                'end tell',                '-- Combine the archive and setshell application',                'FileToResource "%s" ResourceType "ARCH" ResourceID 128 SourceFile "%s"' % (setshell_path2, rzt_src_path)                )def CopyRZT(platform, project, rzt_file_name):    if platform.name == 'win32' or platform.name == 'win16':        project.writeln('\t' + platform.copy.cmd + ' ' + rzt_file_name + '.rzt' + ' ' + project.target_dir)    elif platform.type == 'unix':        project.writeln('\t' + platform.copy.cmd + ' ' + rzt_file_name + '.rzt' + ' ' + project.target_dir)    elif platform.name == 'mac':        rzt_file_path = os.path.join(project.src_root_path, project.module_dir)        rzt_file_path = os.path.join(rzt_file_path, rzt_file_name + '.rzt')        global g_rzt_apple_script        g_rzt_apple_script.Append(                '-- Copy the archive',                'tell application "Finder"',                'with timeout of 99999 seconds',                'AkuaCopy file "%s" to folder "%s"' % (rzt_file_path, os.path.join(project.src_root_path, project.output_dir)),                'end timeout',                'end tell'                )def CopyInstaller(platform, project):    if platform.name == 'win32' or platform.name == 'win16':        installer_exe = os.path.join(project.src_root_path, "rssetshell")        installer_exe = os.path.join(installer_exe, project.output_dir + 's')        installer_exe = os.path.join(installer_exe, "setup.exe")        output_exe = os.path.join(project.target_dir, project.target_name + '.exe')        project.writeln('\t' + platform.copy.cmd + ' ' + installer_exe + ' ' + output_exe)    elif platform.type == 'unix':        inst_module = 'v80_%s_%s.bin' % (sysinfo.id, project.target_name)                installer_exe = os.path.join(project.src_root_path, 'rssetshell')        installer_exe = os.path.join(installer_exe, project.output_dir)        installer_exe = os.path.join(installer_exe, inst_module)        output_exe = os.path.join(project.target_dir, inst_module)        project.writeln('\tcp ' + installer_exe + ' ' + output_exe)    elif platform.name == 'mac':        # XXX: HACK! Choose name of final installer target.        if project.target_name == 'playinst':                installer_name = 'RealPlayer Installer'        elif project.target_name == 'plusinst':                installer_name = 'RealPlayerPlus Installer'        elif project.target_name == 'encg2sdk':                installer_name = 'RealProducer G2 SDK Installer'        elif project.target_name == 'encinst':                installer_name = 'RealProducer G2 Installer'        elif project.target_name == 'pubinst':                installer_name = 'RealProducer Plus G2 Installer'        elif project.target_name == 'mppinst':                installer_name = 'RealBandwidthSimulator Setup'        elif project.target_name == 'preminst':                installer_name = 'Real Premiere Plug-in Setup'        elif project.target_name == 'geoprodinst':                installer_name = 'RealProd Geo G2 Installer'        elif project.target_name == 'geoprodplusinst':                installer_name = 'RealProd Geo Plus G2 Installer'        elif project.target_name == 'dsn6inst':                installer_name = 'RealPlayer Installer'        elif project.target_name == 'dsnpinst':                installer_name = 'RealPlayerPlus Installer'        elif project.target_name == 'mac_ah60':                installer_name = '@HomePlayer Installer'        elif project.target_name == 'mac_rm6u':                installer_name = 'Education RM6U Installer'        elif project.target_name == 'mac_rm6s':                installer_name = 'ISP RM6S Installer'        elif project.target_name == 'mac_rm6n':                installer_name = 'Online RM6N Installer'        elif project.target_name == 'mac_rm6z':                installer_name = 'OEM RM6Z Installer'        elif project.target_name == 'mac_rm6m':                installer_name = 'Misc RM6M Installer'        elif project.target_name == 'mac_rm6p':                installer_name = 'Peripheral RM6P Installer'        elif project.target_name == 'mac_rm6a':                installer_name = 'Publishing RM6A Installer'        elif project.target_name == 'mac_dsn6':                installer_name = 'Disney DSN6 Installer'                elif project.target_name == 'mac_ns60':                installer_name = 'Netscape NS60 Installer'              elif project.target_name == 'mac_aol6':                installer_name = 'AOL AOL6 Installer'        elif project.target_name == 'mac_elm6':                installer_name = 'Earthlink ELM6 Installer'        elif project.target_name == 'iw60inst':                installer_name = 'IWorld IW6M Installer'        elif project.target_name == 'mac_rm6c':                installer_name = 'Generic RM6C Installer'                                       elif project.target_name == 'nscpinst':                installer_name = 'Netscape NS60 Installer'              elif project.target_name == 'mac_uvom':                installer_name = 'UVOM Installer'                                       elif project.target_name == 'rn7ninst':                installer_name = 'RealPlayer Installer'                                 elif project.target_name == 'stubinst':                installer_name = 'RealStub Installer'                                   elif project.target_name == 'alchinst':                installer_name = 'Alchemy Installer'                                    elif project.target_name == 'geminst':                installer_name = 'Gemini Installer'                                     elif project.target_name == 'aol7inst':                installer_name = 'AOL7 Installer'        elif project.target_name == 'mac_rm7u':                installer_name = 'Education RM7U Installer'        elif project.target_name == 'mac_rm7s':                installer_name = 'ISP RM7S Installer'        elif project.target_name == 'mac_rm7n':                installer_name = 'Online RM7N Installer'        elif project.target_name == 'mac_rm7z':                installer_name = 'OEM RM7Z Installer'        elif project.target_name == 'mac_rm7m':                installer_name = 'Misc RM7M Installer'        elif project.target_name == 'mac_rm7p':                installer_name = 'Peripheral RM7P Installer'        elif project.target_name == 'mac_rm7a':                installer_name = 'Publishing RM7A Installer'                                    else:                installer_name = 'UNKNOWN INSTALLER'        setshell_path = os.path.join(project.src_root_path, project.module_dir, temp_dir_name, 'rssetshell')        installer_path = os.path.join(project.src_root_path, project.module_dir, temp_dir_name, installer_name)        global g_rzt_apple_script        g_rzt_apple_script.Append(                '--Rename the installer, copy it out of the tempdir, and dispose of the tempdir',                'tell application "Finder"',                'with timeout of 99999 seconds',                'set name of file "%s" to "%s"' % (setshell_path, installer_name),                'if file "%s" exists then' % (os.path.join(project.src_root_path, project.output_dir, installer_name)),                'delete file "%s"' % (os.path.join(project.src_root_path, project.output_dir, installer_name)),                'end if',                'AkuaCopy file "%s" to folder "%s"' % (installer_path, os.path.join(project.src_root_path, project.output_dir)),                'end timeout',                'end tell'                )def Terminate(platform, project):    if platform.name == 'mac':        global g_rzt_apple_script        g_rzt_apple_script.Append(                'end all',                'return all()'                )                project.append_script(g_rzt_apple_script)                # free the AppleScript by de-referencing it        g_rzt_apple_script = None

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -