Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
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')
Esempio n. 4
0
 def do_build_exe(self):
     Freezer.__init__(self, self.dist_dir,
         includes=self.includes,
         excludes=self.excludes,
     )
     self.addScript(SCRIPT_NAME, gui_only=True)
     self.setIcon('pixmaps/app-o-cloud-32.ico')
     Freezer.__call__(self)
     if self.distribution.has_data_files():
         print "*** copy data files ***"
         install_data = self.reinitialize_command('install_data')
         install_data.install_dir = self.dist_dir
         install_data.ensure_finalized()
         install_data.run()
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)
Esempio n. 7
0
    setup(
        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("AltAnalyze.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(
Esempio n. 8
0
#!/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()
Esempio n. 9
0
#!/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()
Esempio n. 10
0
from distutils.core import setup
from bbfreeze import Freezer
from subprocess import call
import ctypes

nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)

f = Freezer("wtools")
f.addScript("scripts\CatchRiver.py")
f.addScript("scripts\CheckInput.py")
f.addScript("scripts\CreateGrid.py")
f.addScript("scripts\StaticMaps.py")
f()  # starts the freezing process
Esempio n. 11
0
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 22 22:27:18 2019

@author: thoma
"""

from bbfreeze import Freezer

freezer = Freezer(distdir='dist')
freezer.addScript('helloworld.py', gui_only=True)
freezer()
Esempio n. 12
0
# 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()
Esempio n. 13
0
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()
Esempio n. 14
0
from distutils.core import setup
from bbfreeze import Freezer
import sgr
import ctypes,glob,os,shutil, matplotlib

def dependencies_for_freeezing():
	import netCDF4_utils


nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)


thename = "sgr"+ '-'+nrbits
f = Freezer("sgr"+'-'+nrbits,includes = ['h5py','h5py.*','scipy', 'scipy.integrate', 'scipy.special.*',\
                                         'scipy.linalg.*','scipy.special._ufuncs_cxx',\
                                         'scipy.sparse.csgraph._validation'])
f.addScript("sgr/__init__.py")
f.addScript("sgr/sgr_main.py")

f()    # starts the freezing process


data_files=matplotlib.get_py2exe_datafiles()
gdaldata = os.getenv("GDAL_DATA")
data_files.append(("./gdal-data", glob.glob(gdaldata + "/*.*")))

data_files.append(("./sgr/convert", glob.glob('sgr/convert' + "/*.*")))
data_files.append(("./sgr/data", glob.glob('sgr/data' + "/*.*")))

print data_files
print "Copying extra data files..."
#!/usr/bin/env python

from bbfreeze import Freezer
f = Freezer("miasmod")
f.addScript("miasmod.py", gui_only=True)
# f.addScript("miasmod.py", gui_only=False)
f()

# vi:noexpandtab:sw=8:ts=8
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"))
Esempio n. 17
0
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbfreeze/
"""

from bbfreeze import Freezer
import sys, os, shutil

shutil.rmtree('DNATool', ignore_errors=True)
path=os.path.abspath('../../..')
dnatoolpath=os.path.abspath('../../../DNATool2')
version = '2.0'

f = Freezer('DNATool', excludes=('wx'))
f.addScript(os.path.join(dnatoolpath, "DNAToolApp.py"))
#these lines allow the plugins to work

m=f.mf
f()    # runs the freezing process

'''post freeze'''

#add resource files
resources = ['restriction_enzymes.DAT',
             'images/DNATool2logo.ico',
             'test.DTP']

for r in resources:
    shutil.copy(os.path.join(dnatoolpath, r), 'DNATool')
Esempio n. 18
0
import ctypes
import os
import glob, shutil
import matplotlib


def dependencies_for_freeezing():
    import netCDF4_utils


nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)
data_files = []

thename = "e2o_dstools-" + str(nrbits) + "-bit"

f = Freezer("e2o_dstools-" + str(nrbits) +"-bit",\
            includes=('numpy','scipy','scipy.special._ufuncs_cxx','scipy.linalg.*','scipy.sparse.csgraph._validation'))
f.addScript("e2o_dstools/e2o_radiation.py")
f.addScript("e2o_dstools/e2o_getvar.py")
f.addScript("e2o_dstools/e2o_calculateEvaporation.py")
f()  # starts the freezing process

