Esempio n. 1
0
def data_files():
    """Build list of data files to be installed"""
    files = []
    if sys.platform == "win32":
        import matplotlib

        datafiles = matplotlib.get_py2exe_datafiles()
        if isinstance(datafiles, list):
            files.extend(datafiles)
        else:
            files.append(datafiles)
        os.chdir("bin")
        for (dp, dn, names) in os.walk("share\\locale"):
            files.append((dp, map(lambda x: opj("bin", dp, x), names)))
        os.chdir("..")
        files.append((".", ["bin\\openerp.glade", "bin\\win_error.glade", "bin\\tipoftheday.txt", "doc\\README.txt"]))
        files.append(("pixmaps", glob.glob("bin\\pixmaps\\*.*")))
        files.append(("po", glob.glob("bin\\po\\*.*")))
        files.append(("icons", glob.glob("bin\\icons\\*.png")))
        files.append(("share\\locale", glob.glob("bin\\share\\locale\\*.*")))
    else:
        files.append((opj("share", "man", "man1", ""), ["man/openerp-client.1"]))
        files.append(
            (opj("share", "doc", "openerp-client-%s" % version), [f for f in glob.glob("doc/*") if os.path.isfile(f)])
        )
        files.append((opj("share", "pixmaps", "openerp-client"), glob.glob("bin/pixmaps/*.png")))
        files.append((opj("share", "pixmaps", "openerp-client", "icons"), glob.glob("bin/icons/*.png")))
        files.append(
            (opj("share", "openerp-client"), ["bin/openerp.glade", "bin/tipoftheday.txt", "bin/win_error.glade"])
        )
    return files
Esempio n. 2
0
def data_files():
    '''Build list of data files to be installed'''
    files = []
    if sys.platform == 'win32':
        import matplotlib
        datafiles = matplotlib.get_py2exe_datafiles()
        if isinstance(datafiles, list):
            files.extend(datafiles)
        else:
            files.append(datafiles)
        os.chdir('bin')
        for (dp, dn, names) in os.walk('share\\locale'):
            files.append((dp, map(lambda x: opj('bin', dp, x), names)))
        os.chdir('..')
        files.append((".",["bin\\openerp.ui", "bin\\win_error.ui", 'bin\\tipoftheday.txt', 'doc\\README.txt']))
        files.append(("pixmaps", glob.glob("bin\\pixmaps\\*.*")))
        files.append(("po", glob.glob("bin\\po\\*.*")))
        files.append(("icons", glob.glob("bin\\icons\\*.png")))
        files.append(("share\\locale", glob.glob("bin\\share\\locale\\*.*")))

    else:
        files.append((opj('share','man','man1',''),['man/openerp-client.1']))
        files.append((opj('share','doc', 'openerp-client-%s' % version), [f for
            f in glob.glob('doc/*') if os.path.isfile(f)]))
        files.append((opj('share', 'pixmaps', 'openerp-client'),
            glob.glob('bin/pixmaps/*.png')))
        files.append((opj('share', 'pixmaps', 'openerp-client', 'icons'),
            glob.glob('bin/icons/*.png')))
        files.append((opj('share', 'openerp-client'), ['bin/openerp.ui', 'bin/tipoftheday.txt',
                                                       'bin/win_error.ui']))
    return files
Esempio n. 3
0
def get_hotspotter_datafiles():
    'Build the data files used by py2exe and py2app'
    import matplotlib
    data_files = []
    # Include Matplotlib data (for figure images and things)
    data_files.extend(matplotlib.get_py2exe_datafiles())
    # Include TPL Libs
    plat_tpllibdir = join('hotspotter', '_tpl', 'lib', sys.platform)
    if sys.platform == 'win32':
        # Hack to get MinGW dlls in for FLANN
        data_files.append(('', [
            join(plat_tpllibdir, 'libgcc_s_dw2-1.dll'),
            join(plat_tpllibdir, 'libstdc++-6.dll')
        ]))
    if sys.platform == 'darwin':
        pass
    else:
        for root, dlist, flist in os.walk(plat_tpllibdir):
            tpl_dest = root
            tpl_srcs = [realpath(join(root, fname)) for fname in flist]
            data_files.append((tpl_dest, tpl_srcs))
    # Include Splash Screen
    splash_dest = normpath('_frontend')
    splash_srcs = [realpath('_frontend/splash.png')]
    data_files.append((splash_dest, splash_srcs))
    return data_files
Esempio n. 4
0
def data_files():
    '''Build list of data files to be installed'''
    files = []
    if sys.platform == 'win32':
        import matplotlib
        datafiles = matplotlib.get_py2exe_datafiles()
        if isinstance(datafiles, list):
            files.extend(datafiles)
        else:
            files.append(datafiles)
        os.chdir('bin')
        for (dp, dn, names) in os.walk('share\\locale'):
            files.append((dp, map(lambda x: opj('bin', dp, x), names)))
        os.chdir('..')
        files.append((".", [
            "bin\\openerp.glade", "bin\\win_error.glade",
            'bin\\tipoftheday.txt', 'doc\\README.txt'
        ]))
        files.append(("pixmaps", glob.glob("bin\\pixmaps\\*.*")))
        files.append(("po", glob.glob("bin\\po\\*.*")))
        files.append(("icons", glob.glob("bin\\icons\\*.png")))
        files.append(("share\\locale", glob.glob("bin\\share\\locale\\*.*")))
    else:
        files.append((opj('share', 'man', 'man1',
                          ''), ['man/openerp-client.1']))
        files.append((opj('share', 'doc', 'openerp-client-%s' % version),
                      [f for f in glob.glob('doc/*') if os.path.isfile(f)]))
        files.append((opj('share', 'pixmaps',
                          'openerp-client'), glob.glob('bin/pixmaps/*.png')))
        files.append((opj('share', 'pixmaps', 'openerp-client',
                          'icons'), glob.glob('bin/icons/*.png')))
        files.append((opj('share', 'openerp-client'), [
            'bin/openerp.glade', 'bin/tipoftheday.txt', 'bin/win_error.glade'
        ]))
    return files
Esempio n. 5
0
def data_files():
    '''Build list of data files to be installed'''
    files = []
    if os.name == 'nt':
        import matplotlib
        datafiles = matplotlib.get_py2exe_datafiles()
        if isinstance(datafiles, list):
            files.extend(datafiles)
        else:
            files.append(datafiles)
        os.chdir('bin')
        for (dp, dn, names) in os.walk('share\\locale'):
            files.append((dp, map(lambda x: opj('bin', dp, x), names)))
        os.chdir('..')
        files.append((".",["bin\\openerp.glade", 'bin\\dia_survey.glade', "bin\\win_error.glade", 'bin\\tipoftheday.txt', 'doc\\README.txt']))
        files.append(("pixmaps", glob.glob("bin\\pixmaps\\*.*")))
        files.append(("po", glob.glob("bin\\po\\*.*")))
        files.append(("icons", glob.glob("bin\\icons\\*.png")))
        files.append(("share\\locale", glob.glob("bin\\share\\locale\\*.*")))
        mfcdir = 'C:\Python27\Lib\site-packages\pythonwin'
        mfcfiles = [os.path.join(mfcdir, i)
                    for i in ["mfc90.dll", "mfc90u.dll", "mfcm90.dll",
                              "mfcm90u.dll", "Microsoft.VC90.MFC.manifest"]]
        files += [("Microsoft.VC90.MFC", mfcfiles)]
    else:
        files.append((opj('share','man','man1',''),['man/openerp-client.1']))
        files.append((opj('share','doc', 'openerp-client-%s' % version), [f for
            f in glob.glob('doc/*') if os.path.isfile(f)]))
        files.append((opj('share', 'pixmaps', 'openerp-client'),
            glob.glob('bin/pixmaps/*.png')))
        files.append((opj('share', 'pixmaps', 'openerp-client', 'icons'),
            glob.glob('bin/icons/*.png')))
        files.append((opj('share', 'openerp-client'), ['bin/openerp.glade', 'bin/tipoftheday.txt',
                                                       'bin/win_error.glade', 'bin/dia_survey.glade']))
    return files
