1 """Core modules package for the mudpy engine."""
3 # Copyright (c) 2004-2017 Jeremy Stanley <fungi@yuggoth.org>. Permission
4 # to use, copy, modify, and distribute this software is granted under
5 # terms provided in the LICENSE file distributed with this software.
9 import mudpy # noqa (referenced via exec of string literal below)
11 if sys.version_info >= (3, 4):
12 import importlib # noqa (referenced via exec of string literal below)
14 # Python 3.3 lacks importlib.reload()
15 import imp as importlib # noqa (referenced via exec of string literal)
19 """Import/reload some modules (be careful, as this can result in loops)."""
21 # pick up the modules list from this package
24 # iterate over the list of modules provided
25 for module in modules:
27 # attempt to reload the module, assuming it was probably imported
30 exec("importlib.reload(%s)" % module)
32 # must not have been, so import it now
34 exec("import mudpy.%s" % module)
37 # load the modules contained in this package
38 modules = ["data", "misc", "password", "telnet"]