The types name is valuable, and we have a better use for it in collecting and
exposing types for options and commands.
The coretypes module should probably be split up anyway - it contains a
threading base class, a few container objects, and the defintion of our
serialization protocol. I was tempted to rename it to "uncagegorized" for the
sake of honesty.
The JS test assets depend in a brittle way on the details of the tflow()
utility functions. We shouldn't have to fix JS tests when adjusting these.
Options:
- Manually generate the test assets in a script.
- Define the JS assets without using tflow, so they don't unexpextedly
vary.
- Remove shortcuts for request, response, etc. - we don't need them if we have completion
- Restrict cuts specification to a set of prefixes
- Extend cuts to add a few more items
This type represents an argument to a command passed to another command. This
improves help text, and will be used in the partial parser to expand subcommand
types.
This represents a command passed as an argument. Also split arguments from
command values themselves, making the command help for meta-commands much
clearer.
We previously had the problem that overriding keypress() skipped
the proper calculation of the top widget's size, leading to broken
scrolling behavior in the flowlist. We now always use urwid.Frame's
keypress method, but we make sure that urwid.Pile and urwid.Columns
delegate to the currently focused component.
This makes it possible to specify more specific type annotations at runtime,
so that both mypy and our command system are happy. The .argument(name, type=)
syntax is similar to click's, so it should be fairly extensible if we need it.
This resolves as a string during MyPy checks, but at runtime has an additional
attribute that is a command that returns valid options.
This is very ugly and clumsy, basically because MyPy is super restrictive about
what it accepts as a type. Almost any attempt to construct these types in a
more sophisticated way fails in one way or another. I'm open to suggestions.