当前位置: 首页>>代码示例>>Python>>正文


Python Freezer.addScript方法代码示例

本文整理汇总了Python中bbfreeze.Freezer.addScript方法的典型用法代码示例。如果您正苦于以下问题:Python Freezer.addScript方法的具体用法?Python Freezer.addScript怎么用?Python Freezer.addScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bbfreeze.Freezer的用法示例。


在下文中一共展示了Freezer.addScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
    def run(self, wininst=False):
        # import bbfreeze only thenabout to run the command
        from bbfreeze import Freezer

        # get information from egg_info
        ei = self.get_finalized_command("egg_info")
        target = normalize_path(self.bdist_base)
        dist = Distribution(
            target,
            PathMetadata(target, os.path.abspath(ei.egg_info)),
            project_name=ei.egg_name)

        # install wrapper_Scripts into self.bdist_base == self.script_dir
        self.install_wrapper_scripts(dist)

        # now get a Freezer()
        f = Freezer(os.path.join(self.dist_dir,
                                 "%s-%s" % (ei.egg_name, ei.egg_version)))
        f.include_py = self.include_py

        # freeze each of the scripts
        for args in get_script_args(dist, wininst=wininst):
            name = args[0]
            if name.endswith('.exe') or name.endswith(".exe.manifest"):
                # skip .exes
                continue
            log.info('bbfreezing %s', os.path.join(self.script_dir, name))
            f.addScript(os.path.join(self.script_dir, name),
                        gui_only=name.endswith('.pyw'))
        # starts the freezing process
        f()
开发者ID:RyanHope,项目名称:ccfreeze,代码行数:33,代码来源:bdist_bbfreeze.py

示例2: _createBinaryDistribution

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
    def _createBinaryDistribution(self, startScripts):
        """ 
        Creates a binary DataFinder distribution for Linux/Windows platforms
        including the Python interpreter.
        
        @param startScripts: Contains a list of start scripts for which executables are generated. The scripts
                             are described by tuples of script path and a boolean indicating whether 
                             on the Windows platform a console window is visible or not.
        @type startScripts: C{list} of C{tuple} (C{unicode}/C{string}, C{bool})
        """
        
        forcedIncludes = _forcedIncludes[:]
        forcedIncludes.extend(_qtSpecificForcedIncludes)
        if sys.platform == "win32":
            forcedIncludes.extend(_win32ForcedIncludes)
        
        freezer = Freezer(self.destinationPath, includes=forcedIncludes)
        freezer.include_py = not self.excludepythonshell
        for scriptPath, guiOnly in startScripts:
            freezer.addScript(scriptPath, gui_only=guiOnly)
        
        # create distribution
        freezer()
        
        # copy readme, license, changes files
        shutil.copy(self.__buildConfiguration.readmeFile, self.destinationPath)
        shutil.copy(self.__buildConfiguration.licenseFile, self.destinationPath)
        shutil.copy(self.__buildConfiguration.changesFile, self.destinationPath)
        
        # copy image, example script files
        destinationImagePath = os.path.join(self.destinationPath, self.__buildConfiguration.imageDirectory)
        os.makedirs(destinationImagePath)
        baseImageDir = self.__buildConfiguration.imageDirectory
        for imageName in os.listdir(baseImageDir):
            if imageName.endswith(".ico"):
                shutil.copy(os.path.join(baseImageDir, imageName), destinationImagePath)
        
        scriptsExampleDir = self.__buildConfiguration.scriptExamplesDirectory
        shutil.copytree(scriptsExampleDir, os.path.join(self.destinationPath, scriptsExampleDir))
        docDir = "doc"
        shutil.copytree(docDir, os.path.join(self.destinationPath, docDir))
        shutil.rmtree(docDir)

        # create manifest files
        if sys.platform == "win32":
            scriptNames = [startScript[0] for startScript in startScripts]
            if not self.excludepythonshell:
                scriptNames.append("py.py")
            
            for scriptName in scriptNames:
                fileExtension = ".exe.manifest"
                content = _MANIFEST_FILE_CONTENT
                    
                fileBaseName = os.path.basename(scriptName).replace(".py", fileExtension)
                filePath = os.path.join(self.destinationPath, fileBaseName)
                fileHandle = open(filePath, "wb")
                fileHandle.write(content)
                fileHandle.close()
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:60,代码来源:bdist.py

