duplicity.commandline module

Parse command line, check for consistency, and set globals

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

Bases: optparse.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 = {'int': <function check_builtin>, 'verbosity': <function check_verbosity>, 'float': <function check_builtin>, 'long': <function check_builtin>, 'choice': <function check_choice>, 'complex': <function check_builtin>, 'file': <function check_file>, 'time': <function check_time>}
take_action(action, dest, opt, value, values, parser)[source]
class duplicity.commandline.OPHelpFix(usage=None, option_list=None, option_class=<class optparse.Option>, version=None, conflict_handler='error', description=None, formatter=None, add_help_option=True, prog=None, epilog=None)[source]

Bases: optparse.OptionParser

print_help(file=None)[source]

overwrite method with proper utf-8 decoding

duplicity.commandline.ProcessCommandLine(cmdline_list)[source]

Process command line, set globals, 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.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 globals.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 globals.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.