Get some things working for pyinstaller

This commit is contained in:
blitzmann
2017-11-12 00:06:03 -05:00
parent 0cc646bab9
commit 266398b1de
7 changed files with 130 additions and 8 deletions

View File

@@ -15,7 +15,32 @@ updates = {}
appVersion = 0
prefix = __name__ + "."
for importer, modname, ispkg in pkgutil.iter_modules(__path__, prefix):
# load modules to work based with and without pyinstaller
# from: https://github.com/webcomics/dosage/blob/master/dosagelib/loader.py
# see: https://github.com/pyinstaller/pyinstaller/issues/1905
# load modules using iter_modules()
# (should find all filters in normal build, but not pyinstaller)
module_names = [m[1] for m in pkgutil.iter_modules(__path__, prefix)]
print ("module names from iter_modules: ", module_names)
# special handling for PyInstaller
importers = map(pkgutil.get_importer, __path__)
toc = set()
for i in importers:
if hasattr(i, 'toc'):
toc |= i.toc
for elm in toc:
if elm.startswith(prefix):
module_names.append(elm)
print("module names after get_importer toc: ", module_names)
for modname in module_names:
print(modname)
# loop through python files, extracting update number and function, and
# adding it to a list
modname_tail = modname.rsplit('.', 1)[-1]

View File

@@ -525,7 +525,7 @@ class MarketGroup(EqBase):
def __repr__(self):
return "MarketGroup(ID={}, name={}, parent={}) at {}".format(
self.ID, self.name, getattr(self.parent, "name", None), self.name, hex(id(self))
).encode('utf8')
)
class MetaGroup(EqBase):