def BuildPy2Exe(): """Generate the Py2exe files""" from distutils.core import setup try: import py2exe except ImportError: print "\n!! You dont have py2exe installed. !!\n" exit() # put package on path for py2exe sys.path.append(os.path.abspath("src/")) sys.path.append(os.path.abspath("src/extern")) DATA_FILES = GenerateBinPackageFiles() try: import enchant except ImportError: pass else: from enchant import utils as enutil DATA_FILES += enutil.win32_data_files() setup( name=NAME, version=VERSION, options={ "py2exe": { "compressed": 1, "optimize": 1, "bundle_files": 2, "includes": INCLUDES, "excludes": ["Tkinter", "Tkconstants", "tcl"], "dll_excludes": ["MSVCP90.dll", "tk85.dll", "tcl85.dll"], } }, windows=[ { "script": "src/Editra.py", "icon_resources": [(1, ICON["Win"])], "other_resources": [(RT_MANIFEST, 1, MANIFEST_TEMPLATE % dict(prog=NAME))], } ], description=NAME, author=AUTHOR, author_email=AUTHOR_EMAIL, maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL, license=LICENSE, url=URL, data_files=DATA_FILES, ) shutil.copy2(".\\editra-installer.nsi", ".\\dist\\editra-installer.nsi")
def BuildPy2Exe(): """Generate the Py2exe files""" from distutils.core import setup try: import py2exe except ImportError: print "\n!! You dont have py2exe installed. !!\n" exit() # put package on path for py2exe sys.path.append(os.path.abspath('src/')) sys.path.append(os.path.abspath('src/extern')) DATA_FILES = GenerateBinPackageFiles() try: import enchant except ImportError: pass else: from enchant import utils as enutil DATA_FILES += enutil.win32_data_files() setup( name=NAME, version=VERSION, options={ "py2exe": { "compressed": 1, "optimize": 1, "bundle_files": 2, "includes": INCLUDES, "excludes": [ "Tkinter", ], "dll_excludes": ["MSVCP90.dll"] } }, windows=[{ "script": "src/Editra.py", "icon_resources": [(1, ICON['Win'])], "other_resources": [(RT_MANIFEST, 1, MANIFEST_TEMPLATE % dict(prog=NAME))], }], description=NAME, author=AUTHOR, author_email=AUTHOR_EMAIL, maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL, license=LICENSE, url=URL, data_files=DATA_FILES, )
import os import enchant def _win32_data_files(): # This is basically a copy of enchant.utils.win32_data_files as of # release 1.6.0. We use this as a fallback for older versions of # enchant which do not have this function. # enchant is licenced under LGPL. dataDirs = ("share/enchant/myspell","share/enchant/ispell","lib/enchant") mainDir = os.path.abspath(os.path.dirname(enchant.__file__)) dataFiles = [] for dataDir in dataDirs: files = [] fullDir = os.path.join(mainDir,os.path.normpath(dataDir)) for fn in os.listdir(fullDir): fullFn = os.path.join(fullDir,fn) if os.path.isfile(fullFn): files.append(fullFn) dataFiles.append((dataDir,files)) return dataFiles try: from enchant.utils import win32_data_files except: # fall back to the function above win32_data_files = _win32_data_files print win32_data_files()
import os import enchant def _win32_data_files(): # This is basically a copy of enchant.utils.win32_data_files as of # release 1.6.0. We use this as a fallback for older versions of # enchant which do not have this function. # enchant is licenced under LGPL. dataDirs = ("share/enchant/myspell","share/enchant/ispell","lib/enchant") mainDir = os.path.abspath(os.path.dirname(enchant.__file__)) dataFiles = [] for dataDir in dataDirs: files = [] fullDir = os.path.join(mainDir,os.path.normpath(dataDir)) for fn in os.listdir(fullDir): fullFn = os.path.join(fullDir,fn) if os.path.isfile(fullFn): files.append(fullFn) dataFiles.append((dataDir,files)) return dataFiles try: from enchant.utils import win32_data_files except: # fall back to the function above win32_data_files = _win32_data_files print(win32_data_files())
# # A simple example of how to use pyenchant with py2exe. # This script is also used in unittests to test py2exe integration. # from distutils.core import setup import py2exe from enchant.utils import win32_data_files setup( name="PyEnchant py2exe demo", version="0.0.1", # Include the necessary supporting data files data_files=win32_data_files(), # Make a "test_pyenchant.exe" that runs the unittest suite console=[dict(script="enchant\\__init__.py", dest_base="test_pyenchant")], )
# # A simple example of how to use pyenchant with py2exe. # This script is also used in unittests to test py2exe integration. # from distutils.core import setup import py2exe from enchant.utils import win32_data_files setup( name="PyEnchant py2exe demo", version="0.0.1", # Include the necessary supporting data files data_files = win32_data_files(), # Make a "test_pyenchant.exe" that runs the unittest suite console=[dict(script="enchant\\__init__.py",dest_base="test_pyenchant")], )
import os import enchant def _win32_data_files(): # This is basically a copy of enchant.utils.win32_data_files as of # release 1.6.0. We use this as a fallback for older versions of # enchant which do not have this function. # enchant is licenced under LGPL. dataDirs = ("share/enchant/myspell", "share/enchant/ispell", "lib/enchant") mainDir = os.path.abspath(os.path.dirname(enchant.__file__)) dataFiles = [] for dataDir in dataDirs: files = [] fullDir = os.path.join(mainDir, os.path.normpath(dataDir)) for fn in os.listdir(fullDir): fullFn = os.path.join(fullDir, fn) if os.path.isfile(fullFn): files.append(fullFn) dataFiles.append((dataDir, files)) return dataFiles try: from enchant.utils import win32_data_files except: # fall back to the function above win32_data_files = _win32_data_files print(win32_data_files())