PEP8 compliance improvement.

This commit is contained in:
Andrew Bastien 2022-08-02 10:44:25 -04:00
parent 18edbce624
commit 2a1b2cf3cb

View file

@ -47,7 +47,8 @@ _SA = object.__setattr__
SERVER_RESTART = os.path.join(settings.GAME_DIR, "server", "server.restart") SERVER_RESTART = os.path.join(settings.GAME_DIR, "server", "server.restart")
# modules containing hook methods called during start_stop # 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 # modules containing plugin services
SERVER_SERVICES_PLUGIN_MODULES = make_iter(settings.SERVER_SERVICES_PLUGIN_MODULES) 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. 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: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_init"): if hasattr(mod, "at_server_init"):
m.at_server_init() mod.at_server_init()
def at_server_start(self): def at_server_start(self):
""" """
@ -541,9 +542,9 @@ class Evennia:
how it was shut down. how it was shut down.
""" """
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_start"): if hasattr(mod, "at_server_start"):
m.at_server_start() mod.at_server_start()
def at_server_stop(self): def at_server_stop(self):
""" """
@ -551,18 +552,18 @@ class Evennia:
of it is fore a reload, reset or shutdown. of it is fore a reload, reset or shutdown.
""" """
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_stop"): if hasattr(mod, "at_server_stop"):
m.at_server_stop() mod.at_server_stop()
def at_server_reload_start(self): def at_server_reload_start(self):
""" """
This is called only when server starts back up after a reload. This is called only when server starts back up after a reload.
""" """
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_reload_start"): if hasattr(mod, "at_server_reload_start"):
m.at_server_reload_start() mod.at_server_reload_start()
def at_post_portal_sync(self, mode): def at_post_portal_sync(self, mode):
""" """
@ -602,9 +603,9 @@ class Evennia:
This is called only time the server stops before a reload. This is called only time the server stops before a reload.
""" """
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_reload_stop"): if hasattr(mod, "at_server_reload_stop"):
m.at_server_reload_stop() mod.at_server_reload_stop()
def at_server_cold_start(self): def at_server_cold_start(self):
""" """
@ -632,18 +633,18 @@ class Evennia:
if character: if character:
character.delete() character.delete()
guest.delete() guest.delete()
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_cold_start"): if hasattr(mod, "at_server_cold_start"):
m.at_server_cold_start() mod.at_server_cold_start()
def at_server_cold_stop(self): def at_server_cold_stop(self):
""" """
This is called only when the server goes down due to a shutdown or reset. This is called only when the server goes down due to a shutdown or reset.
""" """
for m in SERVER_STARTSTOP_MODULES: for mod in SERVER_STARTSTOP_MODULES:
if hasattr(m, "at_server_cold_stop"): if hasattr(mod, "at_server_cold_stop"):
m.at_server_cold_stop() mod.at_server_cold_stop()
# ------------------------------------------------------------ # ------------------------------------------------------------