Cleaning up GlobalScriptContainer from some junk logic.
This commit is contained in:
parent
021f5779bf
commit
bac0e9a8c1
2 changed files with 8 additions and 10 deletions
|
|
@ -106,6 +106,9 @@ MONITOR_HANDLER = None
|
||||||
GLOBAL_SCRIPTS = None
|
GLOBAL_SCRIPTS = None
|
||||||
OPTION_CLASSES = None
|
OPTION_CLASSES = None
|
||||||
|
|
||||||
|
# variables
|
||||||
|
PORTAL_MODE = False
|
||||||
|
|
||||||
|
|
||||||
def _create_version():
|
def _create_version():
|
||||||
"""
|
"""
|
||||||
|
|
@ -160,6 +163,8 @@ def _init(portal_mode=False):
|
||||||
global EvMenu, EvTable, EvForm, EvMore, EvEditor
|
global EvMenu, EvTable, EvForm, EvMore, EvEditor
|
||||||
global ANSIString, FuncParser
|
global ANSIString, FuncParser
|
||||||
global AttributeProperty, TagProperty, TagCategoryProperty
|
global AttributeProperty, TagProperty, TagCategoryProperty
|
||||||
|
global PORTAL_MODE
|
||||||
|
PORTAL_MODE = portal_mode
|
||||||
|
|
||||||
# Parent typeclasses
|
# Parent typeclasses
|
||||||
# utilities
|
# utilities
|
||||||
|
|
@ -187,7 +192,7 @@ def _init(portal_mode=False):
|
||||||
from .utils import ansi, gametime, logger
|
from .utils import ansi, gametime, logger
|
||||||
from .utils.ansi import ANSIString
|
from .utils.ansi import ANSIString
|
||||||
|
|
||||||
if not portal_mode:
|
if not PORTAL_MODE:
|
||||||
# containers
|
# containers
|
||||||
from .utils.containers import GLOBAL_SCRIPTS, OPTION_CLASSES
|
from .utils.containers import GLOBAL_SCRIPTS, OPTION_CLASSES
|
||||||
|
|
||||||
|
|
@ -219,7 +224,7 @@ def _init(portal_mode=False):
|
||||||
)
|
)
|
||||||
from .utils.utils import class_from_module
|
from .utils.utils import class_from_module
|
||||||
|
|
||||||
if portal_mode:
|
if PORTAL_MODE:
|
||||||
# Set up the PortalSessionHandler
|
# Set up the PortalSessionHandler
|
||||||
from evennia.server.portal import portalsessionhandler
|
from evennia.server.portal import portalsessionhandler
|
||||||
|
|
||||||
|
|
@ -377,11 +382,6 @@ def _init(portal_mode=False):
|
||||||
del SystemCmds
|
del SystemCmds
|
||||||
del _EvContainer
|
del _EvContainer
|
||||||
|
|
||||||
# delayed starts - important so as to not back-access evennia before it has
|
|
||||||
# finished initializing
|
|
||||||
if not portal_mode:
|
|
||||||
GLOBAL_SCRIPTS.start()
|
|
||||||
|
|
||||||
|
|
||||||
def set_trace(term_size=(140, 80), debugger="auto"):
|
def set_trace(term_size=(140, 80), debugger="auto"):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,7 @@ class GlobalScriptContainer(Container):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# store a hash representation of the setup
|
# store a hash representation of the setup
|
||||||
script.attributes.add("_global_script_settings", compare_hash, category="settings_hash")
|
script.attributes.add("global_script_settings", compare_hash, category="settings_hash")
|
||||||
|
|
||||||
self.scripts[key] = script
|
|
||||||
|
|
||||||
return script
|
return script
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue