Merge lp:~mterry/duplicity/optparse into lp:duplicity/0.6

Proposed by Michael Terry
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mterry/duplicity/optparse
Merge into: lp:duplicity/0.6
Diff against target: 1164 lines (+552/-201)
5 files modified
duplicity-bin (+3/-3)
duplicity/backend.py (+0/-4)
duplicity/commandline.py (+396/-41)
duplicity/globals.py (+2/-2)
po/duplicity.pot (+151/-151)
To merge this branch: bzr merge lp:~mterry/duplicity/optparse
Reviewer Review Type Date Requested Status
Kenneth Loafman Needs Fixing
Review via email: mp+15703@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Take a look at my comment in https://bugs.launchpad.net/duplicity/+bug/490619. Mostly, it looks fine, but there's still some work to be done.

When I did the merge on my own machine, I had to take two files, commandline.py and globals.py, directly from the optparse branch since there are merge errors line the ones below. That plus the errors in the link above say its not ready yet.

review: Needs Fixing
lp:~mterry/duplicity/optparse updated
621. By Michael Terry

fix a few typos

622. By Michael Terry

fix an undefined variable usage

623. By Michael Terry

use defaults from globals.py for commandline options

624. By Michael Terry

don't set xdg dirs in duplicity-bin now that globals.py is restored

625. By Michael Terry

