muffin 1.1.0__tar.gz → 1.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: muffin
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)
5
5
  License: MIT
6
6
  Keywords: asgi,web,web framework,asyncio,trio,curio
@@ -86,7 +86,7 @@ class Manager:
86
86
 
87
87
  # We have to use sync mode here because of eventloop conflict with ipython/promt-toolkit
88
88
  def shell(*, ipython: bool = True):
89
- """Start the application's shell.
89
+ """Start an interactive shell with the application context.
90
90
 
91
91
  :param ipython: Use IPython as a shell
92
92
  """
@@ -108,7 +108,7 @@ class Manager:
108
108
  self(shell)
109
109
 
110
110
  def run(host: str = "localhost", port: int = 5000):
111
- """Start the application's server."""
111
+ """Run the application with the given host and port."""
112
112
  from uvicorn.main import run as urun
113
113
 
114
114
  cfg = self.app.cfg
@@ -235,6 +235,14 @@ class Manager:
235
235
  if prog:
236
236
  self.parser.prog = prog
237
237
 
238
+ # Sort subparsers by name
239
+ choices_actions = getattr(self.subparsers, "_choices_actions", None)
240
+ if choices_actions:
241
+ sorted_actions = sorted(choices_actions, key=lambda a: a.dest)
242
+ choices_actions.clear()
243
+ choices_actions.extend(sorted_actions)
244
+ self.subparsers.metavar = "{" + ",".join(a.dest for a in sorted_actions) + "}"
245
+
238
246
  ns, _ = self.parser.parse_known_args(args or sys.argv[1:])
239
247
  kwargs = dict(ns._get_kwargs())
240
248
  fn = self.commands.get(kwargs.pop("subparser"))
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "muffin"
3
- version = "1.1.0"
3
+ version = "1.1.1"
4
4
  description = "Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)"
5
5
  readme = "README.rst"
6
6
  license = "MIT"
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