mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
PEP8 compliance improvement.
This commit is contained in:
parent
18edbce624
commit
2a1b2cf3cb
1 changed files with 23 additions and 22 deletions
|
|
@ -47,7 +47,8 @@ _SA = object.__setattr__
|
|||
SERVER_RESTART = os.path.join(settings.GAME_DIR, "server", "server.restart")
|
||||
|
||||
# modules containing hook methods called during start_stop
|
||||
SERVER_STARTSTOP_MODULES = [mod_import(m) for m in make_iter(settings.AT_SERVER_STARTSTOP_MODULE) if isinstance(m, str)]
|
||||
SERVER_STARTSTOP_MODULES = [mod_import(mod) for mod in make_iter(settings.AT_SERVER_STARTSTOP_MODULE)
|
||||
if isinstance(mod, str)]
|
||||
|
||||
# modules containing plugin services
|
||||
SERVER_SERVICES_PLUGIN_MODULES = make_iter(settings.SERVER_SERVICES_PLUGIN_MODULES)
|
||||
|
|
@ -531,9 +532,9 @@ class Evennia:
|
|||
"""
|
||||
This is called first when the server is starting, before any other hooks, regardless of how it's starting.
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_init"):
|
||||
m.at_server_init()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_init"):
|
||||
mod.at_server_init()
|
||||
|
||||
def at_server_start(self):
|
||||
"""
|
||||
|
|
@ -541,9 +542,9 @@ class Evennia:
|
|||
how it was shut down.
|
||||
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_start"):
|
||||
m.at_server_start()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_start"):
|
||||
mod.at_server_start()
|
||||
|
||||
def at_server_stop(self):
|
||||
"""
|
||||
|
|
@ -551,18 +552,18 @@ class Evennia:
|
|||
of it is fore a reload, reset or shutdown.
|
||||
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_stop"):
|
||||
m.at_server_stop()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_stop"):
|
||||
mod.at_server_stop()
|
||||
|
||||
def at_server_reload_start(self):
|
||||
"""
|
||||
This is called only when server starts back up after a reload.
|
||||
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_reload_start"):
|
||||
m.at_server_reload_start()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_reload_start"):
|
||||
mod.at_server_reload_start()
|
||||
|
||||
def at_post_portal_sync(self, mode):
|
||||
"""
|
||||
|
|
@ -602,9 +603,9 @@ class Evennia:
|
|||
This is called only time the server stops before a reload.
|
||||
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_reload_stop"):
|
||||
m.at_server_reload_stop()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_reload_stop"):
|
||||
mod.at_server_reload_stop()
|
||||
|
||||
def at_server_cold_start(self):
|
||||
"""
|
||||
|
|
@ -632,18 +633,18 @@ class Evennia:
|
|||
if character:
|
||||
character.delete()
|
||||
guest.delete()
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_cold_start"):
|
||||
m.at_server_cold_start()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_cold_start"):
|
||||
mod.at_server_cold_start()
|
||||
|
||||
def at_server_cold_stop(self):
|
||||
"""
|
||||
This is called only when the server goes down due to a shutdown or reset.
|
||||
|
||||
"""
|
||||
for m in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(m, "at_server_cold_stop"):
|
||||
m.at_server_cold_stop()
|
||||
for mod in SERVER_STARTSTOP_MODULES:
|
||||
if hasattr(mod, "at_server_cold_stop"):
|
||||
mod.at_server_cold_stop()
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue