diff --git a/example/console-app/bootstrap/application.py b/example/console-app/bootstrap/application.py index 891ab8cb..d46f946f 100644 --- a/example/console-app/bootstrap/application.py +++ b/example/console-app/bootstrap/application.py @@ -6,8 +6,5 @@ app: Application = Application( base_path=Path(__file__).resolve().parent.parent, - providers=[ - LogProvider, - ConsoleServiceProvider - ] + providers=[LogProvider, ConsoleServiceProvider], ) diff --git a/example/console-app/commands/example_command.py b/example/console-app/commands/example_command.py index 8e74c9cd..a4f3ef95 100644 --- a/example/console-app/commands/example_command.py +++ b/example/console-app/commands/example_command.py @@ -5,23 +5,19 @@ class ExampleCommand(Command): - name ="hello" + name = "hello" description = "This command greet the users." arguments = [ - argument( - "name", - description="Who do you want to greet?", - optional=True - ) + argument("name", description="Who do you want to greet?", optional=True) ] def handle(self): - name = self.argument('name') + name = self.argument("name") if name: - text = 'Hello {}'.format(name) + text = "Hello {}".format(name) else: - text = 'Hello' + text = "Hello" # Example of showing loggings Logger.info(text) diff --git a/example/console-app/config/logging.py b/example/console-app/config/logging.py index 32d3f282..4b66e877 100644 --- a/example/console-app/config/logging.py +++ b/example/console-app/config/logging.py @@ -6,18 +6,19 @@ @dataclasses.dataclass class LoggingConfig: - default: str = dataclasses.field(default_factory=lambda: env('LOG_CHANNEL', 'stack')) + default: str = dataclasses.field( + default_factory=lambda: env("LOG_CHANNEL", "stack") + ) - channels: dict = dataclasses.field(default_factory=lambda: { - 'stack': StackChannel( - driver='stack', - channels=['daily', 'terminal'] - ), - 'daily': DailyChannel( - level=env('LOG_DAILY_LEVEL', 'debug'), - path=env('LOG_DAILY_PATH', 'storage/logs'), - ), - 'terminal': TerminalChannel( - level=env('LOG_TERMINAL_LEVEL', 'info'), - ), - }) + channels: dict = dataclasses.field( + default_factory=lambda: { + "stack": StackChannel(driver="stack", channels=["daily", "terminal"]), + "daily": DailyChannel( + level=env("LOG_DAILY_LEVEL", "debug"), + path=env("LOG_DAILY_PATH", "storage/logs"), + ), + "terminal": TerminalChannel( + level=env("LOG_TERMINAL_LEVEL", "info"), + ), + } + ) diff --git a/example/console-app/providers/console.py b/example/console-app/providers/console.py index c7187755..d3b72500 100644 --- a/example/console-app/providers/console.py +++ b/example/console-app/providers/console.py @@ -7,6 +7,4 @@ def register(self): pass def boot(self): - self.app.add_commands([ - ExampleCommand - ]) + self.app.add_commands([ExampleCommand])