Skip to content

Latest commit

 

History

History
158 lines (88 loc) · 2.81 KB

docopt2json.md

File metadata and controls

158 lines (88 loc) · 2.81 KB

Docopt2json

Cli2gui Index / Cli2gui / Tojson / Docopt2json

Auto-generated documentation for cli2gui.tojson.docopt2json module.

actionToJson

Show source in docopt2json.py:11

Generate json for an action and set the widget - used by the application.

Signature

def actionToJson(
    action: tuple[str, str, int, Any, str], widget: ItemType, isPos: bool
) -> Item: ...

See also

categorize

Show source in docopt2json.py:37

Catergorise each action and generate json.

Each action is in the form (short, long, argcount, value, help_message)

Signature

def categorize(
    actions: list[tuple[str, str, int, Any, str]], isPos: bool = False
) -> Iterator[Item]: ...

See also

convert

Show source in docopt2json.py:117

Convert getopt to a dict.

Arguments


  • parser Any - docopt parser

Returns


  • ParserRep - dictionary representing parser object

Signature

def convert(parser: Any) -> ParserRep: ...

See also

extract

Show source in docopt2json.py:55

Get the actions as json for the parser.

Signature

def extract(parser: Any) -> list[Group]: ...

See also

parse

Show source in docopt2json.py:76

Parse an option help text, adapted from docopt.

Signature

def parse(optionDescription: str) -> tuple[str, str, int, Any, str]: ...

parseOpt

Show source in docopt2json.py:94

Parse an option help text, adapted from docopt.

Signature

def parseOpt(doc: Any) -> list[tuple[str, str, int, Any, str]]: ...

parsePos

Show source in docopt2json.py:106

Parse positional arguments from docstring.

Signature

def parsePos(doc: str) -> list[tuple[str, str]]: ...

parseSection

Show source in docopt2json.py:67

Taken from docopt.

Signature

def parseSection(name: str, source: str) -> list[str]: ...