Esempio n. 6
0
        def run(self):
            #
            # py2exe runs install_data a second time. We want to inject some
            # data files into the dist but we do it here so that if the user
            # does a straight "install", they won't end up dumped into their
            # Python directory.
            #
            # py2exe doesn't have its own data_files or resources options.
            #
            if self.distribution.data_files is None:
                self.distribution.data_files = []
            self.distribution.data_files.append(
                    ("artwork", glob.glob("artwork/*")))
            #
            # javabridge's jars
            #
            import javabridge
            self.distribution.data_files.append(
                    ("javabridge/jars", javabridge.JARS))
            #
            # prokaryote's jar
            #
            import prokaryote
            prokaryote_glob = os.path.dirname(prokaryote.__file__) + "/*.jar"
            self.distribution.data_files.append(
                    ("prokaryote", glob.glob(prokaryote_glob)))
            #
            # py2exe recipe for matplotlib
            #
            self.distribution.data_files += matplotlib.get_py2exe_datafiles()
            #
            # Support for zmq-14.0.0+
            #
            zmq_version = tuple([int(_) for _ in zmq.__version__.split(".")])
            if zmq_version >= (14, 0, 0):
                # Backends are new in 14.x
                self.includes += [
                    "zmq.backend", "zmq.backend.cython", "zmq.backend.cython.*",
                    "zmq.backend.cffi", "zmq.backend.cffi.*"]
                #
                # Must include libzmq.pyd without renaming because it's
                # linked against. The problem is that py2exe renames it
                # to "zmq.libzmq.pyd" and then the linking fails. So we
                # include it as a data file and exclude it as a dll.
                #
                if zmq_version >= (14, 0, 0):
                    self.distribution.data_files.append(
                            (".", [zmq.libzmq.__file__]))
                    self.dll_excludes.append("libzmq.pyd")

            if self.msvcrt_redist is not None:
                sources = [
                    os.path.join(self.msvcrt_redist, filename)
                    for filename in os.listdir(self.msvcrt_redist)]
                self.distribution.data_files.append(
                        ("./Microsoft.VC90.CRT", sources))

            py2exe.build_exe.py2exe.run(self)
Esempio n. 7
0
        def run(self):
            #
            # py2exe runs install_data a second time. We want to inject some
            # data files into the dist but we do it here so that if the user
            # does a straight "install", they won't end up dumped into their
            # Python directory.
            #
            # py2exe doesn't have its own data_files or resources options.
            #
            if self.distribution.data_files is None:
                self.distribution.data_files = []
            self.distribution.data_files.append(
                    ("artwork", glob.glob("artwork/*")))
            #
            # javabridge's jars
            #
            import javabridge
            self.distribution.data_files.append(
                    ("javabridge/jars", javabridge.JARS))
            #
            # prokaryote's jar
            #
            import prokaryote
            prokaryote_glob = os.path.dirname(prokaryote.__file__) + "/*.jar"
            self.distribution.data_files.append(
                    ("prokaryote", glob.glob(prokaryote_glob)))
            #
            # py2exe recipe for matplotlib
            #
            self.distribution.data_files += matplotlib.get_py2exe_datafiles()
            #
            # Support for zmq-14.0.0+
            #
            zmq_version = tuple([int(_) for _ in zmq.__version__.split(".")])
            if zmq_version >= (14, 0, 0):
                # Backends are new in 14.x
                self.includes += [
                    "zmq.backend", "zmq.backend.cython", "zmq.backend.cython.*",
                    "zmq.backend.cffi", "zmq.backend.cffi.*"]
                #
                # Must include libzmq.pyd without renaming because it's
                # linked against. The problem is that py2exe renames it
                # to "zmq.libzmq.pyd" and then the linking fails. So we
                # include it as a data file and exclude it as a dll.
                #
                if zmq_version >= (14, 0, 0):
                    self.distribution.data_files.append(
                            (".", [zmq.libzmq.__file__]))
                    self.dll_excludes.append("libzmq.pyd")

            if self.msvcrt_redist is not None:
                sources = [
                    os.path.join(self.msvcrt_redist, filename)
                    for filename in os.listdir(self.msvcrt_redist)]
                self.distribution.data_files.append(
                        ("./Microsoft.VC90.CRT", sources))

            py2exe.build_exe.py2exe.run(self)
Esempio n. 8
0
def build_datafiles(countries):
    """
    Returns data_files
    """
    tuples_list = []
    data_files = matplotlib.get_py2exe_datafiles()

    for country in countries:

        model = find_data_files('./countries//%s/model' % country,
                                '/countries/%s/model' % country, ['*.py'])
        tuples_list.append(model[0])

        castypes = find_data_files('./countries//%s/castypes/' % country,
                                   '/countries/%s/castypes/' % country,
                                   ['*.ofct'])

        tuples_list.append(castypes[0])

        param = find_data_files('./countries//%s/param/' % country,
                                '/countries/%s/param/' % country,
                                ['param.xml'])
        tuples_list.append(param[0])

        reformes = find_data_files('./countries//%s/reformes/' % country,
                                   '/countries/%s/reformes/' % country,
                                   ['*.ofp'])
        tuples_list.append(reformes[0])
        decomp = find_data_files('./countries//%s/decompositions/' % country,
                                 '/countries/%s/decompositions/' % country,
                                 ['decomp.xml'])
        tuples_list.append(decomp[0])

        if country == 'france':
            calibrations = find_data_files('./countries/france/calibrations/',
                                           './countries/france/calibrations/',
                                           ['*.csv'])
            tuples_list.append(calibrations[0])
            data = find_data_files(
                './countries/france/data/', './countries/france/data/',
                ['*.csv', 'amounts.h5', 'actualisation_groups.h5'])
            tuples_list.append(data[0])
            data_sources = find_data_files('./countries/france/data/sources/',
                                           './countries/france/data/sources/',
                                           ['*.xls'])
            tuples_list.append(data_sources[0])

    for tupl in tuples_list:
        data_files.append(tupl)

    return data_files
Esempio n. 9
0
def build_datafiles(countries):
    """
    Returns data_files
    """
    tuples_list = []
    data_files = matplotlib.get_py2exe_datafiles()

    for country in countries:

        model = find_data_files("./countries//%s/model" % country, "/countries/%s/model" % country, ["*.py"])
        tuples_list.append(model[0])

        castypes = find_data_files(
            "./countries//%s/castypes/" % country, "/countries/%s/castypes/" % country, ["*.ofct"]
        )

        tuples_list.append(castypes[0])

        param = find_data_files("./countries//%s/param/" % country, "/countries/%s/param/" % country, ["param.xml"])
        tuples_list.append(param[0])

        reformes = find_data_files(
            "./countries//%s/reformes/" % country, "/countries/%s/reformes/" % country, ["*.ofp"]
        )
        tuples_list.append(reformes[0])
        decomp = find_data_files(
            "./countries//%s/decompositions/" % country, "/countries/%s/decompositions/" % country, ["decomp.xml"]
        )
        tuples_list.append(decomp[0])

        if country == "france":
            calibrations = find_data_files(
                "./countries/france/calibrations/", "./countries/france/calibrations/", ["*.csv"]
            )
            tuples_list.append(calibrations[0])
            data = find_data_files(
                "./countries/france/data/",
                "./countries/france/data/",
                ["*.csv", "amounts.h5", "actualisation_groups.h5"],
            )
            tuples_list.append(data[0])
            data_sources = find_data_files(
                "./countries/france/data/sources/", "./countries/france/data/sources/", ["*.xls"]
            )
            tuples_list.append(data_sources[0])

    for tupl in tuples_list:
        data_files.append(tupl)

    return data_files
Esempio n. 10
0
def get_data_files(source_dir):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []

    dfiles.extend(matplotlib.get_py2exe_datafiles())

    # qt help files
    dfiles.append(('doc', glob.glob(join("cat", "gui", "helpbrowser",
                                         "*.qhc"))))
    dfiles.append(('doc', glob.glob(join("cat", "gui", "helpbrowser",
                                         "*.qch"))))

    return dfiles
Esempio n. 11
0
def get_data_files(source_dir):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []

    dfiles.extend(matplotlib.get_py2exe_datafiles())

    # qt help files
    dfiles.append(('doc',
                  glob.glob(join("cat", "gui", "helpbrowser", "*.qhc"))))
    dfiles.append(('doc',
                  glob.glob(join("cat", "gui", "helpbrowser", "*.qch"))))

    return dfiles
Esempio n. 12
0
    def is_installed(self, environ, version):
        options.set_debug(self.debug)
        try:
            import matplotlib

            ver = matplotlib.__version__
            if compare_versions(ver, version) == -1:
                return self.found
            self.found = True
        except Exception:
            if self.debug:
                print(sys.exc_info()[1])
            return self.found

        self.environment["MATPLOTLIB_DATA_FILES"] = matplotlib.get_py2exe_datafiles()
        return self.found