示例3: main

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
def main():
    #includes = ['requests',  'email.utils']
    includes = ['requests',  'email.utils']
    excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
                'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl', 'tk'
                'Tkconstants', 'Tkinter',]
     
    frz = Freezer(destDir, includes=includes, excludes=excludes)
     
    #frz.addScript("meteor.py", gui_only=True)

    frz.addScript("play_development.py")
    frz.addScript("play_fullscreen.py", gui_only=True)
    frz.addScript("play_windowed.py", gui_only=True)
    #frz.addScript("gameassets.py")
    #frz.addScript("geoip.py")
    #frz.addScript("shipsprite.py")
    #frz.addScript("sprites.py")
    #frz.addScript("timevars.py")
    #frz.addScript("vector.py")

     
    frz.use_compression = 0
    frz.include_py = True
    frz()

    addFile('config.json')
    addFile('avbin.dll')

    #addDir('images')
    #addDir('fonts')
    #addDir('sounds')
    addDir('themes')
开发者ID:sergio-py2,项目名称:meteor,代码行数:35,代码来源:bbfreezer.py

示例4: run

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
    def run(self):
        from bbfreeze import Freezer
        freezer = Freezer(distdir = self.dist_dir,
                          includes = self.includes,
                          excludes = self.excludes)
        freezer.include_py = self.include_py

        if self.distribution.scripts:
            for script in self.distribution.scripts:
                freezer.addScript(script, gui_only = False)

        # execute freeze
        freezer()
        # include extra libs - hack for Unix
        if self.extra_libs:
            print "extra_libs: ", self.extra_libs
            for lib in self.extra_libs:
                shutil.copy(lib, self.dist_dir)
        # include data_files
        if self.data_files:
            print "data_files: ", self.data_files
            for df in self.data_files:
                shutil.copy(df, self.dist_dir)
开发者ID:exxeleron,项目名称:yak,代码行数:25,代码来源:setup.py

示例5: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
from bbfreeze import Freezer

f = Freezer('youkuv', excludes=('twisted',))
f.addScript("youkuv.py")
f()
开发者ID:scientihark,项目名称:myuserscript,代码行数:7,代码来源:pack.py

示例6: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
                        windows = windows,
                        options = options,
                        version=_appVersion,
                        description=_appDescription,
                        author=_authorName,
                        author_email=_authorEmail,
                        url=_authorURL,
                        data_files=matplotlibdata_files+data_files,
        )

if sys.platform.startswith("2linux"):
	# bb_setup.py
	from bbfreeze import Freezer
	 
	f = Freezer(distdir="bb-binary")
	f.addScript("RemoteViewer.py")
	f()

