35 lines
589 B
Python
35 lines
589 B
Python
import logging
|
|
from os import getpid
|
|
|
|
from modules.app import PyroClient
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(name)s.%(funcName)s | %(levelname)s | %(message)s",
|
|
datefmt="[%X]",
|
|
)
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
try:
|
|
import uvloop
|
|
|
|
uvloop.install()
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
def main():
|
|
client = PyroClient()
|
|
|
|
try:
|
|
client.run()
|
|
except KeyboardInterrupt:
|
|
logger.warning(f"Forcefully shutting down with PID {getpid()}...")
|
|
finally:
|
|
client.__exit__()
|
|
exit()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |