forked from Hay1tsme/artemis
reformat with black in preperation for merge to master
This commit is contained in:
@ -16,14 +16,20 @@ class Utils:
|
||||
if not dir.startswith("__"):
|
||||
try:
|
||||
mod = importlib.import_module(f"titles.{dir}")
|
||||
if hasattr(mod, "game_codes") and hasattr(mod, "index"): # Minimum required to function
|
||||
if hasattr(mod, "game_codes") and hasattr(
|
||||
mod, "index"
|
||||
): # Minimum required to function
|
||||
ret[dir] = mod
|
||||
|
||||
except ImportError as e:
|
||||
logging.getLogger("core").error(f"get_all_titles: {dir} - {e}")
|
||||
raise
|
||||
return ret
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_ip_addr(cls, req: Request) -> str:
|
||||
return req.getAllHeaders()[b"x-forwarded-for"].decode() if b"x-forwarded-for" in req.getAllHeaders() else req.getClientAddress().host
|
||||
return (
|
||||
req.getAllHeaders()[b"x-forwarded-for"].decode()
|
||||
if b"x-forwarded-for" in req.getAllHeaders()
|
||||
else req.getClientAddress().host
|
||||
)
|
||||
|
Reference in New Issue
Block a user