todo_catalog package

Submodules

todo_catalog.catalog module

This module encapsulates all functionality necessary for running the todo_catalog operations.

Executing the fucntion is exposed to the command line via the get_todo call specifiied in the [options.entry_points] section of setup.cfg:

console_scripts =
    get_todo = todo_catalog.catalog:run
todo_catalog.catalog.get_config(args)[source]

Return configuration parameters

If both args and a config file are detected, the arg values will take priority

Parameters

args (argparse.Namespace) – An argparse Namespace of args passed at runtime

Raises

Exception if config file provided but no DEFAULTS section is present

Returns

a dictionary of configuration parameters

Return type

dict

todo_catalog.catalog.log_comment(td_file, file_name, line_n, comment)[source]

Log TODO comment in TODO.mds file

Parameters
  • td_file (file_object) – The markdown file open for writing

  • file_name (str) – A string indentifying the file in which the TODO comment was found

  • line_n (int) – Line number in file_name of TODO comment

  • comment (str) – The TODO comment text

Returns

All results written to TODO.md

Return type

None

todo_catalog.catalog.main(args)[source]

Wrapper allowing component functions to be called with string arguments in a CLI fashion

Generates TODO.md file from TODO comments found in a project, based on the configuration parameters provided either by a config file (see

Parameters

args (List[str]) – command line parameters as list of strings (for example ["--verbose", "42"]).

todo_catalog.catalog.parse_args(args)[source]

Parse command line parameters

Parameters

args (List[str]) – command line parameters as list of strings (for example ["--help"]).

Returns

command line parameters namespace

Return type

argparse.Namespace

todo_catalog.catalog.run()[source]

Calls main() passing the CLI arguments extracted from sys.argv

This function can be used as entry point to create console scripts with setuptools.

todo_catalog.catalog.walk_dir(config)[source]

Traverse directory to scan for TODO comments

Parameters

config (dict) – Configuration dictionary

Module contents