pyggui.client package

Submodules

pyggui.client.build module

Module for building current game into an executable using pyinstaller.

pyggui.client.build.get_arguments_dict(args: List[str], separator: str = '=') Dict[source]

Function parses arguments from an args list, based on a separator, into a dictionary of key, value pairs. Default separator is ‘=’.

Parameters
  • args (List[str]) – Arguments list.

  • separator (str) – Separator for every argument, key’sep’value. Defaults to ‘=’.

pyggui.client.build.main(argv: List[str]) int[source]

Main function for building the game project into an executable using Pyinstaller.

Parameters

argv (List[str]) – sys.argv, not including “build”.

Returns

int – Exit code

pyggui.client.cli module

Module that contains the command line app.

Why does this file exist, and why not put this in __main__?

You might be tempted to import things from __main__ later, but that will cause problems: the code will get executed twice:

  • When you run python -m pyggui python will execute __main__.py as a script. That means there won’t be any pyggui.__main__ in sys.modules.

  • When you import __main__ it will get executed again (as a module) because there’s no pyggui.__main__ in sys.modules.

Also see (1) from http://click.pocoo.org/5/setuptools/#setuptools-integration

pyggui.client.cli.main(argv=['/home/docs/checkouts/readthedocs.org/user_builds/python-pyggui/envs/latest/lib/python3.7/site-packages/sphinx/__main__.py', '-T', '-E', '-b', 'html', '-d', '_build/doctrees', '-D', 'language=en', '.', '_build/html'])[source]

Creates a base directory structure for your project / game.

Parameters

argv (list) – List of arguments

Returns

int – A return code

pyggui.client.make module

Module for copying basic game structure into users directory.

pyggui.client.make.copy_folder(from_dir: str, to_dir: str, indent: int) None[source]

Function copies one directory to another with all its contents. Prints what was copied, each sub-directory gets more indented.

Parameters
  • from_dir (str) – Path to directory to copy.

  • to_dir (str) – Path to directory where to copy.

  • indent (int) – Amount to indent, used in recursion.

pyggui.client.make.copy_structure(from_dir: str, to_dir: str) None[source]

Function copies one structure to the next without copying already set directories / files.

Parameters
  • from_dir (str) – Path to directory to copy

  • to_dir (str) – Path to directory where to copy

pyggui.client.make.find_environment_directory(path: str) str[source]

Function finds venv in passed path and returns path to its parent directory. If venv or env not found, returns None.

Parameters

path (str) – Path to find venv or env in.

pyggui.client.make.main(argv: List[str]) int[source]

Main function for creating the structure needed to start developing a game using pyggui.

Parameters

argv (List[str]) – sys.argv, not including “make”.

Returns

int – Exit code

Module contents