Common module: custom_callables.py

custom_callables.py

A module containing common-use subroutines for options parsing in scripts. These are designed to be used with the argparse package that should be used for all argument parsing from this point on!

Basically these are a bunch of custom callables that takes a single string argument and return a converted value for use with the ‘type’ option.

module_version:1.0
created_on:2013-04-05

Custom argparse.ArgumentParser callables

script_options.custom_callables.input_path(string)[source]

Checks to see if the string is a valid input path

Returns the full path of the string if true, otherwise raise a custom exception.

script_options.custom_callables.input_file(string)[source]

Checks to see if the string is a valid input file

Returns the full path of the string if true, otherwise raise a custom exception.

script_options.custom_callables.output_path(string)[source]

Checks to see if the string is a valid output path; makes it if not

script_options.custom_callables.output_file(string)[source]

Checks to see if the the dir of the string is a valid output path

If not, it makes it and then returns the absolute path for the file

Table Of Contents

Previous topic

Common module: standard_parsers.py

Next topic

Test Routines

This Page