Merge lp:~nguyenqmai/duplicity/file-prefix-option into lp:duplicity/0.6

Proposed by Kenneth Loafman
Status: Merged
Merged at revision: 827
Proposed branch: lp:~nguyenqmai/duplicity/file-prefix-option
Merge into: lp:duplicity/0.6
Diff against target: 166 lines (+48/-12)
4 files modified
bin/duplicity (+3/-0)
duplicity/commandline.py (+3/-0)
duplicity/file_naming.py (+39/-12)
duplicity/globals.py (+3/-0)
To merge this branch: bzr merge lp:~nguyenqmai/duplicity/file-prefix-option
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+91585@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/duplicity'
--- bin/duplicity 2011-12-21 10:19:28 +0000
+++ bin/duplicity 2012-02-05 18:10:31 +0000
@@ -1221,6 +1221,9 @@
1221 # determine what action we're performing and process command line1221 # determine what action we're performing and process command line
1222 action = commandline.ProcessCommandLine(sys.argv[1:])1222 action = commandline.ProcessCommandLine(sys.argv[1:])
12231223
1224 # update the regex with provided file-prefix
1225 file_naming.prepare_regex()
1226
1224 # The following is for starting remote debugging in Eclipse with Pydev.1227 # The following is for starting remote debugging in Eclipse with Pydev.
1225 # Adjust the path to your location and version of Eclipse and Pydev.1228 # Adjust the path to your location and version of Eclipse and Pydev.
1226 if globals.pydevd:1229 if globals.pydevd:
12271230
=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2011-12-21 10:31:20 +0000
+++ duplicity/commandline.py 2012-02-05 18:10:31 +0000
@@ -321,6 +321,9 @@
321 parser.add_option("--fail-on-volume", type="int",321 parser.add_option("--fail-on-volume", type="int",
322 help=optparse.SUPPRESS_HELP)322 help=optparse.SUPPRESS_HELP)
323323
324 # used to provide a prefix on top of the defaul tar file name
325 parser.add_option("--file-prefix", type="string", dest="file_prefix", action="store")
326
324 # used in testing only - skips upload for a given volume327 # used in testing only - skips upload for a given volume
325 parser.add_option("--skip-volume", type="int",328 parser.add_option("--skip-volume", type="int",
326 help=optparse.SUPPRESS_HELP)329 help=optparse.SUPPRESS_HELP)
327330
=== modified file 'duplicity/file_naming.py'
--- duplicity/file_naming.py 2010-07-22 19:15:11 +0000
+++ duplicity/file_naming.py 2012-02-05 18:10:31 +0000
@@ -25,47 +25,74 @@
25from duplicity import dup_time25from duplicity import dup_time
26from duplicity import globals26from duplicity import globals
2727
28full_vol_re = re.compile("^duplicity-full"28full_vol_re = None
29full_vol_re_short = None
30full_manifest_re = None
31full_manifest_re_short = None
32inc_vol_re = None
33inc_vol_re_short = None
34inc_manifest_re = None
35inc_manifest_re_short = None
36full_sig_re = None
37full_sig_re_short = None
38new_sig_re = None
39new_sig_re_short = None
40
41def prepare_regex():
42 global full_vol_re
43 global full_vol_re_short
44 global full_manifest_re
45 global full_manifest_re_short
46 global inc_vol_re
47 global inc_vol_re_short
48 global inc_manifest_re
49 global inc_manifest_re_short
50 global full_sig_re
51 global full_sig_re_short
52 global new_sig_re
53 global new_sig_re_short
54
55 full_vol_re = re.compile("^" + globals.file_prefix + "duplicity-full"
29 "\\.(?P<time>.*?)"56 "\\.(?P<time>.*?)"
30 "\\.vol(?P<num>[0-9]+)"57 "\\.vol(?P<num>[0-9]+)"
31 "\\.difftar"58 "\\.difftar"
32 "(?P<partial>(\\.part))?"59 "(?P<partial>(\\.part))?"
33 "($|\\.)")60 "($|\\.)")
3461
35full_vol_re_short = re.compile("^df"62 full_vol_re_short = re.compile("^" + globals.file_prefix + "df"
36 "\\.(?P<time>[0-9a-z]+?)"63 "\\.(?P<time>[0-9a-z]+?)"
37 "\\.(?P<num>[0-9a-z]+)"64 "\\.(?P<num>[0-9a-z]+)"
38 "\\.dt"65 "\\.dt"
39 "(?P<partial>(\\.p))?"66 "(?P<partial>(\\.p))?"
40 "($|\\.)")67 "($|\\.)")
4168
42full_manifest_re = re.compile("^duplicity-full"69 full_manifest_re = re.compile("^" + globals.file_prefix + "duplicity-full"
43 "\\.(?P<time>.*?)"70 "\\.(?P<time>.*?)"
44 "\\.manifest"71 "\\.manifest"
45 "(?P<partial>(\\.part))?"72 "(?P<partial>(\\.part))?"
46 "($|\\.)")73 "($|\\.)")
4774
48full_manifest_re_short = re.compile("^df"75 full_manifest_re_short = re.compile("^" + globals.file_prefix + "df"
49 "\\.(?P<time>[0-9a-z]+?)"76 "\\.(?P<time>[0-9a-z]+?)"
50 "\\.m"77 "\\.m"
51 "(?P<partial>(\\.p))?"78 "(?P<partial>(\\.p))?"
52 "($|\\.)")79 "($|\\.)")
5380
54inc_vol_re = re.compile("^duplicity-inc"81 inc_vol_re = re.compile("^" + globals.file_prefix + "duplicity-inc"
55 "\\.(?P<start_time>.*?)"82 "\\.(?P<start_time>.*?)"
56 "\\.to\\.(?P<end_time>.*?)"83 "\\.to\\.(?P<end_time>.*?)"
57 "\\.vol(?P<num>[0-9]+)"84 "\\.vol(?P<num>[0-9]+)"
58 "\\.difftar"85 "\\.difftar"
59 "($|\\.)")86 "($|\\.)")
6087
61inc_vol_re_short = re.compile("^di"88 inc_vol_re_short = re.compile("^" + globals.file_prefix + "di"
62 "\\.(?P<start_time>[0-9a-z]+?)"89 "\\.(?P<start_time>[0-9a-z]+?)"
63 "\\.(?P<end_time>[0-9a-z]+?)"90 "\\.(?P<end_time>[0-9a-z]+?)"
64 "\\.(?P<num>[0-9a-z]+)"91 "\\.(?P<num>[0-9a-z]+)"
65 "\\.dt"92 "\\.dt"
66 "($|\\.)")93 "($|\\.)")
6794
68inc_manifest_re = re.compile("^duplicity-inc"95 inc_manifest_re = re.compile("^" + globals.file_prefix + "duplicity-inc"
69 "\\.(?P<start_time>.*?)"96 "\\.(?P<start_time>.*?)"
70 "\\.to"97 "\\.to"
71 "\\.(?P<end_time>.*?)"98 "\\.(?P<end_time>.*?)"
@@ -73,26 +100,26 @@
73 "(?P<partial>(\\.part))?"100 "(?P<partial>(\\.part))?"
74 "(\\.|$)")101 "(\\.|$)")
75102
76inc_manifest_re_short = re.compile("^di"103 inc_manifest_re_short = re.compile("^" + globals.file_prefix + "di"
77 "\\.(?P<start_time>[0-9a-z]+?)"104 "\\.(?P<start_time>[0-9a-z]+?)"
78 "\\.(?P<end_time>[0-9a-z]+?)"105 "\\.(?P<end_time>[0-9a-z]+?)"
79 "\\.m"106 "\\.m"
80 "(?P<partial>(\\.p))?"107 "(?P<partial>(\\.p))?"
81 "(\\.|$)")108 "(\\.|$)")
82109
83full_sig_re = re.compile("^duplicity-full-signatures"110 full_sig_re = re.compile("^" + globals.file_prefix + "duplicity-full-signatures"
84 "\\.(?P<time>.*?)"111 "\\.(?P<time>.*?)"
85 "\\.sigtar"112 "\\.sigtar"
86 "(?P<partial>(\\.part))?"113 "(?P<partial>(\\.part))?"
87 "(\\.|$)")114 "(\\.|$)")
88115
89full_sig_re_short = re.compile("^dfs"116 full_sig_re_short = re.compile("^" + globals.file_prefix + "dfs"
90 "\\.(?P<time>[0-9a-z]+?)"117 "\\.(?P<time>[0-9a-z]+?)"
91 "\\.st"118 "\\.st"
92 "(?P<partial>(\\.p))?"119 "(?P<partial>(\\.p))?"
93 "(\\.|$)")120 "(\\.|$)")
94121
95new_sig_re = re.compile("^duplicity-new-signatures"122 new_sig_re = re.compile("^" + globals.file_prefix + "duplicity-new-signatures"
96 "\\.(?P<start_time>.*?)"123 "\\.(?P<start_time>.*?)"
97 "\\.to"124 "\\.to"
98 "\\.(?P<end_time>.*?)"125 "\\.(?P<end_time>.*?)"
@@ -100,7 +127,7 @@
100 "(?P<partial>(\\.part))?"127 "(?P<partial>(\\.part))?"
101 "(\\.|$)")128 "(\\.|$)")
102129
103new_sig_re_short = re.compile("^dns"130 new_sig_re_short = re.compile("^" + globals.file_prefix + "dns"
104 "\\.(?P<start_time>[0-9a-z]+?)"131 "\\.(?P<start_time>[0-9a-z]+?)"
105 "\\.(?P<end_time>[0-9a-z]+?)"132 "\\.(?P<end_time>[0-9a-z]+?)"
106 "\\.st"133 "\\.st"
107134
=== modified file 'duplicity/globals.py'
--- duplicity/globals.py 2011-12-21 10:19:28 +0000
+++ duplicity/globals.py 2012-02-05 18:10:31 +0000
@@ -26,6 +26,9 @@
26# The current version of duplicity26# The current version of duplicity
27version = "$version"27version = "$version"
2828
29# Default file_prefix value
30file_prefix = ""
31
29# The name of the current host, or None if it cannot be set32# The name of the current host, or None if it cannot be set
30hostname = socket.getfqdn()33hostname = socket.getfqdn()
3134

Subscribers

People subscribed via source and target branches