Esempio n. 13
0
def get_data_files(target_dir=TARGET_DIR, mpl_data=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    dfiles.append((target_dir, _rsc))
    dfiles.append((join(target_dir, 'rsrc', 'hmm'), _rfiles))
    dfiles.append((_paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))

    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, TARGET_DIR)
                dfiles.append((target, [join(abspath(root), file_)]))
    return dfiles
Esempio n. 14
0
def get_data_files(target_dir=TARGET_DIR, mpl_data=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    dfiles.append((target_dir, _rsc))
    dfiles.append((join(target_dir, 'rsrc', 'hmm'), _rfiles))
    dfiles.append((_paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))

    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, TARGET_DIR)
                dfiles.append((target, [join(abspath(root), file_)]))
    return dfiles
Esempio n. 15
0
def get_data_files():
    """
    py2exe doesn't seem to know about MANIFEST.in, so it has to be done manually.
    """
    start_dir = os.path.dirname(os.path.realpath(__file__))
    datafiles = []

    base_files = []
    for filename in [
            'COPYING', 'COPYING.LESSER', 'README', 'LICENSE.txt', 'setup.nsi',
            'mascot.ini', 'unimod.sqlite'
    ]:
        #filepath = os.path.join(start_dir, filename)
        #assert os.path.exists(filepath), filepath
        #base_files.append(filepath)
        assert os.path.exists(os.path.join(start_dir, filename)), filename
        base_files.append(filename)
    datafiles.append(('', base_files))

    #images = []
    #for filename in ['BlaisLogo.jpg', 'multiplierzlogo.png']:
    #filepath = os.path.join(start_dir, 'images', filename)
    #assert os.path.exists(filepath), filepath
    #images.append(filepath)
    #datafiles.append(('images', images))

    for recursive_dir in ['pyComet', 'xTandem', 'images', 'interface_modules']:
        for path, _, filenames in os.walk(recursive_dir):
            path_files = []
            for filename in filenames:
                if not (filename.lower().endswith('py')
                        or filename.lower().endswith('pyc')):
                    filepath = os.path.join(path, filename)
                    assert os.path.exists(filepath), filepath
                    path_files.append(os.path.relpath(filepath, start_dir))
            datafiles.append((path, path_files))

    # matplotlib returns absolute-path files, but py2exe suddenly
    # demands *relative* paths.
    mplibfiles = matplotlib.get_py2exe_datafiles()
    for site, files in mplibfiles:
        relfiles = [os.path.relpath(f, start_dir) for f in files]
        datafiles.append((site, relfiles))

    return datafiles
Esempio n. 16
0
def get_data_files(target_dir=TARGET_BUNDLE,
                   mpl_data=True, qt_plugins=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    paltarget = join(target_dir, 'palettes', 'zeiss')
    dfiles.append((target_dir, _rsc))
    dfiles.append((paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))
    # schema files
    dfiles.append((join(target_dir, 'schemas'),
                   glob.glob(join(RESOURCE_DIR, 'schemas', "*.xsd"))))
    dfiles.append((join(target_dir, 'ontologies'),
                   glob.glob(join(RESOURCE_DIR, 'ontologies', "*.owl"))))

    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, target_dir)
                dfiles.append((target, [join(abspath(root), file_)]))

    if qt_plugins:
        for dir_ in ['sqldrivers', 'platforms']:
            # Pyqt5 does not start without platform plugins.
            # sorry for not finding a better hack
            qt5plugins = glob.glob(
                join(dirname(PyQt5.__file__), "plugins", dir_, "*.*"))
            qt5plugins = (dir_, qt5plugins)
            dfiles.append(qt5plugins)

    if sys.platform.startswith("win"):
        for f in ("libEGL.dll", ):
            dfiles.append(('.', [join(dirname(PyQt5.__file__), f)]))

    # # qt help files
    dfiles.append((join(target_dir, 'doc'),
                   glob.glob(join(RESOURCE_DIR, 'doc', "*.qhc"))))
    dfiles.append((join(target_dir, 'doc'),
                   glob.glob(join(RESOURCE_DIR, 'doc', "*.qch"))))

    return dfiles
Esempio n. 17
0
def get_data_files(target_dir=TARGET_BUNDLE, mpl_data=True, qt_plugins=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    paltarget = join(target_dir, 'palettes', 'zeiss')
    dfiles.append((target_dir, _rsc))
    dfiles.append((paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))
    # schema files
    dfiles.append(
        (join(target_dir,
              'schemas'), glob.glob(join(RESOURCE_DIR, 'schemas', "*.xsd"))))
    dfiles.append((join(target_dir, 'ontologies'),
                   glob.glob(join(RESOURCE_DIR, 'ontologies', "*.owl"))))

    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, target_dir)
                dfiles.append((target, [join(abspath(root), file_)]))

    if qt_plugins:
        for dir_ in ['sqldrivers', 'platforms']:
            # Pyqt5 does not start without platform plugins.
            # sorry for not finding a better hack
            qt5plugins = glob.glob(
                join(dirname(PyQt5.__file__), "plugins", dir_, "*.*"))
            qt5plugins = (dir_, qt5plugins)
            dfiles.append(qt5plugins)

    if sys.platform.startswith("win"):
        for f in ("libEGL.dll", ):
            dfiles.append(('.', [join(dirname(PyQt5.__file__), f)]))

    # # qt help files
    dfiles.append((join(target_dir,
                        'doc'), glob.glob(join(RESOURCE_DIR, 'doc', "*.qhc"))))
    dfiles.append((join(target_dir,
                        'doc'), glob.glob(join(RESOURCE_DIR, 'doc', "*.qch"))))

    return dfiles
Esempio n. 18
0
def get_data_files(target_dir=TARGET_BUNDLE, mpl_data=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    paltarget = join(target_dir, 'palettes', 'zeiss')
    dfiles.append((target_dir, _rsc))
    dfiles.append((paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))
    # schema files
    dfiles.append((join(target_dir, 'schemas'),
                   glob.glob(join(RESOURCE_DIR, 'schemas', "*.xsd"))))


    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, target_dir)
                dfiles.append((target, [join(abspath(root), file_)]))
    return dfiles
Esempio n. 19
0
def get_data_files(target_dir=TARGET_BUNDLE, mpl_data=True):
    """Pack data files into list of (target-dir, list-of-files)-tuples"""

    dfiles = []
    if mpl_data:
        dfiles.extend(matplotlib.get_py2exe_datafiles())

    paltarget = join(target_dir, 'palettes', 'zeiss')
    dfiles.append((target_dir, _rsc))
    dfiles.append((paltarget, glob.glob(join(abspath(_palettes), '*.zip'))))
    # schema files
    dfiles.append(
        (join(target_dir,
              'schemas'), glob.glob(join(RESOURCE_DIR, 'schemas', "*.xsd"))))

    for root, subdirs, files in os.walk(_battery_package):
        for file_ in files:
            if file_ not in (".git", ):
                target = root.replace(RESOURCE_DIR, target_dir)
                dfiles.append((target, [join(abspath(root), file_)]))
    return dfiles
Esempio n. 20
0
    def is_installed(self, environ, version=None, strict=False):
        options.set_debug(self.debug)
        try:
            import matplotlib
            ver = matplotlib.__version__
            not_ok = (compare_versions(ver, version) == -1)
            if strict:
                not_ok = (compare_versions(ver, version) != 0)
            if not_ok:
                if self.debug:
                    print('Wrong version of ' + self.pkg + ': ' +
                          str(ver) + ' vs ' + str(version))
                return self.found
            self.found = True
        except ImportError:
            if self.debug:
                print(sys.exc_info()[1])
            return self.found

        self.environment['MATPLOTLIB_DATA_FILES'] = \
            matplotlib.get_py2exe_datafiles()
        return self.found
Esempio n. 21
0
def get_hotspotter_datafiles():
    'Build the data files used by py2exe and py2app'
    import matplotlib
    data_files = []
    # Include Matplotlib data (for figure images and things)
    data_files.extend(matplotlib.get_py2exe_datafiles())
    # Include TPL Libs
    plat_tpllibdir = join('hotspotter', '_tpl', 'lib', sys.platform)
    if sys.platform == 'win32':
        # Hack to get MinGW dlls in for FLANN
        data_files.append(('',[join(plat_tpllibdir, 'libgcc_s_dw2-1.dll'),
                               join(plat_tpllibdir,'libstdc++-6.dll')]))
    if sys.platform == 'darwin':
        pass
    else:
        for root,dlist,flist in os.walk(plat_tpllibdir):
            tpl_dest = root
            tpl_srcs = [realpath(join(root,fname)) for fname in flist]
            data_files.append((tpl_dest, tpl_srcs))
    # Include Splash Screen
    splash_dest = normpath('_frontend')
    splash_srcs = [realpath('_frontend/splash.png')]
    data_files.append((splash_dest, splash_srcs))
    return data_files
