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>}¶
-
-
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
-
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.
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 globals.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.
set_sign_key
(sign_key)[source]¶ Set globals.sign_key assuming proper key given
-
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.