guikit.scripts

Module Contents

Classes

SubCommand

Helper class that provides a standard way to create an ABC using

RunSubCommand

Helper class that provides a standard way to create an ABC using

InitSubCommand

Helper class that provides a standard way to create an ABC using

PluginSubCommand

Helper class that provides a standard way to create an ABC using

Functions

run()

Runs guikit as an application, loading all the plugins available.

_init_repo(path, name)

Initialises repository with the files/folders required to use guikit.

_list_plugins()

Lists all plugins available in guikit that the user can copy.

_copy_plugin(name, target)

Lists all plugins available in guikit that the user can copy.

_parse_args([argv])

Parse the input arguments list populating the relevant subcommands

main([argv])

Main entry point for guikit, calling the relevant subcommands.

Attributes

_SUB_COMMANDS

_SUB_COMMAND_BY_NAME

guikit.scripts.run()

Runs guikit as an application, loading all the plugins available.

guikit.scripts._init_repo(path, name)

Initialises repository with the files/folders required to use guikit.

This is done by copying the skeleton repository structure within guikit to the desired location.

Parameters:
  • path (pathlib.Path) – Where the repository should be initialized. Default: current.

  • name (str) – Name of the application.

guikit.scripts._list_plugins()

Lists all plugins available in guikit that the user can copy.

Return type:

None

guikit.scripts._copy_plugin(name, target)

Lists all plugins available in guikit that the user can copy.

Parameters:
  • name (List[str]) – List of plugins to copy.

  • target (pathlib.Path) – Root destination for the plugins.

Return type:

None

class guikit.scripts.SubCommand(name, description)

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract add_arguments(parser)
Parameters:

parser (argparse.ArgumentParser) –

abstract run(args)
Parameters:

args (argparse.Namespace) –

class guikit.scripts.RunSubCommand

Bases: SubCommand

Helper class that provides a standard way to create an ABC using inheritance.

add_arguments(parser)
Parameters:

parser (argparse.ArgumentParser) –

run(args)
Parameters:

args (argparse.Namespace) –

class guikit.scripts.InitSubCommand

Bases: SubCommand

Helper class that provides a standard way to create an ABC using inheritance.

add_arguments(parser)
Parameters:

parser (argparse.ArgumentParser) –

run(args)
Parameters:

args (argparse.Namespace) –

class guikit.scripts.PluginSubCommand

Bases: SubCommand

Helper class that provides a standard way to create an ABC using inheritance.

add_arguments(parser)
Parameters:

parser (argparse.ArgumentParser) –

run(args)
Parameters:

args (argparse.Namespace) –

guikit.scripts._SUB_COMMANDS: List[SubCommand]
guikit.scripts._SUB_COMMAND_BY_NAME: Dict[str, SubCommand]
guikit.scripts._parse_args(argv=None)

Parse the input arguments list populating the relevant subcommands

Parameters:

argv (List[str]) – List of arguments

Returns:

The namespace containing the relevant sub command information and arguments.

Return type:

argparse.Namespace

guikit.scripts.main(argv=None)

Main entry point for guikit, calling the relevant subcommands.

Parameters:

argv (List[str]) – List of input arguments, including subcommand.

Returns: