本文整理汇总了Python中bbfreeze.Freezer.include_py方法的典型用法代码示例。如果您正苦于以下问题:Python Freezer.include_py方法的具体用法?Python Freezer.include_py怎么用?Python Freezer.include_py使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bbfreeze.Freezer
的用法示例。
在下文中一共展示了Freezer.include_py方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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()
示例2: main
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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')
示例3: _createBinaryDistribution
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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()
示例4: run
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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)
示例5: Freezer
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [as 别名]
from bbfreeze import Freezer #@UnresolvedImport
folder_name ="SysInterceptor"
f = Freezer(folder_name, includes=())
f.addScript("..\\interceptor_tray.py", gui_only=True)
f.use_compression = 0
f.include_py = True
f() # starts the freezing proces
import os;
os.system("copy ..\\CARRIER.ICO .\\SysInterceptor")
os.system("copy .\\SysInterceptor\\*.* ..\\..\\..\\..\\output\\final_release")
os.system("xcopy /E/Y ..\\calculator\\*.* ..\\..\\..\\..\\output\\final_release\\calculator\\")
示例6: Freezer
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [as 别名]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bbfreeze import Freezer
bbFreeze_Class = Freezer("package")
bbFreeze_Class.addScript("DamnVid.py", gui_only=True)
bbFreeze_Class.use_compression = 1
bbFreeze_Class.include_py = True
bbFreeze_Class()
示例7: Freezer
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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()
示例8: Freezer
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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()
示例9: find_n_fix_missing
# 需要导入模块: from bbfreeze import Freezer [as 别名]
# 或者: from bbfreeze.Freezer import include_py [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"))