# matplolib data files
data_files = matplotlib.get_py2exe_datafiles()

ddir = "c:/pcraster4-64/lib/"
data_files.append((".", glob.glob(ddir + "/*.dll")))

ddir = 'e2o_dstools/data/'
data_files.append(("./data", glob.glob(ddir + "/*.*")))

gdaldata = os.getenv("GDAL_DATA")
Esempio n. 19
0
#Damien Farrell, #October 2009
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbfreeze/
"""

from bbfreeze import Freezer
import sys, os, shutil

shutil.rmtree('DNATool', ignore_errors=True)
path = os.path.abspath('../../..')
dnatoolpath = os.path.abspath('../../../DNATool2')
version = '2.0'

f = Freezer('DNATool', excludes=('wx'))
f.addScript(os.path.join(dnatoolpath, "DNAToolApp.py"))
#these lines allow the plugins to work

m = f.mf
f()  # runs the freezing process
'''post freeze'''

#add resource files
resources = ['restriction_enzymes.DAT', 'images/DNATool2logo.ico', 'test.DTP']

for r in resources:
    shutil.copy(os.path.join(dnatoolpath, r), 'DNATool')

#make zip archive
import zipfile
Esempio n. 20
0
    setup(
        windows=windows,
        options=options,
        version=_appVersion,
        description=_appDescription,
        author=_authorName,
        author_email=_authorEmail,
        url=_authorURL,
        #data_files=data_files,
    )

if sys.platform.startswith("2linux"):
    # bb_setup.py
    from bbfreeze import Freezer

    f = Freezer(distdir="bb-binary")
    f.addScript("GO_Elite.py")
    f()

if sys.platform.startswith("linux"):
    ### example command: python setup.py build
    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,
        author=_authorName,
        author_email=_authorEmail,
Esempio n. 21
0
from bbfreeze import Freezer
import shutil

distdir = "dist"
freeze = Freezer(
    distdir=distdir, includes=("enthought.tvtk.pyface.ui.wx.decorated_scene", "enthought.tvtk.tvtk", "vtk")
)

freeze.addScript("app.py", gui_only=True)
freeze()

shutil.copytree("./examples", distdir + "/examples")
Esempio n. 22
0

data_files = matplotlib.get_py2exe_datafiles()
includes = ['wflow.wflow_bmi', 'wflow.wflow_w3ra', 'wflow.wflow_bmi_combined']
#include_files = glob.glob("c:\Anaconda\Lib\site-packages\zmq\backend\cython\*.pyd")

nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)

# Extra packages needed for the bmi linkage openda:
# https://github.com/openearth/mmi-python
# https://github.com/openearth/bmi-python
# conda install cython
# conda install pyzmq
# easy_install requests
thename = "Wflow" + MVERSION + '-' + nrbits + "-wflow_kernel_openda"
f = Freezer(thename, includes=includes)
f.addScript("wflow/__init__.py")
f.addScript("openda/thrift_bmi_raster_server.py")
f.addScript("wflow/wflow_sbm.py")
f.addScript("Scripts/wflow_sbm_rtc.py")
f.addScript("wflow/wflow_hbv.py")
f.addScript("wflow/wflow_adapt.py")
f.addScript("wflow/wflow_w3ra.py")
#f.addScript("wflow/wflow_hbv_snow2.py")
f.addScript("wflow/wflow_delwaq.py")
f.addScript("wflow/wflow_wave.py")
f.addScript("wflow/wflow_gr4.py")
f.addScript("wflow/wflow_floodmap.py")
f.addScript("wflow/wflow_routing.py")
f.addScript('wflow/wflow_sphy.py', base=base)
f.addScript("Scripts/bmi2runner.py")
Esempio n. 23
0
import os
import shutil

from bbfreeze import Freezer

freezedir = os.path.join("bfreeze", "emptyorch_%s" % os.name)
f = Freezer(freezedir)
f.addScript("emptyorch.py")
f()
shutil.copy("emptyorch.xrc", freezedir)
shutil.copy("fake.mp3", freezedir)
Esempio n. 24
0
from distutils.core import setup
from bbfreeze import Freezer
from _version import *
import ctypes


def dependencies_for_freeezing():
    import netCDF4_utils


nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)

f = Freezer("Wflow" + MVERSION + '-' + nrbits)
f.addScript("wflow/__init__.py")
f.addScript("wflow/wflow_sbm.py")
f.addScript("wflow/wflow_hbv.py")
f.addScript("wflow/wflow_adapt.py")
f.addScript("wflow/wflow_W3RA.py")
#f.addScript("wflow/wflow_hbv_snow2.py")
f.addScript("wflow/wflow_delwaq.py")
f.addScript("wflow/wflow_wave.py")
f.addScript("wflow/wflow_gr4.py")
f.addScript("wflow/wflow_floodmap.py")
f.addScript("wflow/wflow_routing.py")
#f.addScript("wflow/plottss.py")
f.addScript("Scripts/wflow_prepare_step1.py")
#f.addScript("Scripts/area_in_out.py")
f.addScript("Scripts/wflow_prepare_step2.py")
f.addScript("Scripts/pcr2netcdf.py")
#f.addScript("wflow/wflow_fit.py") # Does not work becuse of QT
f()  # starts the freezing process
Esempio n. 25
0
from bbfreeze import Freezer
import os
import sys

f = Freezer("space-build", includes=("prettytable", "space", "argparse"))
python_path = os.path.dirname(sys.executable) + "/"
f.addScript(python_path + "space")
f.use_compression = 0
f.include_py = True
f()
Esempio n. 26
0
 def run(self):
     from bbfreeze import Freezer
     f = Freezer("dist/win32/osm2hydro")
     f.addScript("../src/osm2hydro/dem_filter.py")
     f.addScript("../src/osm2hydro/gdal_density.py")
     f.addScript("../src/osm2hydro/gdal_merge.py")
     f.addScript("../src/osm2hydro/osm2hydro.py")
     f.addScript("../src/osm2hydro/poly_density.py")
     f()  # starts the freezing process
Esempio n. 27
0
from bbfreeze import Freezer

f = Freezer("bbfreeze", includes=["webscard.implementations.clusterscard", "sqlalchemy.dialects.sqlite"])
f.addScript("cherrypyserver.py")
f.addScript("manage.py")
f()
Esempio n. 28
0
#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 
Esempio n. 29
0
        setup(
                        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,
Esempio n. 30
0
#!/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()



Esempio n. 31
0
from bbfreeze import Freezer

f = Freezer('youkuv', excludes=('twisted',))
f.addScript("youkuv.py")
f()
Esempio n. 32
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

DISTDIR = 'yasso-0.1a3'
import shutil
from bbfreeze import Freezer

f = Freezer(DISTDIR)
f.addScript("../yasso.py", gui_only=False)
f.include_py = True
f()  # starts the freezing process
# copy the neeeded data files to the distribution dir
shutil.copy('../yasso_param.dat', DISTDIR + '/')
shutil.copy('../demo_input.txt', DISTDIR + '/')
Esempio n. 33
0
# 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()
Esempio n. 34
0
        setup(
                        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("AltAnalyze.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,
Esempio n. 35
0
import ctypes, glob, os, shutil
import matplotlib


def dependencies_for_freeezing():
    import netCDF4_utils


nrbits = str(ctypes.sizeof(ctypes.c_voidp) * 8)
includes = [
    'wflow.wflow_bmi', 'wflow.wflow_w3ra', 'wflow.wflow_bmi_combined', 'bmi',
    'bmi.wrapper'
]

thename = "Wflow" + MVERSION + '-' + nrbits
f = Freezer("Wflow" + MVERSION + '-' + nrbits, includes=includes)
f.addScript("wflow/__init__.py")
f.addScript("wflow/wflow_topoflex.py")
f.addScript("wflow/wflow_sbm.py")
f.addScript("Scripts/wflow_sbm_rtc.py")
f.addScript("wflow/wflow_hbv.py")
f.addScript("wflow/wflow_adapt.py")
f.addScript("wflow/wflow_w3ra.py")
#f.addScript("wflow/wflow_hbv_snow2.py")
f.addScript("wflow/wflow_delwaq.py")
f.addScript("wflow/wflow_wave.py")
f.addScript("wflow/wflow_gr4.py")
f.addScript("wflow/wflow_floodmap.py")
f.addScript("wflow/wflow_routing.py")
f.addScript("Scripts/bmi2runner.py")
f.addScript("Scripts/wflow_prepare_step1.py")
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
Esempio n. 37
0
from bbfreeze import Freezer
f = Freezer("yt-0.3",
            includes=("pytz", "numpy.oldnumeric.fft", "pytz.timezone"))
f.addScript("scripts/reason")
f.addScript("scripts/yt")
f()  # starts the freezing process
Esempio n. 38
0
    # Use cx_Freeze to freeze the client.

    # Get path to Scientific_netcdf module
    sppath = os.path.join(os.path.dirname(Scientific.__file__), sys.platform)

    # Run FreezePython
    proc = subprocess.Popen([
        'FreezePython', '--target-dir=' + targetdir,
        '--include-path=' + sppath,
        '--include-modules=encodings.ascii,encodings.latin_1,encodings.utf_8',
        '--exclude-modules=' + ','.join(excludes), 'run.py'
    ])
    proc.wait()
elif task == 'bbfreeze':
    from bbfreeze import Freezer
    f = Freezer(targetdir, excludes=excludes)
    f.include_py = False
    f.addScript("run.py")
    f()  # starts the freezing process
elif task == 'PyInstaller':
    sys.path.append('/home/jorn/pyinstaller-1.3')
    import Build
    specnm = 'run'
    Build.SPECPATH = os.getcwd()
    Build.WARNFILE = os.path.join(Build.SPECPATH, 'warn%s.txt' % specnm)
    Build.BUILDPATH = os.path.join(Build.SPECPATH, 'build%s' % specnm)
    if not os.path.exists(Build.BUILDPATH):
        os.mkdir(Build.BUILDPATH)
    a = Build.Analysis([
        os.path.join(Build.HOMEPATH, 'support/_mountzlib.py'),
        os.path.join(Build.HOMEPATH, 'support/useUnicode.py'),
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\\")
# bb_setup.py
from bbfreeze import Freezer

f = Freezer(distdir="bb-binary")
f.addScript("sampleApp.py")
f()
Esempio n. 41
0
from bbfreeze import Freezer
f = Freezer("bbfreeze_test", includes=("bbfreeze_test.py"))
f.addScript("bbfreeze_test_run.py")
f()
Esempio n. 42
0
#!/usr/bin/env python
import os
import shutil
import sys

from bbfreeze import Freezer
from livestreamer import __version__

build_version = __version__
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", "ast")

freezer_path = os.path.dirname(os.path.abspath(__file__))
dst = "{0}\\..\\build-win32\\livestreamer-bbfreeze-{1}\\".format(
    freezer_path, build_version)

f = Freezer(dst, includes=includes)
f.include_py = False
f.addScript(script_exe, gui_only=False)
f()
Esempio n. 43
0
        setup(
                        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,
Esempio n. 44
0
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbfreeze/
"""

