From 207c2d4dcc2c9e3adf2a381f342473298837b9b9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 19 Aug 2020 00:08:58 +0200 Subject: [PATCH] Reformat code --- royalnet/__main__.py | 7 ++++--- royalnet/herald/config.py | 18 +++++++++--------- royalnet/utils/__init__.py | 2 +- royalnet/utils/royalnetprocess.py | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/royalnet/__main__.py b/royalnet/__main__.py index 38310c59..b252d89a 100644 --- a/royalnet/__main__.py +++ b/royalnet/__main__.py @@ -1,14 +1,13 @@ -from typing import * - import logging import multiprocessing import time +from typing import * import click import toml -import royalnet.utils as ru import royalnet.serf as rs +import royalnet.utils as ru try: import royalnet.serf.telegram as rst @@ -124,6 +123,7 @@ def run(config_file: str): "serf_cfg": serf_cfg, } ) + processes[f"Serf.{name}"] = ru.RoyalnetProcess(serf_constructor, None) log.info(f"Serf.{name}: Enabled") @@ -154,6 +154,7 @@ def run(config_file: str): "constellation_cfg": config["Constellation"], } ) + processes["Constellation"] = ru.RoyalnetProcess(constellation_constructor, None) log.info("Constellation: Enabled") diff --git a/royalnet/herald/config.py b/royalnet/herald/config.py index c96f779c..a26c3646 100644 --- a/royalnet/herald/config.py +++ b/royalnet/herald/config.py @@ -54,15 +54,15 @@ class Config: @classmethod def from_config( - cls, *, - name: str, - address: str, - port: int, - secret: str, - secure: bool = False, - path: str = "/", - **_, - ): + cls, *, + name: str, + address: str, + port: int, + secret: str, + secure: bool = False, + path: str = "/", + **_, + ): return cls( name=name, address=address, diff --git a/royalnet/utils/__init__.py b/royalnet/utils/__init__.py index 979f7e49..c0aec256 100644 --- a/royalnet/utils/__init__.py +++ b/royalnet/utils/__init__.py @@ -2,13 +2,13 @@ from .asyncify import asyncify from .formatters import andformat, underscorize, ytdldateformat, numberemojiformat, ordinalformat from .log import init_logging from .multilock import MultiLock +from .royalnetprocess import RoyalnetProcess from .royaltyping import JSON from .sentry import init_sentry, sentry_exc, sentry_wrap, sentry_async_wrap from .sleep_until import sleep_until from .strip_tabs import strip_tabs from .taskslist import TaskList from .urluuid import to_urluuid, from_urluuid -from .royalnetprocess import RoyalnetProcess __all__ = [ "asyncify", diff --git a/royalnet/utils/royalnetprocess.py b/royalnet/utils/royalnetprocess.py index b9acc1a0..578fd211 100644 --- a/royalnet/utils/royalnetprocess.py +++ b/royalnet/utils/royalnetprocess.py @@ -1,6 +1,6 @@ -from typing import * import dataclasses import multiprocessing +from typing import * @dataclasses.dataclass()