Esempio n. 22
0
import glob

origIsSystemDLL = py2exe.build_exe.isSystemDLL


def isSystemDLL(pathname):
    if os.path.basename(pathname).lower() in ("msvcp71.dll", "msvcrt.dll"):
        return 0
    return origIsSystemDLL(pathname)


py2exe.build_exe.isSystemDLL = isSystemDLL

setup(console=['main.py', 'configeditor.pyw', '.\\unittests\\test_all.py'],
      data_files=[(r'mpl-data\data',glob.glob(r'C:\Python25\Lib\site-packages\mpl_toolkits\basemap\data\*.*'))] + \
                 matplotlib.get_py2exe_datafiles() + \
                 [(r'test_data',glob.glob(r'.\unittests\test_data\*.*'))] + \
                 [(r'MSLP',glob.glob(r'.\MSLP\*.nc'))] + \
                 [(r'output',[])] + \
                 [(r'input',glob.glob(r'.\input\*.*'))],
      options={'py2exe': { "includes" : ["matplotlib.backends",
                                         "matplotlib.backends.backend_qt4agg",
                                         "matplotlib.figure",
                                         "pylab",
                                         "numpy",
                                         "matplotlib.numerix.fft",
                                         "matplotlib.numerix.linear_algebra",
                                         "matplotlib.numerix.random_array",
                                         "matplotlib.backends.backend_tkagg",
                                         "scipy.io.matlab.streams",
                                         "mpl_toolkits.basemap"]}},
Esempio n. 23
0
if writeNewInit:
    vStr = createInitFile.createInitFile(dist='bdist')
    exec(vStr)#create variables __version__, __author__ etc

#define the extensions to compile if necess
packageData = []
requires=[]

if platform=='win32':
    import py2exe

    #get matplotlib data files
    from distutils.filelist import findall
    import os
    import matplotlib
    packageData.extend(matplotlib.get_py2exe_datafiles())
    #get resources (icons etc)
    files = glob.glob('psychopy/app/Resources/*')
    for file in files:
        loc, name = os.path.split(file)
        packageData.append( ['psychopy/app/Resources', [file]])

elif platform=='darwin':
    import bdist_mpkg, py2app
    resources = glob.glob('psychopy/app/Resources/*')
    resources.append('/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h')
elif platform=='posix':
    pass

if platform == 'win32':
    requires.extend(['pymedia'])
Esempio n. 24
0
            "api-ms-win-core-io-l1-1-1.dll", "api-ms-win-core-com-l1-1-1.dll",
            "api-ms-win-core-memory-l1-1-2.dll",
            "api-ms-win-core-version-l1-1-1.dll",
            "api-ms-win-core-version-l1-1-0.dll"
        ],
        "excludes": ["tkinter", "lib2to3"]
        #		"dist_dir": "bin"
    }
}
#setup(data_files=includefiles, options=opts, console=['Controller.py'])

from distutils.core import setup
import py2exe
import sys, os, site, shutil

includefiles = matplotlib.get_py2exe_datafiles()

site_dir = site.getsitepackages()[1]
include_dll_path = os.path.join(site_dir, "gnome")

gtk_dirs_to_include = [
    'etc', 'lib\\gtk-3.0', 'lib\\girepository-1.0', 'lib\\gio',
    'lib\\gdk-pixbuf-2.0', 'share\\glib-2.0', 'share\\fonts', 'share\\icons',
    'share\\themes\\Default', 'share\\themes\\HighContrast'
]

gtk_dlls = []
tmp_dlls = []
cdir = os.getcwd()
for dll in os.listdir(include_dll_path):
    if dll.lower().endswith('.dll'):
Esempio n. 25
0
# py2exe options

additionalFiles = [("scripts", [
    "scripts/CIU_RESET.cs",
    "scripts/CIU_LIST.cs",
    "scripts/CIU_LINEAR.cs",
    "scripts/CIU_FITTED.cs",
    "scripts/CIU_EXPONENT.cs",
]),
                   ("dlls", [
                       "dlls/CIU_RESET.dll",
                       "dlls/CIU_LIST.dll",
                       "dlls/CIU_LINEAR.dll",
                       "dlls/CIU_FITTED.dll",
                       "dlls/CIU_EXPONENT.dll",
                   ]), ("", matplotlib.get_py2exe_datafiles())]

py2exe_options = dict(
    compressed=True,
    optimize=0,
    bundle_files=3,
    excludes=[
        "Tkconstants", "Tkinter", "tcl", "Qt", "PyQt5.*", "PyQt4", "pywin",
        "pywin.debugger", "pywin.debugger.dbgcon", "pywin.dialogs",
        "pywin.dialogs.list", "scipy.*", "pandas.*", "pdb", "doctest"
    ],
    includes=["matplotlib.backends.backend_qt5agg", "email.mime.*", "jinja2"],
    packages=["wx.lib.pubsub", "pkg_resources"],
    dll_excludes=["Qt5Gui", "Qt5Widgets", "Qt5Svg", "Qt5Gui"],
    dist_dir=dist_dir,
)
Esempio n. 26
0
setup (
	cmdclass = {"py2exe": my_py2exe},
	name="py-acqua",
	version="1.0",
	description="PyAcqua program",
	author="Francesco Piccinno",
	author_email="*****@*****.**",
	url="http://www.pyacqua.net",
    windows = [
        {"script": "src/acqua.py",
        "icon_resources": [(1, "pixmaps/pyacqua.ico")]
        }
    ],
	#console=[
	#    {"script": "src/acqua.py",
    #    "icon_resources": [(1, "pixmaps/pyacqua.ico")]
	#	}
    #],
	packages=[''],
	package_dir={'': 'src'},
	options=opts,
	data_files=moon_walk ("skins", "skins") + moon_walk ("locale", "locale") + [
		#("src", glob.glob ("src/*")),
		#Disabilitiamo i plugins
		#("plugins", glob.glob ("plugins/*.py")),
		("pixmaps", glob.glob ("pixmaps/*")),
		("tips", glob.glob ("tips/*.txt"))
	] + [matplotlib.get_py2exe_datafiles()]
)
Esempio n. 27
0
File: setup.py Progetto: INM-6/swan
dpath = join(p, "doc", "build", "html")

files = []
folders = {}

for name in os.listdir(dpath):
        if isfile(join(dpath, name)):
            files.append(join(dpath, name))
        else:
            folders[name] = []
            for f in os.listdir(join(dpath, name)):
                folders[name].append(join(dpath, name, f))


# set the data files
datafiles = list(mpl.get_py2exe_datafiles()) + [("data", [join(p, "data", "map_lilou.csv")]), 
                                                ("documentation", files)] + [(join("documentation", key), value) for key, value in folders.iteritems()]


