pkglts.manage_tools module

Specific helper function for manage script

pkglts.manage_tools.check_option_parameters(name, cfg)[source]

Check that the parameters associated to an option are valid.

Parameters:
  • name (str) – option name

  • cfg (Config) – current package configuration

pkglts.manage_tools.find_templates(src_dir, tgt_dir, cfg, rg_tree)[source]

Find all template files associated to an option

Warnings: modify rg_tree in place

Parameters:
  • src_dir (Path) – path to reference files

  • tgt_dir (Path) – path to target where files will be written

  • cfg (Config) – current package configuration

  • rg_tree (dict) – Structure to store path to templates found

Returns:

None

pkglts.manage_tools.render_template(src_pths, tgt_pth, cfg, overwrite_file)[source]

Render template and write it in tgt_pth

Parameters:
  • src_pths (list) – list of reference templates

  • tgt_pth (Path) – path to created file

  • cfg (Config) – current package configuration

  • overwrite_file (dict) – which files to overwrite

Returns:

bid, hash of block content

Return type:

(dict|None)

pkglts.manage_tools.update_opt(name, cfg)[source]

Update an option of this package.

Notes: If the option does not exists yet, add it first.

See the list of available option online

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

  • cfg (Config) – current package configuration