Frozen mode message type static
- I can't get the dynamic loading to work on OSX in frozen mode - I think that if someone wants to build a frozen executable with custom messagetypes modules, he can edit the file - so now it lists the existing types manually (for frozen mode only)
This commit is contained in:
parent
511b89ebbe
commit
484d4abb3c
|
@ -28,23 +28,19 @@ def constructObject(data):
|
|||
else:
|
||||
return returnObj
|
||||
|
||||
mods = []
|
||||
if paths.frozen is not None:
|
||||
with open(path.join(path.dirname(path.dirname(__file__)), 'messagetypes.txt'), 'rt') as f:
|
||||
for m in f.readlines():
|
||||
mods.append(m.rstrip())
|
||||
import messagetypes.message
|
||||
import messagetypes.vote
|
||||
else:
|
||||
mods = listdir(path.dirname(__file__))
|
||||
|
||||
for mod in mods:
|
||||
if mod == "__init__.py":
|
||||
continue
|
||||
splitted = path.splitext(mod)
|
||||
if splitted[1] != ".py":
|
||||
continue
|
||||
try:
|
||||
import_module("." + splitted[0], "messagetypes")
|
||||
except ImportError:
|
||||
logger.error("Error importing %s", mod, exc_info=True)
|
||||
else:
|
||||
logger.debug("Imported message type module %s", mod)
|
||||
for mod in listdir(path.dirname(__file__)):
|
||||
if mod == "__init__.py":
|
||||
continue
|
||||
splitted = path.splitext(mod)
|
||||
if splitted[1] != ".py":
|
||||
continue
|
||||
try:
|
||||
import_module("." + splitted[0], "messagetypes")
|
||||
except ImportError:
|
||||
logger.error("Error importing %s", mod, exc_info=True)
|
||||
else:
|
||||
logger.debug("Imported message type module %s", mod)
|
||||
|
|
Reference in New Issue
Block a user