Small refactor is done
This commit is contained in:
10
main.py
10
main.py
@@ -1,11 +1,13 @@
|
||||
import contextlib
|
||||
import logging
|
||||
from os import getpid
|
||||
|
||||
from modules.app import PyroClient
|
||||
|
||||
# Uncomment this and the line below client declaration
|
||||
# in order to use context manager in your commands.
|
||||
# from convopyro import Conversation
|
||||
|
||||
from modules.app import PyroClient
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
@@ -15,12 +17,10 @@ logging.basicConfig(
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
with contextlib.suppress(ImportError):
|
||||
import uvloop
|
||||
|
||||
uvloop.install()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
@@ -30,7 +30,7 @@ def main():
|
||||
try:
|
||||
client.run()
|
||||
except KeyboardInterrupt:
|
||||
logger.warning(f"Forcefully shutting down with PID {getpid()}...")
|
||||
logger.warning("Forcefully shutting down with PID %s...", getpid())
|
||||
finally:
|
||||
exit()
|
||||
|
||||
|
Reference in New Issue
Block a user