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>}
- 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.expand_archive_dir(archdir, backname)[source]
Return expanded version of archdir joined with backname.
- duplicity.commandline.generate_default_backup_name(backend_url)[source]
@param backend_url: URL to backend. @returns A default backup name (string).
- duplicity.commandline.process_local_dir(action, local_pathname)[source]
Check local directory, set config.local_path
- 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.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.