from bbfreeze import Freezer
import sys, os, shutil

shutil.rmtree('peatdb', ignore_errors=True)
path=os.path.abspath('../../..')
peatpath=os.path.abspath('../../../PEATDB')
version = '2.0'

f = Freezer('peatdb', excludes=('wx'))
f.addScript(os.path.join(peatpath, "PEATApp.py"))
f.addScript(os.path.join(peatpath, "Ekin/Ekin_main.py"))
f.addScript(os.path.join(peatpath, "Ekin/ModelDesign.py"))
f.addScript(os.path.join(peatpath, "DNAtool/DNAtool.py"))
#these lines allow the plugins to work
f.addModule('PEATDB.PEATApp')
f.addModule('PEATDB.plugins.PEATSAplugin')
f.addModule('PEATSA.WebApp.Data')
f.addModule('PEATSA.Database')
m=f.mf
f()    # runs the freezing process

'''post freeze'''
#mpl data
import matplotlib
Esempio n. 45
0
for dir in ['images', 'htmldoc', 'html']:
	targetDir = os.path.join( 'CrossMgr', dir )
	for f in os.listdir( dir ):
		tf.add( os.path.join(dir,f), os.path.join(targetDir, f) )

targetDir = os.path.join( 'CrossMgr', 'doc' )
tf.add( 'CrossMgrTutorial.doc', os.path.join(targetDir,'CrossMgrTutorial.doc') )
	