whoops, remove debug code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity-bin'
2--- duplicity-bin 2009-10-23 20:35:06 +0000
3+++ duplicity-bin 2009-12-14 01:53:14 +0000
4@@ -1111,12 +1111,12 @@
5 os.setuid(os.geteuid())
6 os.setgid(os.getegid())
7
8+ # determine what action we're performing and process command line
9+ action = commandline.ProcessCommandLine(sys.argv[1:])
10+
11 # set the current time strings
12 dup_time.setcurtime()
13
14- # determine what action we're performing and process command line
15- action = commandline.ProcessCommandLine(sys.argv[1:])
16-
17 # get the passphrase if we need to based on action/options
18 globals.gpg_profile.passphrase = get_passphrase(1, action)
19
20
21=== modified file 'duplicity/backend.py'
22--- duplicity/backend.py 2009-07-15 14:02:09 +0000
23+++ duplicity/backend.py 2009-12-14 01:53:14 +0000
24@@ -26,7 +26,6 @@
25
26 import os
27 import sys
28-import socket
29 import time
30 import re
31 import getpass
32@@ -48,9 +47,6 @@
33 import duplicity.backends
34
35
36-# todo: this should really NOT be done here
37-socket.setdefaulttimeout(globals.timeout)
38-
39 _forced_backend = None
40 _backends = {}
41
42
43=== modified file 'duplicity/commandline.py'
44--- duplicity/commandline.py 2009-11-26 16:32:54 +0000
45+++ duplicity/commandline.py 2009-12-14 01:53:14 +0000
46@@ -21,10 +21,13 @@
47
48 """Parse command line, check for consistency, and set globals"""
49
50+from copy import copy
51+import optparse
52 import getopt
53 import os
54 import re
55 import sys
56+import socket
57
58 try:
59 from hashlib import md5
60@@ -62,6 +65,7 @@
61 "verify",
62 ]
63
64+<<<<<<< TREE
65 options = ["allow-source-mismatch",
66 "archive-dir=",
67 "asynchronous-upload",
68@@ -123,6 +127,8 @@
69 ]
70
71
72+=======
73+>>>>>>> MERGE-SOURCE
74 def old_fn_deprecation(opt):
75 print >>sys.stderr, _("Warning: Option %s is pending deprecation "
76 "and will be removed in a future release.\n"
77@@ -163,28 +169,365 @@
78 burlhash.update(backend_url)
79 return burlhash.hexdigest()
80
81+def check_file(option, opt, value):
82+ return expand_fn(value)
83+
84+def check_time(option, opt, value):
85+ try:
86+ return dup_time.genstrtotime(value)
87+ except dup_time.TimeException, e:
88+ raise optparse.OptionValueError(str(e))
89+
90+def check_verbosity(option, opt, value):
91+ fail = False
92+
93+ value = value.lower()
94+ if value in ['e', 'error']:
95+ verb = log.ERROR
96+ elif value in ['w', 'warning']:
97+ verb = log.WARNING
98+ elif value in ['n', 'notice']:
99+ verb = log.NOTICE
100+ elif value in ['i', 'info']:
101+ verb = log.INFO
102+ elif value in ['d', 'debug']:
103+ verb = log.DEBUG
104+ else:
105+ try:
106+ verb = int(value)
107+ except ValueError:
108+ fail = True
109+ if verb < 0 or verb > 9:
110+ fail = True
111+
112+ if fail:
113+ # TRANSL: In this portion of the usage instructions, "[ewnid]" indicates which
114+ # characters are permitted (e, w, n, i, or d); the brackets imply their own
115+ # meaning in regex; i.e., only one of the characters is allowed in an instance.
116+ raise optparse.OptionValueError("Verbosity must be one of: digit [0-9], character [ewnid], "
117+ "or word ['error', 'warning', 'notice', 'info', 'debug']. "
118+ "The default is 4 (Notice). It is strongly recommended "
119+ "that verbosity level is set at 2 (Warning) or higher.")
120+
121+ return verb
122+
123+class DupOption(optparse.Option):
124+ TYPES = optparse.Option.TYPES + ("file", "time", "verbosity",)
125+ TYPE_CHECKER = copy(optparse.Option.TYPE_CHECKER)
126+ TYPE_CHECKER["file"] = check_file
127+ TYPE_CHECKER["time"] = check_time
128+ TYPE_CHECKER["verbosity"] = check_verbosity
129+
130+ ACTIONS = optparse.Option.ACTIONS + ("extend",)
131+ STORE_ACTIONS = optparse.Option.STORE_ACTIONS + ("extend",)
132+ TYPED_ACTIONS = optparse.Option.TYPED_ACTIONS + ("extend",)
133+ ALWAYS_TYPED_ACTIONS = optparse.Option.ALWAYS_TYPED_ACTIONS + ("extend",)
134+
135+ def take_action(self, action, dest, opt, value, values, parser):
136+ if action == "extend":
137+ if hasattr(values, dest):
138+ setattr(values, dest, getattr(values, dest) + ' ' + value)
139+ else:
140+ setattr(values, dest, value)
141+ else:
142+ optparse.Option.take_action(
143+ self, action, dest, opt, value, values, parser)
144
145 def parse_cmdline_options(arglist):
146 """Parse argument list"""
147 global select_opts, select_files, full_backup
148 global list_current, collection_status, cleanup, remove_time, verify
149
150-
151- def sel_fl(filename):
152- """Helper function for including/excluding filelists below"""
153- try:
154- return open(filename, "r")
155+ def use_gio(*args):
156+ try:
157+ import duplicity.backends.giobackend
158+ backend.force_backend(duplicity.backends.giobackend.GIOBackend)
159+ except ImportError:
160+ log.FatalError(_("Unable to load gio module"), log.ErrorCode.gio_not_available)
161+
162+ def set_log_fd(fd):
163+ if fd < 1:
164+ raise optparse.OptionValueError("log-fd must be greater than zero.")
165+ log.add_fd(fd)
166+
167+ def set_time_sep(sep, opt):
168+ if sep == '-':
169+ raise optparse.OptionValueError("Dash ('-') not valid for time-separator.")
170+ globals.time_separator = sep
171+ old_fn_deprecation(opt)
172+
173+ def add_selection(o, s, v, p):
174+ select_opts.append((s, v))
175+
176+ def add_filelist(o, s, v, p):
177+ filename = v
178+ select_opts.append((s, filename))
179+ try:
180+ select_files.append(open(filename, "r"))
181 except IOError:
182 log.FatalError(_("Error opening file %s") % filename,
183 log.ErrorCode.cant_open_filelist)
184
185+ def print_ver(o, s, v, p):
186+ print "duplicity %s" % (globals.version)
187+ sys.exit(0)
188+
189+ parser = optparse.OptionParser(option_class=DupOption, usage=usage())
190+
191+ # If this is true, only warn and don't raise fatal error when backup
192+ # source directory doesn't match previous backup source directory.
193+ parser.add_option("--allow-source-mismatch", action="store_true")
194+
195+ # Set to the path of the archive directory (the directory which
196+ # contains the signatures and manifests of the relevent backup
197+ # collection), and for checkpoint state between volumes.
198+ # TRANSL: Used in usage help to represent a Unix-style path name. Example:
199+ # --archive-dir <path>
200+ parser.add_option("--archive-dir", type="file", metavar=_("path"))
201+
202+ # Asynchronous put/get concurrency limit
203+ # (default of 0 disables asynchronicity).
204+ parser.add_option("--asynchronous-upload", action="store_const", const=1,
205+ dest="async_concurrency")
206+
207+ # config dir for future use
208+ parser.add_option("--config-dir", type="file", metavar=_("path"),
209+ help=optparse.SUPPRESS_HELP)
210+
211+ parser.add_option("--current-time", action="callback", type="int",
212+ dest="", help=optparse.SUPPRESS_HELP,
213+ callback=lambda o, s, v, p: dup_time.setcurtime(v))
214+
215+ # Don't actually do anything, but still report what would be done
216+ parser.add_option("--dry-run", action="store_true")
217+
218+ # TRANSL: Used in usage help to represent an ID for a GnuPG key. Example:
219+ # --encrypt-key <gpg_key_id>
220+ parser.add_option("--encrypt-key", type="string", metavar=_("gpg-key-id"),
221+ dest="", action="callback",
222+ callback=lambda o, s, v, p: globals.gpg_profile.recipients.append(v))
223+
224+ # TRANSL: Used in usage help to represent a "glob" style pattern for
225+ # matching one or more files, as described in the documentation.
226+ # Example:
227+ # --exclude <shell_pattern>
228+ parser.add_option("--exclude", action="callback", metavar=_("shell_pattern"),
229+ dest="", type="string", callback=add_selection)
230+
231+ parser.add_option("--exclude-device-files", action="callback",
232+ dest="", callback=add_selection)
233+
234+ parser.add_option("--exclude-filelist", type="file", metavar=_("filename"),
235+ dest="", action="callback", callback=add_filelist)
236+
237+ parser.add_option("--exclude-filelist-stdin", action="callback", dest="",
238+ callback=lambda o, s, v, p: (select_opts.append(("--exclude-filelist", "standard input")),
239+ select_files.append(sys.stdin)))
240+
241+ parser.add_option("--exclude-globbing-filelist", type="file", metavar=_("filename"),
242+ dest="", action="callback", callback=add_filelist)
243+
244+ # TRANSL: Used in usage help to represent the name of a file. Example:
245+ # --log-file <filename>
246+ parser.add_option("--exclude-if-present", metavar=_("filename"), dest="",
247+ type="file", action="callback", callback=add_selection)
248+
249+ parser.add_option("--exclude-other-filesystems", action="callback",
250+ dest="", callback=add_selection)
251+
252+ # TRANSL: Used in usage help to represent a regular expression (regexp).
253+ parser.add_option("--exclude-regexp", metavar=_("regular_expression"),
254+ dest="", type="string", action="callback", callback=add_selection)
255+
256+ # Whether we should be particularly aggressive when cleaning up
257+ parser.add_option("--extra-clean", action="store_true")
258+
259+ # used in testing only - raises exception after volume
260+ parser.add_option("--fail-on-volume", type="int",
261+ help=optparse.SUPPRESS_HELP)
262+
263+ # If set, restore only the subdirectory or file specified, not the
264+ # whole root.
265+ # TRANSL: Used in usage help to represent a Unix-style path name. Example:
266+ # --archive-dir <path>
267+ parser.add_option("--file-to-restore", "-r", action="callback", type="file",
268+ metavar=_("path"), dest="restore_dir",
269+ callback=lambda o, s, v, p: setattr(p.values, "restore_dir", v.rstrip('/')))
270+
271+ # Used to confirm certain destructive operations like deleting old files.
272+ parser.add_option("--force", action="store_true")
273+
274+ # FTP data connection type
275+ parser.add_option("--ftp-passive", action="store_const", const="passive", dest="ftp_connection")
276+ parser.add_option("--ftp-regular", action="store_const", const="regular", dest="ftp_connection")
277+
278+ # If set, forces a full backup if the last full backup is older than
279+ # the time specified
280+ parser.add_option("--full-if-older-than", type="time", dest="full_force_time", metavar=_("time"))
281+
282+ parser.add_option("--gio", action="callback", callback=use_gio)
283+
284+ parser.add_option("--gpg-options", action="extend", metavar=_("options"))
285+
286+ # ignore (some) errors during operations; supposed to make it more
287+ # likely that you are able to restore data under problematic
288+ # circumstances. the default should absolutely always be False unless
289+ # you know what you are doing.
290+ parser.add_option("--ignore-errors", action="callback",
291+ callback=lambda o, s, v, p: (log.Warn(
292+ _("Running in 'ignore errors' mode due to %s; please "
293+ "re-consider if this was not intended") % s),
294+ setattr(p.values, o.dest, True)))
295+
296+ # Whether to use the full email address as the user name when
297+ # logging into an imap server. If false just the user name
298+ # part of the email address is used.
299+ parser.add_option("--imap-full-address", action="store_true",
300+ help=optparse.SUPPRESS_HELP)
301+
302+ # Name of the imap folder where we want to store backups.
303+ # Can be changed with a command line argument.
304+ # TRANSL: Used in usage help to represent an imap mailbox
305+ parser.add_option("--imap-mailbox", metavar=_("imap_mailbox"))
306+
307+ parser.add_option("--include", action="callback", metavar=_("shell_pattern"),
308+ dest="", type="string", callback=add_selection)
309+ parser.add_option("--include-filelist", type="file", metavar=_("filename"),
310+ dest="", action="callback", callback=add_filelist)
311+ parser.add_option("--include-globbing-filelist", type="file", metavar=_("filename"),
312+ dest="", action="callback", callback=add_filelist)
313+ parser.add_option("--include-regexp", metavar=_("regular_expression"), dest="",
314+ type="string", action="callback", callback=add_selection)
315+
316+ parser.add_option("--log-fd", type="int", metavar=_("file_descriptor"),
317+ dest="", action="callback",
318+ callback=lambda o, s, v, p: set_log_fd(v))
319+
320+ # TRANSL: Used in usage help to represent the name of a file. Example:
321+ # --log-file <filename>
322+ parser.add_option("--log-file", type="file", metavar=_("filename"),
323+ dest="", action="callback",
324+ callback=lambda o, s, v, p: log.add_file(v))
325+
326+ # TRANSL: Used in usage help (noun)
327+ parser.add_option("--name", dest="backup_name", metavar=_("backup name"))
328+
329+ # If set to false, then do not encrypt files on remote system
330+ parser.add_option("--no-encryption", action="store_false", dest="encryption")
331+
332+ # If set, print the statistics after every backup session
333+ parser.add_option("--no-print-statistics", action="store_false", dest="print_statistics")
334+
335+ # If true, filelists and directory statistics will be split on
336+ # nulls instead of newlines.
337+ parser.add_option("--null-separator", action="store_true")
338+
339+ # number of retries on network operations
340+ # TRANSL: Used in usage help to represent a desired number of
341+ # something. Example:
342+ # --num-retries <number>
343+ parser.add_option("--num-retries", type="int", metavar=_("number"))
344+
345+ # Whether the old filename format is in effect.
346+ parser.add_option("--old-filenames", action="callback",
347+ callback=lambda o, s, v, p: (setattr(p.values, o.dest, True),
348+ old_fn_deprecation(s)))
349+
350+ # Restores will try to bring back the state as of the following time.
351+ # If it is None, default to current time.
352+ # TRANSL: Used in usage help to represent a time spec for a previous
353+ # point in time, as described in the documentation. Example:
354+ # duplicity remove-older-than time [options] target_url
355+ parser.add_option("--restore-time", "--time", "-t", type="time", metavar=_("time"))
356+
357+ # Whether to create European buckets (sorry, hard-coded to only
358+ # support european for now).
359+ parser.add_option("--s3-european-buckets", action="store_true")
360+
361+ # Whether to use "new-style" subdomain addressing for S3 buckets. Such
362+ # use is not backwards-compatible with upper-case buckets, or buckets
363+ # that are otherwise not expressable in a valid hostname.
364+ parser.add_option("--s3-use-new-style", action="store_true")
365+
366+ # scp command to use
367+ # TRANSL: noun
368+ parser.add_option("--scp-command", metavar=_("command"))
369+
370+ # sftp command to use
371+ # TRANSL: noun
372+ parser.add_option("--sftp-command", metavar=_("command"))
373+
374+ # If set, use short (< 30 char) filenames for all the remote files.
375+ parser.add_option("--short-filenames", action="callback",
376+ callback=lambda o, s, v, p: (setattr(p.values, o.dest, True),
377+ old_fn_deprecation(s)))
378+
379+ # TRANSL: Used in usage help to represent an ID for a GnuPG key. Example:
380+ # --encrypt-key <gpg_key_id>
381+ parser.add_option("--sign-key", type="string", metavar=_("gpg-key-id"),
382+ dest="", action="callback",
383+ callback=lambda o, s, v, p: set_sign_key(v))
384+
385+ # default to batch mode using public-key encryption
386+ parser.add_option("--ssh-askpass", action="store_true")
387+
388+ # user added ssh options
389+ parser.add_option("--ssh-options", action="extend", metavar=_("options"))
390+
391+ # Working directory for the tempfile module. Defaults to /tmp on most systems.
392+ parser.add_option("--tempdir", dest="temproot", type="file", metavar=_("path"))
393+
394+ # network timeout value
395+ # TRANSL: Used in usage help. Example:
396+ # --timeout <seconds>
397+ parser.add_option("--timeout", type="int", metavar=_("seconds"))
398+
399+ # Character used like the ":" in time strings like
400+ # 2002-08-06T04:22:00-07:00. The colon isn't good for filenames on
401+ # windows machines.
402+ # TRANSL: abbreviation for "character" (noun)
403+ parser.add_option("--time-separator", type="string", metavar=_("char"),
404+ action="callback",
405+ callback=lambda o, s, v, p: set_time_sep(v, s))
406+
407+ # Whether to specify --use-agent in GnuPG options
408+ parser.add_option("--use-agent", action="store_true")
409+
410+ parser.add_option("--verbosity", "-v", type="verbosity", metavar="[0-9]",
411+ dest="", action="callback",
412+ callback=lambda o, s, v, p: log.setverbosity(v))
413+
414+ parser.add_option("-V", "--version", action="callback", callback=print_ver)
415+
416+ # volume size
417+ # TRANSL: Used in usage help to represent a desired number of
418+ # something. Example:
419+ # --num-retries <number>
420+ parser.add_option("--volsize", type="int", action="callback", metavar=_("number"),
421+ callback=lambda o, s, v, p: setattr(p.values, "volsize", v*1024*1024))
422+
423+ (options, args) = parser.parse_args()
424+
425+ # Copy all arguments and their values to the globals module. Don't copy
426+ # attributes that are 'hidden' (start with an underscore) or whose name is
427+ # the empty string (used for arguments that don't directly store a value
428+ # by using dest="")
429+ for f in filter(lambda x: x and not x.startswith("_"), dir(options)):
430+ v = getattr(options, f)
431+ # Only set if v is not None because None is the default for all the
432+ # variables. If user didn't set it, we'll use defaults in globals.py
433+ if v is not None:
434+ setattr(globals, f, v)
435+
436+ socket.setdefaulttimeout(globals.timeout)
437+
438 # expect no cmd and two positional args
439 cmd = ""
440 num_expect = 2
441
442 # process first arg as command
443- if arglist and arglist[0][0] != '-':
444- cmd = arglist.pop(0)
445+ if args:
446+ cmd = args.pop(0)
447 possible = [c for c in commands if c.startswith(cmd)]
448 # no unique match, that's an error
449 if len(possible) > 1:
450@@ -194,7 +537,7 @@
451 cmd = possible[0]
452 # no matches, assume no cmd
453 elif not possible:
454- arglist.insert(0, cmd)
455+ args.insert(0, cmd)
456
457 if cmd == "cleanup":
458 cleanup = True
459@@ -213,14 +556,14 @@
460 num_expect = 1
461 elif cmd == "remove-older-than":
462 try:
463- arg = arglist.pop(0)
464+ arg = args.pop(0)
465 except:
466 command_line_error("Missing time string for remove-older-than")
467 globals.remove_time = dup_time.genstrtotime(arg)
468 num_expect = 1
469 elif cmd == "remove-all-but-n-full":
470 try:
471- arg = arglist.pop(0)
472+ arg = args.pop(0)
473 except:
474 command_line_error("Missing count for remove-all-but-n-full")
475 globals.keep_chains = int(arg)
476@@ -230,6 +573,7 @@
477 elif cmd == "verify":
478 verify = True
479
480+<<<<<<< TREE
481 # parse the remaining args
482 try:
483 optlist, args = getopt.gnu_getopt(arglist, "hrt:v:V", options)
484@@ -398,6 +742,8 @@
485 if globals.old_filenames:
486 dup_time.curtimestr = dup_time.timetostring(dup_time.curtime)
487
488+=======
489+>>>>>>> MERGE-SOURCE
490 if len(args) != num_expect:
491 command_line_error("Expected %d args, got %d" % (num_expect, len(args)))
492
493@@ -440,7 +786,7 @@
494
495
496 def usage():
497- """Print terse usage info. The code is broken down into pieces for ease of
498+ """Returns terse usage info. The code is broken down into pieces for ease of
499 translation maintenance. Any comments that look extraneous or redundant should
500 be assumed to be for the benefit of translators, since they can get each string
501 (paired with its preceding comment, if any) independently of the others."""
502@@ -454,9 +800,6 @@
503 # tahoe://alias/some_dir
504 'alias' : _("alias"),
505
506- # TRANSL: Used in usage help (noun)
507- 'backup_name' : _("backup name"),
508-
509 # TRANSL: Used in help to represent a "bucket name" for Amazon Web
510 # Services' Simple Storage Service (S3). Example:
511 # s3://other.host/bucket_name[/prefix]
512@@ -574,44 +917,42 @@
513 # ftp://user[:password]@other.host[:port]/some_dir
514 'user' : _("user") }
515
516- msg = _("duplicity version %s running on %s.") % (globals.version, sys.platform)
517- msg = "\n" + msg + "\n"
518-
519 # TRANSL: Header in usage help
520- msg = msg + _("Usage:") + """
521- duplicity [full|incremental] [%(options)s] %(source_dir)s %(target_url)s
522- duplicity [restore] [%(options)s] %(source_url)s %(target_dir)s
523- duplicity verify [%(options)s] %(source_url)s %(target_dir)s
524- duplicity collection-status [%(options)s] %(target_url)s
525- duplicity list-current-files [%(options)s] %(target_url)s
526- duplicity cleanup [%(options)s] %(target_url)s
527- duplicity remove-older-than %(time)s [%(options)s] %(target_url)s
528- duplicity remove-all-but-n-full %(count)s [%(options)s] %(target_url)s
529+ msg = """
530+ duplicity [full|incremental] [%(options)s] %(source_dir)s %(target_url)s
531+ duplicity [restore] [%(options)s] %(source_url)s %(target_dir)s
532+ duplicity verify [%(options)s] %(source_url)s %(target_dir)s
533+ duplicity collection-status [%(options)s] %(target_url)s
534+ duplicity list-current-files [%(options)s] %(target_url)s
535+ duplicity cleanup [%(options)s] %(target_url)s
536+ duplicity remove-older-than %(time)s [%(options)s] %(target_url)s
537+ duplicity remove-all-but-n-full %(count)s [%(options)s] %(target_url)s
538
539 """ % dict
540
541 # TRANSL: Header in usage help
542 msg = msg + _("Backends and their URL formats:") + """
543- cf+http://%(container_name)s
544- file:///%(some_dir)s
545- ftp://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
546- hsi://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
547- imap://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
548- rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]::/%(module)s/%(some_dir)s
549- rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(relative_path)s
550- rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]//%(absolute_path)s
551- s3://%(other_host)s/%(bucket_name)s[/%(prefix)s]
552- s3+http://%(bucket_name)s[/%(prefix)s]
553- scp://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
554- ssh://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
555- tahoe://%(alias)s/%(directory)s
556- webdav://%(user)s[:%(password)s]@%(other_host)s/%(some_dir)s
557- webdavs://%(user)s[:%(password)s]@%(other_host)s/%(some_dir)s
558+ cf+http://%(container_name)s
559+ file:///%(some_dir)s
560+ ftp://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
561+ hsi://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
562+ imap://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
563+ rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]::/%(module)s/%(some_dir)s
564+ rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(relative_path)s
565+ rsync://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]//%(absolute_path)s
566+ s3://%(other_host)s/%(bucket_name)s[/%(prefix)s]
567+ s3+http://%(bucket_name)s[/%(prefix)s]
568+ scp://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
569+ ssh://%(user)s[:%(password)s]@%(other_host)s[:%(port)s]/%(some_dir)s
570+ tahoe://%(alias)s/%(directory)s
571+ webdav://%(user)s[:%(password)s]@%(other_host)s/%(some_dir)s
572+ webdavs://%(user)s[:%(password)s]@%(other_host)s/%(some_dir)s
573
574 """ % dict
575
576 # TRANSL: Header in usage help
577 msg = msg + _("Commands:") + """
578+<<<<<<< TREE
579 cleanup <%(target_url)s>
580 collection-status <%(target_url)s>
581 full <%(source_dir)s> <%(target_url)s>
582@@ -697,6 +1038,20 @@
583 except ValueError:
584 command_line_error("Received '%s' for %s, need integer" %
585 (int_string, description.lstrip('-')))
586+=======
587+ cleanup <%(target_url)s>
588+ collection-status <%(target_url)s>
589+ full <%(source_dir)s> <%(target_url)s>
590+ incr <%(source_dir)s> <%(target_url)s>
591+ list-current-files <%(target_url)s>
592+ restore <%(target_url)s> <%(source_dir)s>
593+ remove-older-than <%(time)s> <%(target_url)s>
594+ remove-all-but-n-full <%(count)s> <%(target_url)s>
595+ verify <%(target_url)s> <%(source_dir)s>""" % dict
596+
597+ return msg
598+
599+>>>>>>> MERGE-SOURCE
600
601 def set_archive_dir(dirstring):
602 """Check archive dir and set global"""
603
604=== modified file 'duplicity/globals.py'
605--- duplicity/globals.py 2009-11-26 16:32:54 +0000
606+++ duplicity/globals.py 2009-12-14 01:53:15 +0000
607@@ -88,10 +88,10 @@
608 incremental = None
609
610 # If set, print the statistics after every backup session
611-print_statistics = 1
612+print_statistics = True
613
614 # If set, use short (< 30 char) filenames for all the remote files.
615-short_filenames = 0
616+short_filenames = False
617
618 # If set, forces a full backup if the last full backup is older than
619 # the time specified
620
621=== modified file 'po/duplicity.pot'
622--- po/duplicity.pot 2009-11-08 16:12:07 +0000
623+++ po/duplicity.pot 2009-12-14 01:53:15 +0000
624@@ -8,7 +8,7 @@
625 msgstr ""
626 "Project-Id-Version: PACKAGE VERSION\n"
627 "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
628-"POT-Creation-Date: 2009-10-29 14:51-0600\n"
629+"POT-Creation-Date: 2009-11-30 21:10-0500\n"
630 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
631 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
632 "Language-Team: LANGUAGE <LL@li.org>\n"
633@@ -230,39 +230,39 @@
634 " backup then restart the backup from the beginning."
635 msgstr ""
636
637-#: ../duplicity-bin:1157
638+#: ../duplicity-bin:1160
639 #, python-format
640 msgid "Last %s backup left a partial set, restarting."
641 msgstr ""
642
643-#: ../duplicity-bin:1161
644+#: ../duplicity-bin:1164
645 #, python-format
646 msgid "Cleaning up previous partial %s backup set, restarting."
647 msgstr ""
648
649-#: ../duplicity-bin:1172
650+#: ../duplicity-bin:1175
651 msgid "Last full backup date:"
652 msgstr ""
653
654-#: ../duplicity-bin:1174
655+#: ../duplicity-bin:1177
656 msgid "Last full backup date: none"
657 msgstr ""
658
659-#: ../duplicity-bin:1176
660+#: ../duplicity-bin:1179
661 msgid "Last full backup is too old, forcing full backup"
662 msgstr ""
663
664-#: ../duplicity-bin:1250
665+#: ../duplicity-bin:1253
666 #, python-format
667 msgid "GPG error detail: %s"
668 msgstr ""
669
670-#: ../duplicity-bin:1259
671+#: ../duplicity-bin:1262
672 #, python-format
673 msgid "User error detail: %s"
674 msgstr ""
675
676-#: ../duplicity-bin:1268
677+#: ../duplicity-bin:1271
678 #, python-format
679 msgid "Backend error detail: %s"
680 msgstr ""
681@@ -303,33 +303,33 @@
682 msgid "task execution done (success: %s)"
683 msgstr ""
684
685-#: ../duplicity/backend.py:370
686+#: ../duplicity/backend.py:366
687 #, python-format
688 msgid "Running '%s'"
689 msgstr ""
690
691-#: ../duplicity/backend.py:384
692+#: ../duplicity/backend.py:380
693 #, python-format
694 msgid "Running '%s' (attempt #%d)"
695 msgid_plural "Running '%s' (attempt #%d)"
696 msgstr[0] ""
697 msgstr[1] ""
698
699-#: ../duplicity/backend.py:389 ../duplicity/backend.py:430
700+#: ../duplicity/backend.py:385 ../duplicity/backend.py:426
701 #, python-format
702 msgid "Running '%s' failed (attempt #%d)"
703 msgid_plural "Running '%s' failed (attempt #%d)"
704 msgstr[0] ""
705 msgstr[1] ""
706
707-#: ../duplicity/backend.py:392 ../duplicity/backend.py:433
708+#: ../duplicity/backend.py:388 ../duplicity/backend.py:429
709 #, python-format
710 msgid "Giving up trying to execute '%s' after %d attempt"
711 msgid_plural "Giving up trying to execute '%s' after %d attempts"
712 msgstr[0] ""
713 msgstr[1] ""
714
715-#: ../duplicity/backend.py:403 ../duplicity/backend.py:420
716+#: ../duplicity/backend.py:399 ../duplicity/backend.py:416
717 #, python-format
718 msgid "Reading results of '%s'"
719 msgstr ""
720@@ -552,7 +552,7 @@
721 "starting at time %s."
722 msgstr ""
723
724-#: ../duplicity/commandline.py:126
725+#: ../duplicity/commandline.py:69
726 #, python-format
727 msgid ""
728 "Warning: Option %s is pending deprecation and will be removed in a future "
729@@ -560,179 +560,212 @@
730 "Use of default filenames is strongly suggested."
731 msgstr ""
732
733-#: ../duplicity/commandline.py:177
734+#: ../duplicity/commandline.py:182
735+msgid "Unable to load gio module"
736+msgstr ""
737+
738+#: ../duplicity/commandline.py:203
739 #, python-format
740 msgid "Error opening file %s"
741 msgstr ""
742
743-#: ../duplicity/commandline.py:291
744-msgid "Unable to load gio module"
745-msgstr ""
746-
747-#: ../duplicity/commandline.py:386
748+#. Used in usage help to represent a Unix-style path name. Example:
749+#. --archive-dir <path>
750+#: ../duplicity/commandline.py:221 ../duplicity/commandline.py:229
751+#: ../duplicity/commandline.py:289 ../duplicity/commandline.py:413
752+#: ../duplicity/commandline.py:655
753+msgid "path"
754+msgstr ""
755+
756+#. Used in usage help to represent an ID for a GnuPG key. Example:
757+#. --encrypt-key <gpg_key_id>
758+#: ../duplicity/commandline.py:241 ../duplicity/commandline.py:402
759+#: ../duplicity/commandline.py:628
760+msgid "gpg-key-id"
761+msgstr ""
762+
763+#. Used in usage help to represent a "glob" style pattern for
764+#. matching one or more files, as described in the documentation.
765+#. Example:
766+#. --exclude <shell_pattern>
767+#: ../duplicity/commandline.py:249 ../duplicity/commandline.py:328
768+#: ../duplicity/commandline.py:678
769+msgid "shell_pattern"
770+msgstr ""
771+
772+#. Used in usage help to represent the name of a file. Example:
773+#. --log-file <filename>
774+#: ../duplicity/commandline.py:255 ../duplicity/commandline.py:262
775+#: ../duplicity/commandline.py:267 ../duplicity/commandline.py:330
776+#: ../duplicity/commandline.py:332 ../duplicity/commandline.py:343
777+#: ../duplicity/commandline.py:624
778+msgid "filename"
779+msgstr ""
780+
781+#. Used in usage help to represent a regular expression (regexp).
782+#: ../duplicity/commandline.py:274 ../duplicity/commandline.py:334
783+msgid "regular_expression"
784+msgstr ""
785+
786+#. Used in usage help to represent a time spec for a previous
787+#. point in time, as described in the documentation. Example:
788+#. duplicity remove-older-than time [options] target_url
789+#: ../duplicity/commandline.py:301 ../duplicity/commandline.py:376
790+#: ../duplicity/commandline.py:710
791+msgid "time"
792+msgstr ""
793+
794+#. Used in usage help. (Should be consistent with the "Options:"
795+#. header.) Example:
796+#. duplicity [full|incremental] [options] source_dir target_url
797+#: ../duplicity/commandline.py:305 ../duplicity/commandline.py:410
798+#: ../duplicity/commandline.py:643
799+msgid "options"
800+msgstr ""
801+
802+#: ../duplicity/commandline.py:313
803+#, python-format
804 msgid ""
805-"running in 'ignore errors' mode due to --ignore-errors; please re-consider "
806-"if this was not intended"
807-msgstr ""
808-
809-#: ../duplicity/commandline.py:426
810+"Running in 'ignore errors' mode due to %s; please re-consider if this was "
811+"not intended"
812+msgstr ""
813+
814+#. Used in usage help to represent an imap mailbox
815+#: ../duplicity/commandline.py:326
816+msgid "imap_mailbox"
817+msgstr ""
818+
819+#: ../duplicity/commandline.py:337
820+msgid "file_descriptor"
821+msgstr ""
822+
823+#. Used in usage help (noun)
824+#: ../duplicity/commandline.py:348
825+msgid "backup name"
826+msgstr ""
827+
828+#. Used in usage help to represent a desired number of
829+#. something. Example:
830+#. --num-retries <number>
831+#: ../duplicity/commandline.py:364 ../duplicity/commandline.py:441
832+#: ../duplicity/commandline.py:638
833+msgid "number"
834+msgstr ""
835+
836+#. noun
837+#: ../duplicity/commandline.py:389 ../duplicity/commandline.py:393
838+#: ../duplicity/commandline.py:609
839+msgid "command"
840+msgstr ""
841+
842+#. Used in usage help. Example:
843+#. --timeout <seconds>
844+#: ../duplicity/commandline.py:418 ../duplicity/commandline.py:672
845+msgid "seconds"
846+msgstr ""
847+
848+#. abbreviation for "character" (noun)
849+#: ../duplicity/commandline.py:424 ../duplicity/commandline.py:606
850+msgid "char"
851+msgstr ""
852+
853+#: ../duplicity/commandline.py:572
854 #, python-format
855 msgid "Using archive dir: %s"
856 msgstr ""
857
858-#: ../duplicity/commandline.py:427
859+#: ../duplicity/commandline.py:573
860 #, python-format
861 msgid "Using backup name: %s"
862 msgstr ""
863
864-#: ../duplicity/commandline.py:434
865+#: ../duplicity/commandline.py:580
866 #, python-format
867 msgid "Command line error: %s"
868 msgstr ""
869
870-#: ../duplicity/commandline.py:435
871+#: ../duplicity/commandline.py:581
872 msgid "Enter 'duplicity --help' for help screen."
873 msgstr ""
874
875 #. Used in usage help to represent a Unix-style path name. Example:
876 #. rsync://user[:password]@other_host[:port]//absolute_path
877-#: ../duplicity/commandline.py:448
878+#: ../duplicity/commandline.py:594
879 msgid "absolute_path"
880 msgstr ""
881
882 #. Used in usage help. Example:
883 #. tahoe://alias/some_dir
884-#: ../duplicity/commandline.py:452
885+#: ../duplicity/commandline.py:598
886 msgid "alias"
887 msgstr ""
888
889-#. Used in usage help (noun)
890-#: ../duplicity/commandline.py:455
891-msgid "backup name"
892-msgstr ""
893-
894 #. Used in help to represent a "bucket name" for Amazon Web
895 #. Services' Simple Storage Service (S3). Example:
896 #. s3://other.host/bucket_name[/prefix]
897-#: ../duplicity/commandline.py:460
898+#: ../duplicity/commandline.py:603
899 msgid "bucket_name"
900 msgstr ""
901
902-#. abbreviation for "character" (noun)
903-#: ../duplicity/commandline.py:463
904-msgid "char"
905-msgstr ""
906-
907-#. noun
908-#: ../duplicity/commandline.py:466
909-msgid "command"
910-msgstr ""
911-
912 #. Used in usage help to represent the name of a container in
913 #. Amazon Web Services' Cloudfront. Example:
914 #. cf+http://container_name
915-#: ../duplicity/commandline.py:471
916+#: ../duplicity/commandline.py:614
917 msgid "container_name"
918 msgstr ""
919
920 #. noun
921-#: ../duplicity/commandline.py:474
922+#: ../duplicity/commandline.py:617
923 msgid "count"
924 msgstr ""
925
926 #. Used in usage help to represent the name of a file directory
927-#: ../duplicity/commandline.py:477
928+#: ../duplicity/commandline.py:620
929 msgid "directory"
930 msgstr ""
931
932-#. Used in usage help to represent the name of a file. Example:
933-#. --log-file <filename>
934-#: ../duplicity/commandline.py:481
935-msgid "filename"
936-msgstr ""
937-
938-#. Used in usage help to represent an ID for a GnuPG key. Example:
939-#. --encrypt-key <gpg_key_id>
940-#: ../duplicity/commandline.py:485
941-msgid "gpg-key-id"
942-msgstr ""
943-
944 #. Used in usage help, e.g. to represent the name of a code
945 #. module. Example:
946 #. rsync://user[:password]@other.host[:port]::/module/some_dir
947-#: ../duplicity/commandline.py:490
948+#: ../duplicity/commandline.py:633
949 msgid "module"
950 msgstr ""
951
952-#. Used in usage help to represent a desired number of
953-#. something. Example:
954-#. --num-retries <number>
955-#: ../duplicity/commandline.py:495
956-msgid "number"
957-msgstr ""
958-
959-#. Used in usage help. (Should be consistent with the "Options:"
960-#. header.) Example:
961-#. duplicity [full|incremental] [options] source_dir target_url
962-#: ../duplicity/commandline.py:500
963-msgid "options"
964-msgstr ""
965-
966 #. Used in usage help to represent an internet hostname. Example:
967 #. ftp://user[:password]@other.host[:port]/some_dir
968-#: ../duplicity/commandline.py:504
969+#: ../duplicity/commandline.py:647
970 msgid "other.host"
971 msgstr ""
972
973 #. Used in usage help. Example:
974 #. ftp://user[:password]@other.host[:port]/some_dir
975-#: ../duplicity/commandline.py:508
976+#: ../duplicity/commandline.py:651
977 msgid "password"
978 msgstr ""
979
980-#. Used in usage help to represent a Unix-style path name. Example:
981-#. --archive-dir <path>
982-#: ../duplicity/commandline.py:512
983-msgid "path"
984-msgstr ""
985-
986 #. Used in usage help to represent a TCP port number. Example:
987 #. ftp://user[:password]@other.host[:port]/some_dir
988-#: ../duplicity/commandline.py:516
989+#: ../duplicity/commandline.py:659
990 msgid "port"
991 msgstr ""
992
993 #. Used in usage help. This represents a string to be used as a
994 #. prefix to names for backup files created by Duplicity. Example:
995 #. s3://other.host/bucket_name[/prefix]
996-#: ../duplicity/commandline.py:521
997+#: ../duplicity/commandline.py:664
998 msgid "prefix"
999 msgstr ""
1000
1001 #. Used in usage help to represent a Unix-style path name. Example:
1002 #. rsync://user[:password]@other.host[:port]/relative_path
1003-#: ../duplicity/commandline.py:525
1004+#: ../duplicity/commandline.py:668
1005 msgid "relative_path"
1006 msgstr ""
1007
1008-#. Used in usage help. Example:
1009-#. --timeout <seconds>
1010-#: ../duplicity/commandline.py:529
1011-msgid "seconds"
1012-msgstr ""
1013-
1014-#. Used in usage help to represent a "glob" style pattern for
1015-#. matching one or more files, as described in the documentation.
1016-#. Example:
1017-#. --exclude <shell_pattern>
1018-#: ../duplicity/commandline.py:535
1019-msgid "shell_pattern"
1020-msgstr ""
1021-
1022 #. Used in usage help to represent the name of a single file
1023 #. directory or a Unix-style path to a directory. Example:
1024 #. file:///some_dir
1025-#: ../duplicity/commandline.py:540
1026+#: ../duplicity/commandline.py:683
1027 msgid "some_dir"
1028 msgstr ""
1029
1030@@ -740,14 +773,14 @@
1031 #. directory or a Unix-style path to a directory where files will be
1032 #. coming FROM. Example:
1033 #. duplicity [full|incremental] [options] source_dir target_url
1034-#: ../duplicity/commandline.py:546
1035+#: ../duplicity/commandline.py:689
1036 msgid "source_dir"
1037 msgstr ""
1038
1039 #. Used in usage help to represent a URL files will be coming
1040 #. FROM. Example:
1041 #. duplicity [restore] [options] source_url target_dir
1042-#: ../duplicity/commandline.py:551
1043+#: ../duplicity/commandline.py:694
1044 msgid "source_url"
1045 msgstr ""
1046
1047@@ -755,97 +788,64 @@
1048 #. directory or a Unix-style path to a directory. where files will be
1049 #. going TO. Example:
1050 #. duplicity [restore] [options] source_url target_dir
1051-#: ../duplicity/commandline.py:557
1052+#: ../duplicity/commandline.py:700
1053 msgid "target_dir"
1054 msgstr ""
1055
1056 #. Used in usage help to represent a URL files will be going TO.
1057 #. Example:
1058 #. duplicity [full|incremental] [options] source_dir target_url
1059-#: ../duplicity/commandline.py:562
1060+#: ../duplicity/commandline.py:705
1061 msgid "target_url"
1062 msgstr ""
1063
1064-#. Used in usage help to represent a time spec for a previous
1065-#. point in time, as described in the documentation. Example:
1066-#. duplicity remove-older-than time [options] target_url
1067-#: ../duplicity/commandline.py:567
1068-msgid "time"
1069-msgstr ""
1070-
1071 #. Used in usage help to represent a user name (i.e. login).
1072 #. Example:
1073 #. ftp://user[:password]@other.host[:port]/some_dir
1074-#: ../duplicity/commandline.py:572
1075+#: ../duplicity/commandline.py:715
1076 msgid "user"
1077 msgstr ""
1078
1079-#: ../duplicity/commandline.py:574
1080-#, python-format
1081-msgid "duplicity version %s running on %s."
1082-msgstr ""
1083-
1084-#. Header in usage help
1085-#: ../duplicity/commandline.py:578
1086-msgid "Usage:"
1087-msgstr ""
1088-
1089-#. Header in usage help
1090-#: ../duplicity/commandline.py:591
1091+#. Header in usage help
1092+#: ../duplicity/commandline.py:731
1093 msgid "Backends and their URL formats:"
1094 msgstr ""
1095
1096 #. Header in usage help
1097-#: ../duplicity/commandline.py:611
1098+#: ../duplicity/commandline.py:751
1099 msgid "Commands:"
1100 msgstr ""
1101
1102-#. Header in usage help
1103-#: ../duplicity/commandline.py:625
1104-msgid "Options:"
1105-msgstr ""
1106-
1107-#. In this portion of the usage instructions, "[ewnid]" indicates which
1108-#. characters are permitted (e, w, n, i, or d); the brackets imply their own
1109-#. meaning in regex; i.e., only one of the characters is allowed in an instance.
1110-#: ../duplicity/commandline.py:680
1111-msgid ""
1112-" Verbosity must be one of: digit [0-9], character [ewnid],\n"
1113-" or word ['error', 'warning', 'notice', 'info', 'debug'].\n"
1114-" The default is 4 (Notice). It is strongly recommended\n"
1115-" that verbosity level is set at 2 (Warning) or higher.\n"
1116-msgstr ""
1117-
1118-#: ../duplicity/commandline.py:706
1119+#: ../duplicity/commandline.py:774
1120 #, python-format
1121 msgid "Specified archive directory '%s' does not exist, or is not a directory"
1122 msgstr ""
1123
1124-#: ../duplicity/commandline.py:715
1125+#: ../duplicity/commandline.py:783
1126 #, python-format
1127 msgid ""
1128 "Sign key should be an 8 character hex string, like 'AA0E73D2'.\n"
1129 "Received '%s' instead."
1130 msgstr ""
1131
1132-#: ../duplicity/commandline.py:773
1133+#: ../duplicity/commandline.py:841
1134 #, python-format
1135 msgid ""
1136 "Restore destination directory %s already exists.\n"
1137 "Will not overwrite."
1138 msgstr ""
1139
1140-#: ../duplicity/commandline.py:778
1141+#: ../duplicity/commandline.py:846
1142 #, python-format
1143 msgid "Verify directory %s does not exist"
1144 msgstr ""
1145
1146-#: ../duplicity/commandline.py:784
1147+#: ../duplicity/commandline.py:852
1148 #, python-format
1149 msgid "Backup source directory %s does not exist."
1150 msgstr ""
1151
1152-#: ../duplicity/commandline.py:859
1153+#: ../duplicity/commandline.py:927
1154 #, python-format
1155 msgid ""
1156 "Bad URL '%s'.\n"
1157@@ -853,7 +853,7 @@
1158 "\"file:///usr/local\". See the man page for more information."
1159 msgstr ""
1160
1161-#: ../duplicity/commandline.py:884
1162+#: ../duplicity/commandline.py:952
1163 msgid "Main action: "
1164 msgstr ""
1165

Subscribers

People subscribed via source and target branches

to all changes: