mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-28 06:02:13 +03:00
Monitor: flake8 and mypy pass
This commit is contained in:
parent
f8dc28b256
commit
35fcbd89d9
@ -1,3 +1,4 @@
|
|||||||
|
"""EDDN Monitor, which records stats about incoming messages."""
|
||||||
# coding: utf8
|
# coding: utf8
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@ -30,6 +31,7 @@ if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
|||||||
|
|
||||||
|
|
||||||
def parse_cl_args():
|
def parse_cl_args():
|
||||||
|
"""Parse command-line arguments."""
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
prog='Gateway',
|
prog='Gateway',
|
||||||
description='EDDN Gateway server',
|
description='EDDN Gateway server',
|
||||||
@ -49,12 +51,13 @@ def parse_cl_args():
|
|||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def date(__format) -> datetime.datetime:
|
|
||||||
|
def date(__format) -> str:
|
||||||
"""
|
"""
|
||||||
Make a 'now' datetime as per the supplied format.
|
Make a 'now' datetime as per the supplied format.
|
||||||
|
|
||||||
:param __format:
|
:param __format:
|
||||||
:return:
|
:return: String representation of 'now'
|
||||||
"""
|
"""
|
||||||
d = datetime.datetime.utcnow()
|
d = datetime.datetime.utcnow()
|
||||||
return d.strftime(__format)
|
return d.strftime(__format)
|
||||||
@ -289,6 +292,7 @@ def apply_cors() -> None:
|
|||||||
'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
|
'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
"""Handle setting up and running the bottle app."""
|
"""Handle setting up and running the bottle app."""
|
||||||
cl_args = parse_cl_args()
|
cl_args = parse_cl_args()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user