tf.close()
sys.exit()
'''------------------------------------------------------------------'''

#-----------------------------------------------------------------------
from bbfreeze import Freezer
f = Freezer(releasePath)
f.addScript("CrossMgr.pyw")
f()    # starts the freezing process

#-----------------------------------------------------------------------
# Remove any hard-coded library dependencies
#
for f in os.listdir( releasePath ):
	if not f.endswith( '.so' ):
		continue
	fname = os.path.join(releasePath, f)
	p = subprocess.Popen( ['chrpath', '-r', fname], stdout=subprocess.PIPE )
	ret = p.communicate()
	print( f, ret )

import Version
Esempio n. 46
0
from bbfreeze import Freezer
f = Freezer("dist")
f.addScript("chat_allsrc.py",True)

f()

Esempio n. 47
0
#!/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()
Esempio n. 48
0
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbfreeze/
"""

from bbfreeze import Freezer
import sys, os, shutil

shutil.rmtree('datapipeline', ignore_errors=True)
path = os.path.abspath('../../..')
pipepath = os.path.abspath('../../../DataPipeline')
peatpath = os.path.abspath('../../../PEATDB')
version = '1.2'

f = Freezer('datapipeline', excludes=('wx'))
f.addScript(os.path.join(pipepath, "PipelineApp.py"))
f.addScript(os.path.join(pipepath, "PipelineCommand.py"))
f.addScript(os.path.join(peatpath, "Ekin/ModelDesign.py"))
f.addScript(os.path.join(peatpath, "Ekin/Ekin_main.py"))

#these lines allow the plugins to work
f.addModule('PEATDB.PEATApp')

m = f.mf
f()  # runs the freezing process
'''post freeze'''
#mpl data
import matplotlib
mpldir = matplotlib.get_data_path()
datadir = 'datapipeline/mpl-data'
Esempio n. 49
0
    #py2exe packages lots of duplicates in the library.zip, let's save some space
    library_temp_dir = os.path.join('dist', 'library_temp')
    library_zip_archive = os.path.join('dist', 'library.zip')
    os.makedirs(library_temp_dir)
    unzip(library_zip_archive, library_temp_dir)
    os.unlink(library_zip_archive)
    zipl = zipfile.ZipFile(library_zip_archive, "w", compression=zipfile.ZIP_DEFLATED)
    recursive_zip(zipl, library_temp_dir)
    zipl.close()
    shutil.rmtree(library_temp_dir)
    print "web2py binary successfully built"

elif BUILD_MODE == 'bbfreeze':
    modules = base_modules + contributed_modules
    from bbfreeze import Freezer
    f = Freezer(distdir="dist", includes=(modules))
    #f.addScript("web2py_gevent.py")
    f.addScript("web2py.py")
    #to make executable without GUI we need this trick
    shutil.copy("web2py.py", "web2py_no_console.py")
    f.addScript("web2py_no_console.py", gui_only=True)
    f.setIcon('extras/icons/web2py.ico')
    f()    # starts the freezing process
    os.unlink("web2py_no_console.py")
    #add data_files
    for req in ['ABOUT', 'LICENSE', 'VERSION']:
        shutil.copy(req, os.path.join('dist', req))
    print "web2py binary successfully built"

try:
    os.unlink('storage.sqlite')
Esempio n. 50
0
from bbfreeze import Freezer




f = Freezer('neuronProfilerv0.1', includes= ['GJEMS.morph','LMIO.wrapper','neuronvisio', 'os','shutil','sys','json'])
f.addScript('basicMorphMetrics.py')
f()
Esempio n. 51
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-


from bbfreeze import Freezer


f = Freezer('quantee',
            includes=['pygame'],
            excludes=['numpy'])

f.addScript('src/quantee.py')
f()
Esempio n. 52
0
#!/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()



    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"))
Esempio n. 54
0
from bbfreeze import Freezer

f = Freezer('youkuv', excludes=('twisted', ))
f.addScript("youkuv.py")
f()