pkglts.manage module

Contains functions to manage the structure of the package.

Use ‘setup.py’ for common tasks.

pkglts.manage.add_option(name, cfg)[source]

Add a new option to this package.

Notes: See the list of available options online

Parameters:
  • name (str) – name of option to add

  • cfg (Config) – current package configuration

Returns:

updated package configuration

Return type:

(Config)

pkglts.manage.clean(rep='.')[source]

Thorough cleaning of all arborescence rooting at rep.

Todo: exception list instead of hardcoded one

Parameters:

rep (Path) – default “.”, top directory to clean

Returns:

None

pkglts.manage.init_pkg(rep='.')[source]

Initialise a package in given directory.

Parameters:

rep (Path) – directory to create pkg into, default current

Returns:

None

pkglts.manage.install_example_files(option, cfg, target=PosixPath('.'))[source]

Install example files associated to an option.

Parameters:
  • option (str) – name of option

  • cfg (Config) – current package configuration

  • target (Path) – target directory to write into

Returns:

whether operation succeeded or not

Return type:

(bool)

pkglts.manage.regenerate_option(cfg, name, target='.', overwrite=False)[source]

Call the regenerate function of a given option

Parameters:
  • cfg (Config) – current package configuration

  • name – (str) name of option

  • target – (Path) target directory to write into

  • overwrite (bool) – default False, whether or not to overwrite user modified files

Returns:

None

pkglts.manage.regenerate_package(cfg, target=PosixPath('.'), overwrite=False)[source]

Rebuild all automatically generated files.

Parameters:
  • cfg (Config) – current package configuration

  • target (Path) – target directory to write into

  • overwrite (bool) – default False, whether or not to overwrite user modified files

Returns:

None

pkglts.manage.reset_package(cfg, target=PosixPath('.'))[source]

Remove all templated files from packages.

Parameters:
  • cfg (Config) – current package configuration

  • target – (Path) target directory to write into

Returns:

None