duplicity.commandline module

Parse command line, check for consistency, and set config

class duplicity.commandline.DupOption(*opts, **attrs)[source]

Bases: Option

ACTIONS = ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', 'callback', 'help', 'version', 'extend')
ALWAYS_TYPED_ACTIONS = ('store', 'append', 'extend')
STORE_ACTIONS = ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', 'extend')
TYPED_ACTIONS = ('store', 'append', 'callback', 'extend')
TYPES = ('string', 'int', 'long', 'float', 'complex', 'choice', 'file', 'time', 'verbosity')
TYPE_CHECKER = {'choice': <function check_choice>, 'complex': <function check_builtin>, 'file': <function check_file>, 'float': <function check_builtin>, 'int': <function check_builtin>, 'long': <function check_builtin>, 'time': <function check_time>, 'verbosity': <function check_verbosity>}
take_action(action, dest, opt, value, values, parser)[source]
duplicity.commandline.ProcessCommandLine(cmdline_list)[source]

Process command line, set config, return action

action will be “list-current”, “collection-status”, “cleanup”, “remove-old”, “restore”, “verify”, “full”, or “inc”.

duplicity.commandline.args_to_path_backend(arg1, arg2)[source]

Given exactly two arguments, arg1 and arg2, figure out which one is the backend URL and which one is a local path, and return (local, backend).

duplicity.commandline.check_consistency(action)[source]

Final consistency check, see if something wrong with command line

duplicity.commandline.check_file(option, opt, value)[source]
duplicity.commandline.check_time(option, opt, value)[source]
duplicity.commandline.check_verbosity(option, opt, value)[source]
duplicity.commandline.command_line_error(message)[source]

Indicate a command line error and exit

duplicity.commandline.expand_archive_dir(archdir, backname)[source]

Return expanded version of archdir joined with backname.

duplicity.commandline.expand_fn(filename)[source]
duplicity.commandline.generate_default_backup_name(backend_url)[source]

@param backend_url: URL to backend. @returns A default backup name (string).

duplicity.commandline.noop()[source]
duplicity.commandline.old_fn_deprecation(opt)[source]
duplicity.commandline.old_globbing_filelist_deprecation(opt)[source]
duplicity.commandline.parse_cmdline_options(arglist)[source]

Parse argument list

duplicity.commandline.process_local_dir(action, local_pathname)[source]

Check local directory, set config.local_path

duplicity.commandline.set_archive_dir(dirstring)[source]

Check archive dir and set global

duplicity.commandline.set_backend(arg1, arg2)[source]

Figure out which arg is url, set backend

Return value is pair (path_first, path) where is_first is true iff path made from arg1.

duplicity.commandline.set_selection()[source]

Return selection iter starting at filename with arguments applied

duplicity.commandline.set_sign_key(sign_key)[source]

Set config.sign_key assuming proper key given

duplicity.commandline.stdin_deprecation(opt)[source]
duplicity.commandline.usage()[source]

Returns terse usage info. The code is broken down into pieces for ease of translation maintenance. Any comments that look extraneous or redundant should be assumed to be for the benefit of translators, since they can get each string (paired with its preceding comment, if any) independently of the others.