Cli2gui Index / Cli2gui / Decorators
Auto-generated documentation for cli2gui.decorators module.
Show source in decorators.py:171
Use this decorator in the function containing the argument parser. Serialises data to JSON and launches the Cli2Gui application.
run_function (Callable[..., Any]): The name of the function to call eg.
auto_enable
bool, optional - Enable the GUI by default. If enabled by default requires--disable-cli2gui
, otherwise requires--cli2gui
. Defaults to False.parser
str, optional - Override the parser to use. Currentoptions
are - "argparse", "getopt", "optparse", "docopt", "dephell_argparse". Defaults to "argparse".gui
str, optional - Override the gui to use. Current options are: "dearpygui", "pysimplegui", "pysimpleguiqt","pysimpleguiweb","freesimplegui", Defaults to "dearpygui". theme (Union[str, list[str]], optional): Set a base24 theme. Can also pass a base24 scheme file. eg. one-light.yaml. Defaults to "". darkTheme (Union[str, list[str]], optional): Set a base24 dark theme variant. Can also pass a base24 scheme file. eg. one-dark.yaml. Defaults to "".image
str, optional - Set the program icon. File extensions can be any that PIL supports. Defaults to "".program_name
str, optional - Override the program name. Defaults to "".program_description
str, optional - Override the program description. Defaults to "".max_args_shown
int, optional - Maximum number of args shown before using a scrollbar. Defaults to 5. menu (Union[dict[str, Any]], optional): Add a menu to the program. Defaults to "". eg. THIS_DIR = str(Path(file).resolve().parent)menu={"File"
- THIS_DIR + "/file.md"}
Any
- Runs the application
def Cli2Gui(
run_function: Callable[..., Any],
auto_enable: bool = False,
parser: str | ParserType = "argparse",
gui: str | ParserType = "dearpygui",
theme: str | list[str] = "",
darkTheme: str | list[str] = "",
image: str = "",
program_name: str = "",
program_description: str = "",
max_args_shown: int = 5,
menu: str | dict[str, Any] = "",
) -> Any: ...
Show source in decorators.py:108
Use this decorator in the function containing the argument parser. Serializes data to JSON and launches the Cli2Gui application.
run_function (Callable[..., Any]): The name of the function to call eg.
gui
str, optional - Override the gui to use. Current options are: "dearpygui", "pysimplegui", "pysimpleguiqt","pysimpleguiweb","freesimplegui", Defaults to "dearpygui". theme (Union[str, list[str]], optional): Set a base24 theme. Can also pass a base24 scheme file. eg. one-light.yaml. Defaults to "". darkTheme (Union[str, list[str]], optional): Set a base24 dark theme variant. Can also pass a base24 scheme file. eg. one-dark.yaml. Defaults to "".image
str, optional - Set the program icon. File extensions can be any that PIL supports. Defaults to "".program_name
str, optional - Override the program name. Defaults to "".program_description
str, optional - Override the program description. Defaults to "".max_args_shown
int, optional - Maximum number of args shown before using a scrollbar. Defaults to 5. menu (Union[dict[str, Any]], optional): Add a menu to the program. Defaults to "". eg. THIS_DIR = str(Path(file).resolve().parent)menu={"File"
- THIS_DIR + "/file.md"} **kwargs (dict[Any, Any]): kwargs
Any
- Runs the application
def Click2Gui(
run_function: Callable[..., Any],
gui: str | GUIType = "dearpygui",
theme: str | list[str] = "",
darkTheme: str | list[str] = "",
image: str = "",
program_name: str = "",
program_description: str = "",
max_args_shown: int = 5,
menu: str | dict[str, Any] = "",
**kwargs: dict[str, Any]
) -> None: ...
Show source in decorators.py:29
Generate a buildSpec from a parser.
selfParser
Any - A parser that acts on self. eg. ArgumentParser.parse_args argsParser (tuple[Any, ...]): A parser that acts on function arguments. eg. getopt.getopt kwargsParser (dict[Any, Any]): A parser that acts on named paramssourcePath
str - Program source pathbuildSpec
BuildSpec - Build spec **kwargs (dict[Any, Any]): kwargs
types.FullBuildSpec
- buildSpec to be used by the application
RuntimeError
- Throw error if incorrect parser selected
def createFromParser(
selfParser: Any,
argsParser: tuple[Any, ...],
kwargsParser: dict[Any, Any],
sourcePath: str,
buildSpec: BuildSpec,
**kwargs: dict[Any, Any]
) -> FullBuildSpec: ...