setup(
        name="swan",
        version=version,
        description=description_short,
        author=author,

		data_files = datafiles,
		windows = [{"script":join(p, "src", "swan.py")}], 
		options = {"py2exe":{
		"includes":["sip", 
					"scipy.special._ufuncs_cxx",
					"scipy.sparse.csgraph._validation",
Esempio n. 28
0
excludes = [
    '_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger',
    'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl', 'Tkconstants', 'Tkinter',
    'pydoc', 'doctest', 'test', 'sqlite3'
]
packages = ['pytz']
dll_excludes = [
    'libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll'
]
icon_resources = []
bitmap_resources = []
other_resources = []

# add the mpl mpl-data folder and rc file
import matplotlib as mpl
matplot_lib_data_files += mpl.get_py2exe_datafiles()

f2 = ("", [r'./Cold Climate Air-Source Heat Pump Listing.txt'])
matplot_lib_data_files.append(f2)

matplot_lib_data_files.append(
    ("Climate Data", glob.glob(r'.\Climate Data\*.*')))

matplot_lib_data_files.append(
    ("Residential Profiles",
     glob.glob(r'.\Residential Profiles\Default oil deliveries.txt')))

setup(
    windows=[{
        "script": "Heat Pump Analysis.py"
    }],
Esempio n. 29
0
    µSim is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with µSim.  If not, see <http://www.gnu.org/licenses/>.
"""

from distutils.core import setup
from Config import VERSION
import py2exe
import matplotlib
import os

myDataFiles = matplotlib.get_py2exe_datafiles()
myDataFiles.append(("data",["data/param.xml",  "data/code_apl", "data/totaux.xml", "data/calage_men.csv", "data/calage_pfam.csv"]))
for f in os.listdir('castypes'):
    myDataFiles.append(('castypes', ['castypes/' + f]))
for f in os.listdir('reformes'):
    myDataFiles.append(('reformes', ['reformes/' + f]))
for f in os.listdir('calibrations'):
    myDataFiles.append(('calibrations', ['calibrations/' + f]))
setup(windows=[{
                "script" : "openFisca.pyw"
                }], 
      options={"py2exe" : {"includes" : ["sip", "encodings.*", "numpy.*"],
                           "dist_dir": "C:/users/utilisateur/documents/OpenFisca-%s-x64" % VERSION,
                           "bundle_files":3,
                           "dll_excludes": ["MSVCP90.dll"]
                           }}, 
Esempio n. 30
0
from distutils.core import setup
import matplotlib as mpl
import py2exe
import sys

sys.argv.append('py2exe')

opts = {
    'py2exe': {"bundle_files" : 3,
               "includes" : [ "socket", "sysconfig", "matplotlib.backends",  
                            "matplotlib.backends.backend_qt4agg",
                            "pylab", "numpy", 
                            "matplotlib.backends.backend_tkagg"],
                'excludes': ['tcl', 'tcl8.5', 'tk8.5', '_gtkagg', '_tkagg', 
                            '_cairo', '_cocoaagg',
                            '_fltkagg', '_gtk', '_gtkcairo', ],
                'dll_excludes': ['libgdk-win32-2.0-0.dll',
                            'libgobject-2.0-0.dll', 'MSVCP90.dll']
              }
       }

setup(console=[{"script" : "pychart.py"}],data_files=mpl.get_py2exe_datafiles(), 
                            options=opts)
Esempio n. 31
0
from distutils.core import setup
import py2exe
import matplotlib

includes = ['os', 'sys', 'time']
packages = ['requests', 'bs4', 'Tkinter', 'tkMessageBox', 'webbrowser', 'functools', 'matplotlib', 'FileDialog']
# for matplotlib
excludes = ['libgdk_pixbuf-2.0-0.dll', 'libgobject-2.0-0.dll',  'libgdk-win32-2.0-0.dll']

datafiles = [r'C:\Python27\Lib\site-packages\requests\cacert.pem']
datafiles.extend(matplotlib.get_py2exe_datafiles())

setup(
	windows = ['stock_ui.py'],
	#console = ['tk_ui.py'],
	options = {'py2exe': {'packages':packages,
						  'includes':includes,
						  'dll_excludes':excludes}},
	data_files = datafiles
	)
Esempio n. 32
0
        def run(self):
            self.reinitialize_command("build_version", inplace=1)
            self.run_command("build_version")
            #
            # py2exe runs install_data a second time. We want to inject some
            # data files into the dist but we do it here so that if the user
            # does a straight "install", they won't end up dumped into their
            # Python directory.
            #
            # py2exe doesn't have its own data_files or resources options.
            #
            if self.distribution.data_files is None:
                self.distribution.data_files = []
            self.distribution.data_files.append(
                    ("artwork", glob.glob("artwork/*")))
            #
            # javabridge's jars
            #
            import javabridge
            self.distribution.data_files.append(
                    ("javabridge/jars", javabridge.JARS))
            #
            # prokaryote's jar
            #
            import prokaryote
            prokaryote_glob = os.path.dirname(prokaryote.__file__) + "/*.jar"
            self.distribution.data_files.append(
                    ("prokaryote", glob.glob(prokaryote_glob)))
            #
            # py2exe recipe for matplotlib
            #
            self.distribution.data_files += matplotlib.get_py2exe_datafiles()
            #
            # Support for zmq-14.0.0+
            #
            zmq_version = tuple([int(_) for _ in zmq.__version__.split(".")])
            if zmq_version >= (14, 0, 0):
                # Backends are new in 14.x
                self.includes += [
                    "zmq.backend", "zmq.backend.cython", "zmq.backend.cython.*",
                    "zmq.backend.cffi", "zmq.backend.cffi.*"]
                #
                # Must include libzmq.pyd without renaming because it's
                # linked against. The problem is that py2exe renames it
                # to "zmq.libzmq.pyd" and then the linking fails. So we
                # include it as a data file and exclude it as a dll.
                #
                if zmq_version >= (14, 0, 0):
                    self.distribution.data_files.append(
                            (".", [zmq.libzmq.__file__]))
                    self.dll_excludes.append("libzmq.pyd")
            #
            # Add ilastik UI files
            #
            if self.with_ilastik:
                import ilastik
                ilastik_root = os.path.dirname(ilastik.__file__)
                for root, directories, filenames in os.walk(ilastik_root):
                    relpath = root[len(os.path.dirname(ilastik_root)) + 1:]
                    ui_filenames = [
                        os.path.join(root, f) for f in filenames
                        if any([f.lower().endswith(ext)
                                for ext in ".ui", ".png"])]
                    if len(ui_filenames) > 0:
                        self.distribution.data_files.append(
                                (relpath, ui_filenames))

                #
                # Prevent rename of vigranumpycore similarly to libzmq
                #
                import vigra.vigranumpycore
                self.distribution.data_files.append(
                        (".", [vigra.vigranumpycore.__file__]))

            if self.msvcrt_redist is not None:
                sources = [
                    os.path.join(self.msvcrt_redist, filename)
                    for filename in os.listdir(self.msvcrt_redist)]
                self.distribution.data_files.append(
                        ("./Microsoft.VC90.CRT", sources))

            py2exe.build_exe.py2exe.run(self)
Esempio n. 33
0
]

# Autres data_files
if "py2exe" in sys.argv:

    # Ajoute les fichiers de Matplotlib
    import matplotlib as mp
    matplotlib_font_afm = glob.glob(
        os.sep.join([mp.get_data_path(), 'fonts\\afm\\*']))
    matplotlib_font_pdfcorefonts = glob.glob(
        os.sep.join([mp.get_data_path(), 'fonts\\pdfcorefonts\\*']))
    matplotlib_font_ttf = glob.glob(
        os.sep.join([mp.get_data_path(), 'fonts\\ttf\\*']))
    matplotlib_images = glob.glob(
        os.sep.join([mp.get_data_path(), 'images\\*']))
    data_files += mp.get_py2exe_datafiles()

    # Ajoute les fichiers Windows
    data_files.append(('', [
        'noethys/msvcm90.dll',
        'noethys/msvcp90.dll',
        'noethys/msvcr90.dll',
        'noethys/Microsoft.VC90.CRT.manifest',
        'noethys/gdiplus.dll',
    ]))

setup(
    name="Noethys",
    version=VERSION_APPLICATION,
    author="Ivan LUCAS",
    description=
Esempio n. 34
0
        f2 = 'examples', [f1]
        example_files.append(f2)

data_files = []
for f in os.listdir("./stamp/data"):
    f1 = "./stamp/data/" + f
    if os.path.isfile(f1):  # skip directories
        f2 = "library/stamp/data", [f1]
        data_files.append(f2)

root_files = [
    'LICENSE.txt', './windows/STAMP.exe.log', './windows/readme.txt',
    'msvcp90.dll', './manual/STAMP_Users_Guide.pdf'
]

mpl_data_files = mpl.get_py2exe_datafiles()

# setup configuration
setup(
    name="STAMP",
    version="2.1.1",
    description="Statistical analysis of taxonomic and functional profiles",
    author="Donovan Parks",
    windows=[{
        "script": "STAMP.py",
        "icon_resources": [(1, "./stamp/icons/stamp.ico")]
    }],
    options={
        "py2exe": {
            "unbuffered":
            True,
Esempio n. 35
0
File: setup.py Progetto: bkocis/pie
from distutils.core import setup
from distutils.filelist import findall
import os
import matplotlib
import py2exe

setup(console=['main_zu_window.py'],data_files=matplotlib.get_py2exe_datafiles())
Esempio n. 36
0
EXCLUDES = [
    'gevent._socket3', '_tkagg', '_ps', '_fltkagg', 'Tkinter', 'Tkconstants',
    '_cairo', '_gtk', 'gtkcairo', 'pydoc', 'sqlite3', 'bsddb', 'curses', 'tcl',
    '_wxagg', '_gtagg', '_cocoaagg', '_wx'
]

# current version of Artisan

import artisanlib

VERSION = artisanlib.__version__
LICENSE = 'GNU General Public License (GPL)'

cwd = os.getcwd()

DATAFILES = mpl.get_py2exe_datafiles()
DATAFILES = DATAFILES + \
    [('plugins\imageformats', [
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qsvg4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qgif4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qtiff4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qjpeg4.dll',
            ]),
      ('plugins\iconengines', [
            'c:\Python27\Lib\site-packages\PyQt4\plugins\iconengines\qsvgicon4.dll',
            ]),
    ]

setup(
    name="Artisan",
    version=VERSION,
Esempio n. 37
0
		f1 = 'examples/' + f
		if os.path.isfile(f1): # skip directories
			f2 = 'examples', [f1]
			example_files.append(f2)

data_files = []
for f in os.listdir("./stamp/data"):
		f1 = "./stamp/data/" + f
		if os.path.isfile(f1): # skip directories
			f2 = "library/stamp/data", [f1]
			data_files.append(f2)
				
root_files = ['LICENSE.txt', './windows/STAMP.exe.log', './windows/readme.txt', 'msvcp90.dll', './manual/STAMP_Users_Guide.pdf']

				
mpl_data_files = mpl.get_py2exe_datafiles()

# setup configuration
setup(
	name = "STAMP",
	version = "2.1.1",
	description = "Statistical analysis of taxonomic and functional profiles",
	author = "Donovan Parks",
	windows=[{"script":"STAMP.py", "icon_resources": [(1, "./stamp/icons/stamp.ico")]}],
	options = 
			{
				"py2exe":
				{
					"unbuffered": True,
					"optimize": 2,
					"skip_archive": True,
Esempio n. 38
0
    # accessed within the zip file, so it also needs to be copied.
    for path_i, module_i in ((ph.path(notebook.__path__[0]), ('templates', )),
                             (ph.path(notebook.__path__[0]), ('static', )),
                             (ph.path(nbformat.__path__[0]), tuple())):
        data_path = path_i.joinpath(*module_i)

        # Copy the template files to the collection dir. Also add the copied
        # file to the list of compiled files so it will be included in the
        # zipfile.
        files = sorted([file_j for file_j in data_path.walkfiles()])
        for parent_i, files_i in it.groupby(files, lambda x: x.parent):
            data_files_ += [(path_i.parent.relpathto(parent_i), list(files_i))]
    return data_files_


setup(
    console=['jupyter-notebook.py', 'ipython.py'],
    cmdclass={"py2exe": JsonSchemaCollector},
    # See http://www.py2exe.org/index.cgi/ListOfOptions
    options={
        'py2exe': {
            'excludes': ['jinja2.asyncsupport'],
            'includes': [
                'matplotlib', 'numpy', 'pandas', 'cycler', 'IPython', 'zmq',
                'zmq.utils', 'zmq.utils.jsonapi', 'zmq.utils.strtypes'
            ]
        }
    },
    # See http://www.py2exe.org/index.cgi/MatPlotLib
    data_files=matplotlib.get_py2exe_datafiles() + data_files())
Esempio n. 39
0
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)

from glob import glob

# Inculsion des fichiers de donn�es
#################################################################################################
# Fichiers MSVC
data_files = [("Microsoft.VC90.CRT", glob(r'msvcr90.dll')), 
              ("Microsoft.VC90.CRT", glob(r'Microsoft.VC90.CRT.manifest'))]

# Traductions
#data_files.extend([(os.path.join("locale", "en", "LC_MESSAGES"), glob(r'pysylic.mo'))])

# Fichiers Matplotlib
data_files.extend(matplotlib.get_py2exe_datafiles())

options = {    "py2exe" : { "compressed": 2,
                           
                            "optimize": 2,
                            
                            "bundle_files": 3,
                            
                            'packages' : ['pytz', 'win32api'],
                            
                            'excludes' : ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger',
                                          'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
                                          'Tkconstants', 'Tkinter', 'pydoc', 'doctest', 'test', 'sqlite3',
                                          "PyQt4", "PyQt4.QtGui","PyQt4._qt",
                                          "matplotlib.backends.backend_qt4agg", "matplotlib.backends.backend_qt4", "matplotlib.backends.backend_tkagg",
                                          "matplotlib.numerix",
Esempio n. 40
0
distributionDirectory = r'C:\Users\Sarith\Dekstop\stadicVis'

mainDirTuple = [("Anaconda installation", 'directory', dirAnaconda),
                ('STADIC python repository', 'directory', stadicViewerPath),
                ('Distribution (exe files)', 'directory',
                 distributionDirectory)]
#Check if paths exist.
pathCheck(mainDirTuple)

#lambda function for joining paths.
dataFile = lambda x: os.path.join(os.path.join(dirAnaconda, r'Library\bin'), x)

# Removed from Excludes: 'libgdk-win32-2.0-0.dll'
sys.path.append(stadicViewerPath)

dataFilesList = matplotlib.get_py2exe_datafiles()  #Add matplotlib files.

dataFilesList += [(".", [
    dataFile("mkl_avx.dll"),
    dataFile("mkl_p4.dll"),
    dataFile("libiomp5md.dll"),
    dataFile("mkl_core.dll")
])]

# "dll_excludes": ["MSVCP90.dll",'libgdk-win32-2.0-0.dll','mkl_avx.dll','mkl_p4.dll'],
#PyQt4.QtNetwork was added in this case because the program uses a web viewer.
setup(windows=[{
    "script": os.path.join(stadicViewerPath, 'stadicVis.py')
}],
      options={
          "py2exe": {
Esempio n. 41
0
import sys
from distutils.core import setup
import py2exe
from distutils.core import setup
import py2exe
import matplotlib

MyData_Files = ["config.cfg", "TABOB.TXT"]


setup(
    windows=[{"script": "at.py", "icon_resources": [(1, "star.ico")]}],
    options={"py2exe": {"includes": ["matplotlib.backends.backend_tkagg"], "excludes": ["_gtkagg"]}},
    data_files=MyData_Files + matplotlib.get_py2exe_datafiles(),
)
Esempio n. 42
0
def main(argv = []):
    purgeDir('build')
    purgeDir('dist')
    setup(
        name = 'Py3GUI',
        author = 'Collin Stocks',
        windows = [{'script': 'py3gui.py'}],
        #zipfile = None,
        options = {
            'py2exe':{
                'includes': [
                    'numpy', 'scipy', 'cvxopt', 'cvxopt.lapack', 'matplotlib',
                    'matplotlib.pyplot', 'matplotlib.figure',
                    'matplotlib.backends.backend_tkagg', 'pylab',
                ],
                'excludes': [
                    'IPython', 'OpenGL', 'pygame', 'VisionEgg', 'Image',
                    'doctest', 'pdb', 'win32com', '_ssl',
                    '_gtkagg', '_agg2', '_cairo', '_cocoaagg', '_gtk',
                    '_gtkcairo', '_qt4agg',
                ],
                'dll_excludes': [
                    'msvcm90.dll', 'msvcr90.dll', 'msvcp90.dll',
                ],
                'optimize': 1,
                'compressed': 2,
                #'ascii': True, # May be causing FixTk.pyo error
                    # LookupError: unknown encoding: mbcs
            }
        },
        data_files = matplotlib.get_py2exe_datafiles(),
    )
    copy('logo.gif')
    winsxsdir = os.path.join(os.path.expandvars('${SystemRoot}'), 'WinSxS')
    msvc90dir = os.path.join(
        winsxsdir,
        [dirname for dirname in
            os.listdir(
                os.path.expandvars(
                    os.path.join('${SystemRoot}', 'WinSxS')
                )
            ) if 'Microsoft.VC90.CRT' in dirname
         ][0]
    )
    copy(os.path.join(msvc90dir, 'msvcm90.dll'), 'Microsoft.VC90.CRT')
    copy(os.path.join(msvc90dir, 'msvcr90.dll'), 'Microsoft.VC90.CRT')
    copy(os.path.join(msvc90dir, 'msvcp90.dll'), 'Microsoft.VC90.CRT')
    manifestsdir = os.path.join(winsxsdir, 'Manifests')
    manifest = os.path.join(
        manifestsdir,
        [fname for fname in
            os.listdir(
                manifestsdir
            ) if 'Microsoft.VC90.CRT' in fname and fname.endswith('.manifest')
        ][0]
    )
    copy(manifest, 'Microsoft.VC90.CRT',
        newname = 'Microsoft.VC90.CRT.manifest')
    from numpy.fft import fftpack_lite
    copy(fftpack_lite.__file__)
    from scipy.integrate import _quadpack
    copy(_quadpack.__file__)
    from scipy.optimize import minpack2
    copy(minpack2.__file__)
    from cvxopt import lapack
    copy(lapack.__file__)
    purgeDir('dist/tcl/tk8.4/demos')
    purgeDir('dist/tcl/tk8.4/images')
    purgeDir('dist/tcl/tcl8.4/dde1.1')
    purgeDir('dist/tcl/tcl8.4/encoding')
    purgeDir('dist/tcl/tcl8.4/http1.0')
    purgeDir('dist/tcl/tcl8.4/http2.3')
    purgeDir('dist/tcl/tcl8.4/http2.5')
    purgeDir('dist/tcl/tcl8.4/msgcat1.0')
    purgeDir('dist/tcl/tcl8.4/msgcat1.3')
    purgeDir('dist/tcl/tcl8.4/opt0.4')
    purgeDir('dist/tcl/tcl8.4/tcltest1.0')
    purgeDir('dist/tcl/tcl8.4/tcltest2.2')
    purgeDir('build')
Esempio n. 43
0
from distutils.core import setup
import py2exe
#import glob

import numpy
import matplotlib
#matplotlib.use('wxagg') # overrule configuration
import random

py2exe_options = {
    "py2exe": {
        "includes": ["matplotlib.backends.backend_tkagg"],
        "dll_excludes": ['MSVCP90.dll'],
        #'excludes': ['_gtkagg', '_tkagg'],
    }
}

setup(data_files=matplotlib.get_py2exe_datafiles(),
      options=py2exe_options,
      console=['test.py'])
Esempio n. 44
0
#setup script for py2exe
#run at command line:  python setup.py py2exe

from distutils.core import setup
import py2exe
import matplotlib
import os

filesList = matplotlib.get_py2exe_datafiles()
filesList.append(('', ['EJico.ico']))
filesList.append(('', ['tutorial.pdf']))
filesList.append(('', ['cFunctions.so']))
filesList.append(('', ['license.txt']))
filesList.append(('', ['EJico.ico']))
filesList.append(('src', ['cFunctions.c']))
filesList.append(('src', ['complex.h']))
filesList.append(('src', ['erwinjr.pyw']))
filesList.append(('src', ['MaterialConstants.py']))
filesList.append(('src', ['settings.py']))
filesList.append(('src', ['readme.txt']))
filesList.append(('src', ['create_exe.py']))
filesList.append(('src', ['SupportClasses.py']))
filesList.append(('src', ['ThePhysics.py']))
filesList.append(('src', ['setup_script.iss']))
dirPaths = ['images', 'examples']
for dirPath in dirPaths:
    for files in os.listdir(dirPath):
        f1 = dirPath + '/' + files
        if os.path.isfile(f1): # skip directories
            f2 = dirPath, [f1]
            filesList.append(f2)
Esempio n. 45
0
        os.path.join(redist, x)
        for x in ("Microsoft.VC90.CRT.manifest", "msvcr90.dll", "msvcm90.dll",
                  "msvcp90.dll")
    ])]
else:
    opts['py2exe']['dll_excludes'] += [
        "msvcr90.dll", "msvcm90.dll", "msvcp90.dll"
    ]

data_files += [('artwork', [
    'artwork\\%s' % (x) for x in os.listdir('artwork')
    if x.endswith(".png") or x.endswith(".psd") or x.endswith(".txt")
]),
               ('imagej\\jars',
                ['imagej\\jars\\%s' % x for x in os.listdir('imagej\\jars')])]
data_files += matplotlib.get_py2exe_datafiles()
################################
#
# Collect the JVM
#
################################

from javabridge.locate import find_jdk
jdk_dir = find_jdk()
temp_dir = tempfile.mkdtemp()
rofiles = []


def add_jre_files(path):
    files = []
    directories = []
Esempio n. 46
0
import matplotlib
import py2exe

##opts = {
##     'py2exe': { "includes" : ["sip", "matplotlib.backends",  "matplotlib.backends.backend_qt4agg",
##                                "matplotlib.figure","pylab", "numpy", "matplotlib.numerix.fft",
##                                "matplotlib.numerix.linear_algebra", "matplotlib.numerix.random_array",
##                                "matplotlib.backends.backend_tkagg"],
##                 'excludes': ['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
##                              '_fltkagg', '_gtk', '_gtkcairo', ],
##                'dll_excludes': ['libgdk-win32-2.0-0.dll',
##                                  'libgobject-2.0-0.dll']
##               }
##        }

setup(console=['Bluesky.py'], data_files=matplotlib.get_py2exe_datafiles())

##
##
##      \
##      options={ \
##          r'py2exe': {\
##            r'includes': r'ElementConfig',
##            r'includes': r'ColorConv',
##            r'includes': r'Tkinter',
##            r'includes': r're',
##            r'includes': r'math',
##            r'includes': r'sys',
##            r'includes': r'matplotlib',
##            r'includes': r'mpl_toolkits',
##            r'includes': r'matplotlib.backends.backend_wx')
                "_gtkagg",
                "_tkagg",
                "nose",
                "wx.tools",
                "pylab",
                "scipy.weave",
                "Tkconstants",
                "Tkinter",
                "tcl",
                "Cython",
                "imagej",
                "h5py",
                "vigra",
                "PyQt4",
                "zmq",
            ],
            "dll_excludes": [
                "libgdk-win32-2.0-0.dll",
                "libgobject-2.0-0.dll",
                "libgdk_pixbuf-2.0-0.dll",
                "tcl84.dll",
                "tk84.dll",
                "jvm.dll",
                "MSVCP90.dll",
            ],
        }
    },
    data_files=(matplotlib.get_py2exe_datafiles() + [("icons", glob.glob("icons\\*.png"))]),
    cmdclass={"msi": CellProfilerAnalystMSI},
)
Esempio n. 48
0
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = "1.0.0.0"
        self.company_name = "SFR"
        self.copyright = "Copyright (c) 2017 KAID Belkacem."
        self.name = "SFR_Perf_DataAnalyser"

target = Target(
    description = "Analyseur de remontees SFR Perf",
    script = "D:\Users\u156726\PycharmProjects\SFR_APP\SFR_APP.py", #---->LE CHEMIN VERS LE CODE SOURCE EST A MODIFIER
    icon_resources = [(1, "myicon.ico")],
    dest_base = "SFR_Perf_DataAnalyser")


data_files=[('.', glob.glob(sys.prefix+'/DLLs/tix81*.dll')),
            ('.', matplotlib.get_py2exe_datafiles()),
            ('.', 'D:\Users\u156726\AppData\Local\Continuum\Anaconda2\Lib\lib-tk'),
             ('tcl/tix8.1', files(sys.prefix+'/tcl/tix8.1')),
            ('tcl/tix8.1/bitmaps', files(sys.prefix+'/tcl/tix8.1/bitmaps')),
             ('tcl/tix8.1/pref', files(sys.prefix+'/tcl/tix8.1/pref')),
           ]

setup(
    options = {"py2exe": {"compressed": 0,
                          "optimize": 0,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dll_excludes": dll_excludes,
                          "dist_dir": ".",
                          "xref": False,
Esempio n. 49
0
from setuptools import setup

from distutils.core import setup
import py2exe
import matplotlib
import glob

img = ("images", glob.glob("images/*.*"))
DATA_FILES = matplotlib.get_py2exe_datafiles()
DATA_FILES = DATA_FILES.append(img)


setup(
	data_files=DATA_FILES,
	options={
		'py2exe': {
			'packages' : ['matplotlib', 'pytz'],
			"dll_excludes": [
				"iconv.dll","intl.dll","libatk-1.0-0.dll",
				"libgdk_pixbuf-2.0-0.dll","libgdk-win32-2.0-0.dll",
				"libglib-2.0-0.dll","libgmodule-2.0-0.dll",
				"libgobject-2.0-0.dll","libgthread-2.0-0.dll",
				"libgtk-win32-2.0-0.dll","libpango-1.0-0.dll",
				"libpangowin32-1.0-0.dll"],
				"dist_dir" : 'dist_win',
			}
		
	},
	name = "SalesGraph",
    description = "Software Sales Plotting Tool",
    version = "1.0",
Esempio n. 50
0
            '_wxagg',
            '_gtagg',
            '_cocoaagg',
            '_wx']


# current version of Artisan

import artisanlib

VERSION = artisanlib.__version__
LICENSE = 'GNU General Public License (GPL)'

cwd = os.getcwd()

DATAFILES = mpl.get_py2exe_datafiles()
DATAFILES = DATAFILES + \
    [('plugins\imageformats', [
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qsvg4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qgif4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qtiff4.dll',
            'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qjpeg4.dll',
            ]),
      ('plugins\iconengines', [
            'c:\Python27\Lib\site-packages\PyQt4\plugins\iconengines\qsvgicon4.dll',
            ]),
    ]

setup(
    name ="Artisan",
    version=VERSION,
Esempio n. 51
0
    os.path.join(parentDir, 'ui Files/portfolioManager.ui'),
    os.path.join(parentDir, 'ui Files\\benchmark.ui'),
    os.path.join(parentDir, 'ui Files\\importPortfolio.ui'),
    os.path.join(parentDir, 'ui Files\\trades.ui'),
    os.path.join(parentDir, 'ui Files\\Depo.ui'),
    os.path.join(parentDir, 'ui Files\\FX.ui'),
    os.path.join(parentDir, 'ui Files\\FXForward.ui'),
    os.path.join(parentDir, 'ui Files\\price.ui')
])]

imageFiles = [('images', [
    os.path.join(parentDir, 'images\\mind_blown.png'),
    os.path.join(parentDir, 'images\\thumbs_up.jpg'),
    os.path.join(parentDir, 'images\\error.png'),
    os.path.join(parentDir, 'images\\splash_screen.png')
])]

setup(options={
    "py2exe": {
        "includes": [
            "zmq.backend.cython", "matplotlibwidget", "sip", "pandas",
            "tia.bbg", "matplotlib", "pylab",
            "matplotlib.backends.backend_qt4agg"
        ],
        "excludes": ["zmq.libzmq"],
        "dll_excludes":
        ["MSVCP90.dll", "HID.DLL", "w9xpopen.exe", "libzmq.pyd"]
    }
},
      data_files=matplotlib.get_py2exe_datafiles() + uiFiles + imageFiles,
      console=['portfolioManager.py'])
Esempio n. 52
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#
################
#!/usr/bin/python

##################
# setup.py
#
# Copyright David Baddeley, 2009
# [email protected]
#
# This file may NOT be distributed without express permision from David Baddeley
#
##################

from distutils.core import setup
try:
	import py2exe

	import matplotlib

	setup(console=['taskWorkerME.py'], data_files=matplotlib.get_py2exe_datafiles())
except:
	pass
Esempio n. 53
0
            # Fichiers à importer :
            ('', ['noethys/Versions.txt', 'noethys/Licence.txt', 'noethys/Icone.ico']),

            ]


# Autres data_files
if "py2exe" in sys.argv :

    # Ajoute les fichiers de Matplotlib
    import matplotlib as mp
    matplotlib_font_afm = glob.glob(os.sep.join([mp.get_data_path(), 'fonts\\afm\\*']))
    matplotlib_font_pdfcorefonts = glob.glob(os.sep.join([mp.get_data_path(), 'fonts\\pdfcorefonts\\*']))
    matplotlib_font_ttf = glob.glob(os.sep.join([mp.get_data_path(), 'fonts\\ttf\\*']))
    matplotlib_images = glob.glob(os.sep.join([mp.get_data_path(), 'images\\*']))
    data_files += mp.get_py2exe_datafiles()

    # Ajoute les fichiers Windows
    data_files.append(('', ['noethys/msvcm90.dll', 'noethys/msvcp90.dll', 'noethys/msvcr90.dll', 'noethys/Microsoft.VC90.CRT.manifest', 'noethys/gdiplus.dll', ]))


setup(
    name = "Noethys",
    version = VERSION_APPLICATION,
    author = "Ivan LUCAS",
    description = u"Noethys, le logiciel libre et gratuit de gestion multi-activités",
    long_description = open("README.md").read().decode("iso-8859-15"),
    url = "http://www.noethys.com",
    license = "GPL V3",
    plateformes = "ALL",
    classifiers = [ "Topic :: Office/Business",
Esempio n. 54
0
# -*- coding: utf-8 -*-

from distutils.core import setup
import py2exe
import matplotlib

setup(console=['Vent.py'], data_files=matplotlib.get_py2exe_datafiles())
Esempio n. 55
0
    author="Edwin Dalmaijer",
    author_email="*****@*****.**",
    url="http://www.pygaze.org/cancellation",
    windows=[{'script':'CancellationTools', 'icon_resources':[(0,os.path.join(resdir,'cancellationtools.ico'))]}],
    options={
          'py2exe': {
                    "compressed":True,
                    "optimize":2,
                    "bundle_files":3,
                    "excludes":copy_packages,
                    "includes":std_pkg + include_packages + zmqfiles,
                    "dll_excludes" : exclude_dll,
                    "packages":['matplotlib', 'pytz']
                    }
         },
    data_files=matplotlib.get_py2exe_datafiles()
    )

# COPY PACKAGES
# PyGame
print("copying PyGame/SDLL dll's...")
shutil.copyfile(r"%s\Lib\site-packages\pygame\SDL_ttf.dll" % python_folder, r"dist\SDL_ttf.dll")
shutil.copyfile(r"%s\Lib\site-packages\pygame\libfreetype-6.dll" % python_folder, r"dist\libfreetype-6.dll")
shutil.copyfile(r"%s\Lib\site-packages\pygame\libogg-0.dll" % python_folder, r"dist\libogg-0.dll")
# PIL (for Matplotlib)
print("copying PIL.pth...")
shutil.copyfile(r"%s\Lib\site-packages\PIL.pth" % python_folder, r"dist\PIL.pth")

# CREATE DATA DIRECTORY
print("creating new (empty) data directory...")
datadir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dist', 'data')
Esempio n. 56
0
						},
						{
							'CFBundleTypeExtensions' : ['lpp', 'sps', 'plb', 'lat'],
							'CFBundleTypeName': 'Lattice Population P System model file',
							'CFBundleTypeRole': 'Viewer',
							'CFBundleTypeIconFile': 'lattice_population_p_system_model_file.icns',
						},
					],

				),
			),
		),
		data_files=[
#			("images", glob.glob("images/*.png")), #TODO
#			("enthought/pyface/images", glob.glob("/Library/Frameworks/.framework/Versions/Current/lib/python26/site-packages/enthought/pyface/images/*.png")), #FIXME
		] + matplotlib.get_py2exe_datafiles(), # http://www.py2exe.org/index.cgi/MatPlotLib
	 )
elif sys.platform.startswith('win'):
	import matplotlib
	# http://markmail.org/thread/qkdwu7gbwrmop6so
	try:
		import py2exe
		# ModuleFinder can't handle runtime changes to __path__, but win32com uses them
#		import sys
		import pywintypes
		import pythoncom
		import win32api
		# if this doesn't work, try import modulefinder
		import py2exe.mf as modulefinder
		import win32com
		for p in win32com.__path__[1:]:
Esempio n. 57
0
# someone solved this like this:
# pip install psychopy==1.85.3
# pip install pyglet==1.3.0
# this removes the error, but the experiment still doesn't work

#Initialize Holder Files
preference_files = []
app_files = []
builder_files = []
lib23_files = []
pandas_libs_files = []
visual_files = []
misc_files = []

some_dlls = []
my_data_files = matplotlib.get_py2exe_datafiles()

#define which files you want to copy for data_files
for files in os.listdir(
        'C:\\Python27\\Lib\\site-packages\\psychopy\\preferences\\'):
    f1 = 'C:\\Python27\\Lib\\site-packages\\psychopy\\preferences\\' + files
    preference_files.append(f1)

app_files = [
    os.path.join(dp, f) for dp, dn, filenames in os.walk(
        'C:\\Python27\\Lib\\site-packages\\psychopy\\app\\') for f in filenames
]

lib23_files = [
    os.path.join(dp, f)
    for dp, dn, filenames in os.walk('C:\\Python27\\Lib\\lib2to3\\')
Esempio n. 58
0
# main:

pkginfo = read_pkginfo_file(__file__)

if sys.platform == 'win32':
    import py2exe  # pylint: disable-msg=F0401,W0611
    FILENAME_ZIP = 'data.zip'
    OPTIONS = {'windows': [{'script': MAIN_SCRIPT,
                            'icon_resources': \
                               [(1, 'cellh5_icon.ico')],
                           }],
               # FIXME: the one-file version is currently not working!
               'zipfile' : FILENAME_ZIP,
               }
    SYSTEM = 'py2exe'
    DATA_FILES = matplotlib.get_py2exe_datafiles()
    EXTRA_OPTIONS = {
        'includes': INCLUDES,
        'excludes': EXCLUDES,
        'packages': PACKAGES,
        'optimize': 2,
        'compressed': False,
        'skip_archive': True,
        'bundle_files': 3,

        #'ascii': True,
        #'xref': True,
    }

setup(data_files=DATA_FILES,
      options={SYSTEM: EXTRA_OPTIONS},