module timelinelib.config.arguments

The ApplicationArguments class parses the command line arguments and options when the application is started.

If the application is started with:

python3 timeline.py -h

a text will be displayed that describes valid arguments and valid options.

Tests are found here.

timelinelib.config.arguments.FILENAME_DOC = 'Arguments:\n\n filename: If given, should be the path to a timeline file or one of the following special values:\n * :tutorial:\n Creates a readonly Gregorian tutorial timeline \n * :numtutorial: \n Creates a readonly Numeric tutorial timeline \n * path to an .ics file \n Creates a readonly timeline from ics data\n * path to a directory \n Creates a readonly timeline with the directory content as events\n'
class timelinelib.config.arguments.PosOptionParser[source]

Bases: optparse.OptionParser

Extend OptionParser with the possibility to print a formatted epilog in the help output.

__init__(*args, **kwargs)[source]

Init parent class

format_help(formatter=None)[source]

Extend the functionallity of the format_help() function.

class timelinelib.config.arguments.ApplicationArguments[source]

Bases: object

Parse and store the application arguments and options given on the command line when Timeline is started.

__init__(arguments)[source]

Create the command line parser and parse the arguments and options.

property config_file_path

Return the path to the timeline configuration file.

If the path is not given on the commandline the following path is returned:

wx.StandardPaths.Get().GetUserConfigDir() + “.thetimelineproj.cfg”

property first_file

Return the filename argument given on the command line or None if no filename was given.

property debug_flag

Return True/False depending on the --debug flag is used or not.

has_files()[source]

Return True/False depending on the existance of the filename argument