From 93940c99e772c6db768468c7b2e00cb350fbc775 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Wed, 4 Jun 2014 15:29:44 +0200 Subject: [PATCH] if/else together, newest version setup.py --- setup.py | 2 +- sourceloader.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 4e56ac5..c098163 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from cx_Freeze import setup, Executable # library.zip, also the FourmiCrawler map has to be copied to both the library and the exe.win32-2.7 folder. after # putting the files in the library the library has to be zipped and replace the old library. # Dependencies are automatically detected, but it might need fine tuning. -build_exe_options = {"packages": ["os", "scrapy", "lxml", "w3lib", "pkg_resources", "zope.interface"], "excludes": []} +build_exe_options = {"packages": ["os", "scrapy", "lxml", "w3lib", "pkg_resources", "zope.interface", "twisted.internet"], "excludes": []} # GUI applications require a different base on Windows (the default is for a # console application). diff --git a/sourceloader.py b/sourceloader.py index 67efe63..e09e928 100644 --- a/sourceloader.py +++ b/sourceloader.py @@ -12,13 +12,11 @@ class SourceLoader: if hasattr(sys,'frozen'): path = os.path.dirname(sys.executable) - path += "\\" + rel_dir - known_parser = set() - else: path = os.path.dirname(os.path.abspath(__file__)) - path += "\\" + rel_dir - known_parser = set() + + path += "\\" + rel_dir + known_parser = set() for py in [f[:-3] for f in os.listdir(path) if f.endswith('.py') and f != '__init__.py']: mod = __import__('.'.join([rel_dir.replace('\\', "."), py]), fromlist=[py])