if sys.platform.startswith("linux"):
        ### example command: python setup.py build
        includes = ['matplotlib','mpl_toolkits','matplotlib.backends.backend_tkagg']
        includefiles = []

        from cx_Freeze import setup, Executable
        ### use to get rid of library.zip and move into the executable, along with appendScriptToLibrary and appendScriptToExe
        #buildOptions = dict(create_shared_zip = False) 

	setup(
		name = _appName,
		version=_appVersion,
		description=_appDescription,
开发者ID:wuxue,项目名称:altanalyze,代码行数:33,代码来源:setupRemoteViewer.py

示例7: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
#!/usr/bin/env python

from bbfreeze import Freezer

includes = ['zmq', 'zmq.utils.strtypes', 'zmq.utils.jsonapi']
excludes = ['Tkinter', 'tcl', 'Tkconstants']

fre = Freezer(distdir="bb_salt", includes=includes, excludes=excludes)
fre.addScript('/usr/bin/salt-minion')
fre.use_compression = 0
fre.include_py = True
fre()
开发者ID:11craft,项目名称:salt,代码行数:14,代码来源:freeze.py

示例8: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
from bbfreeze import Freezer

f = Freezer("bbfreeze", includes=["webscard.implementations.clusterscard", "sqlalchemy.dialects.sqlite"])
f.addScript("cherrypyserver.py")
f.addScript("manage.py")
f()
开发者ID:benallard,项目名称:webscard,代码行数:8,代码来源:bb_setup.py

示例9: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
#!/usr/bin/env python
import os
import shutil
import sys

from bbfreeze import Freezer

build_version = "1.4.3"
python_path = sys.prefix
script = os.path.join(python_path, "Scripts\\livestreamer-script.py")
script_exe = os.path.join(python_path, "Scripts\\livestreamer.py")

shutil.copy(script, script_exe)

includes = ("requests", "re", "xml", "xml.dom.minidom",
            "zlib", "ctypes", "argparse", "hmac", "tempfile",
            "os", "sys", "subprocess", "getpass", "msvcrt",
            "urllib", "urlparse", "pkgutil", "imp")

dst = "..\\build-win32\\livestreamer-bbfreeze-" + build_version + "\\"

f = Freezer(dst, includes=includes)
f.include_py = False
f.addScript(script_exe, gui_only=False)
f()



开发者ID:dotsam,项目名称:livestreamer,代码行数:27,代码来源:build-bbfreeze.py

示例10: find_n_fix_missing

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
from bbfreeze import Freezer
import shutil, glob, os, sys, subprocess

def find_n_fix_missing(libs):
    missing = []
    for f in libs:
        output = subprocess.Popen(['otool', '-XL', f], stdout=subprocess.PIPE).communicate()[0]
        for line in output.splitlines():
            libpath = line.strip().split(" ")[0]
            if libpath != f and libpath[0] != "/" and libpath[0] != "@":
                if not libpath in missing and not '.framework' in libpath:
                    missing.append(libpath)
                    shutil.copy(os.path.join('/usr/lib', libpath), libpath)
                subprocess.Popen(['install_name_tool', '-change', libpath, "@executable_path/" + libpath, f])
    if missing:
        find_n_fix_missing(missing)

includes = []
excludes = ['Tkinter', 'readline']

freezer = Freezer('dist/freeze/Config_Editor', includes=includes, excludes=excludes)
freezer.addScript('src/configeditor.py', gui_only=True)
freezer.include_py = False
freezer.use_compression = True
freezer()

if sys.platform == 'darwin':
    os.chdir(freezer.distdir)
    find_n_fix_missing(glob.glob("*.so") + glob.glob("*.dylib"))
开发者ID:CogWorks,项目名称:SpaceFortress,代码行数:31,代码来源:setup_Config_Editor.py

示例11: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
#!/usr/bin/env python

build_version = "1.3.2"
python_path = "C:\\Python27\\"

import os
import glob
import shutil

from bbfreeze import Freezer

shutil.copy(python_path + "Scripts\livestreamer-script.py", python_path + "Scripts\livestreamer.py")

includes = ("pbs", "requests", "re", "xml", "xml.dom.minidom",
            "zlib", "ctypes", "argparse", "hmac", "tempfile",
            "os", "sys", "subprocess", "getpass", "msvcrt",
            "urllib", "urlparse", "pkgutil", "imp")

dst = "..\\build-win32\\livestreamer-bbfreeze-" + build_version + "\\"

f = Freezer(dst, includes=includes)
f.include_py = False
f.addScript(python_path + "Scripts\livestreamer.py", gui_only=False)

f()



开发者ID:bbarenblat,项目名称:livestreamer,代码行数:27,代码来源:build-bbfreeze.py

示例12: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
from distutils.core import setup
from bbfreeze import Freezer
import os


#vers=os.system('svnversion -n')
#print vers
#Binary dist
f = Freezer("../bin")
f.addScript("GLOFRIS.py")
#f.addScript("GLOFRIS_utils.py")
#f.addScript("changeGLCC.py")
#f.addScript("GLCC2PCRGLOB.py")
#f.addScript("GLOFRIS_risk.py")
#f.addScript("post_proc.py")
f()    # starts the freezing process
开发者ID:edwinkost,项目名称:extreme_value_analysis,代码行数:18,代码来源:make_GLOFRIS.py

示例13: System

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
from bbfreeze import Freezer
from sx.system import System
system = System()

include = (
    "sx",
    '__future__',
    #'rpm',
    'os',
    'sys',
    'distutils',
    'docopt',
    'time',
    'logging',
    'subprocess',
    'pipes',
    'platform',
    'webbrowser',
    'socket',
    're',
)
f = Freezer("merlin.%s" % system.arch , includes=include)
f.addScript("merlin.py")
f.addModule('rpm')
f()
开发者ID:pussbb,项目名称:sx-installer,代码行数:27,代码来源:freeze.py

示例14: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
#easy_install bbfreeze

from bbfreeze import Freezer

f = Freezer("dist")
f.addScript('pyroller/pyroller.py')
f()

#python setup.py
#creates a dsit directory wtih libs, using root fil pyroller/pyroller.py

#matplotlib.numerix import error fix
#in file /usr/local/lib/python2.7/dist-packages/bbfreeze-1.1.3-py2.7.egg/bbfreeze/recipes
#wrap this lline mf.import_hook("matplotlib.numerix.random_array", m)
#in an try/except ImportError 
开发者ID:metulburr,项目名称:random,代码行数:17,代码来源:setup_bbfreeze.py

示例15: Freezer

# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import addScript [as 别名]
# bb_setup2.py
from bbfreeze import Freezer

includes = []
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
            'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
            'Tkconstants', 'Tkinter']

bbFreeze_Class = Freezer('dist', includes=includes, excludes=excludes)

bbFreeze_Class.addScript("sampleApp.py", gui_only=True)

bbFreeze_Class.use_compression = 0
bbFreeze_Class.include_py = True
bbFreeze_Class()
开发者ID:medellinfein,项目名称:python101,代码行数:17,代码来源:bb_setup2.py


注:本文中的bbfreeze.Freezer.addScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。