muffin 1.0.2__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {muffin-1.0.2 → muffin-1.1.0}/PKG-INFO +1 -1
- {muffin-1.0.2 → muffin-1.1.0}/muffin/manage.py +12 -7
- {muffin-1.0.2 → muffin-1.1.0}/pyproject.toml +1 -1
- {muffin-1.0.2 → muffin-1.1.0}/README.rst +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/__init__.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/app.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/constants.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/errors.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/handler.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/plugins.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/py.typed +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/pytest.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/types.py +0 -0
- {muffin-1.0.2 → muffin-1.1.0}/muffin/utils.py +0 -0
@@ -57,9 +57,7 @@ class Manager:
|
|
57
57
|
def __init__(self, app: "Application"):
|
58
58
|
"""Initialize the manager."""
|
59
59
|
self.app = app
|
60
|
-
self.parser = argparse.ArgumentParser(
|
61
|
-
description="Manage %s" % app.cfg.name.capitalize(),
|
62
|
-
)
|
60
|
+
self.parser = argparse.ArgumentParser(description="Manage %s" % app.cfg.name.capitalize())
|
63
61
|
|
64
62
|
if len(AIOLIBS) > 1:
|
65
63
|
self.parser.add_argument(
|
@@ -141,7 +139,7 @@ class Manager:
|
|
141
139
|
def __call__(self, fn=None, *, lifespan=False): # noqa: C901
|
142
140
|
"""Register a command."""
|
143
141
|
|
144
|
-
def wrapper(fn): # noqa:
|
142
|
+
def wrapper(fn): # noqa: C901, PLR0912
|
145
143
|
if not inspect.iscoroutinefunction(fn) and lifespan:
|
146
144
|
raise AsyncRequiredError(fn)
|
147
145
|
|
@@ -155,7 +153,9 @@ class Manager:
|
|
155
153
|
self.app.logger.warning("Command %s already registered", command_name)
|
156
154
|
return fn
|
157
155
|
|
158
|
-
parser = self.subparsers.add_parser(
|
156
|
+
parser = self.subparsers.add_parser(
|
157
|
+
command_name, description=description, help=description
|
158
|
+
)
|
159
159
|
sig = inspect.signature(fn)
|
160
160
|
docs = dict(PARAM_RE.findall(fn.__doc__ or ""))
|
161
161
|
|
@@ -281,8 +281,13 @@ def cli():
|
|
281
281
|
try:
|
282
282
|
app = import_app(args_.app)
|
283
283
|
app.logger.info("Application is loaded: %s", app.cfg.name)
|
284
|
-
app.manage.run(*subargs_, prog="muffin %s" % args_.app)
|
285
284
|
|
285
|
+
except ImportError:
|
286
|
+
logging.exception("Failed to import application")
|
287
|
+
return sys.exit(1)
|
288
|
+
|
289
|
+
try:
|
290
|
+
app.manage.run(*subargs_, prog="muffin %s" % args_.app)
|
286
291
|
except Exception:
|
287
292
|
logging.exception("Command failed")
|
288
293
|
return sys.exit(1)
|
@@ -290,4 +295,4 @@ def cli():
|
|
290
295
|
sys.exit(0)
|
291
296
|
|
292
297
|
|
293
|
-
# ruff: noqa: T100
|
298
|
+
# ruff: noqa: T100, LOG015
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|