~ed.so/duplicity/0.6-ssh_config

« back to all changes in this revision

Viewing changes to duplicity/file_naming.py

  • Committer: Kenneth Loafman
  • Date: 2012-02-05 18:13:40 UTC
  • mfrom: (820.4.1 file-prefix-option)
  • Revision ID: kenneth@loafman.com-20120205181340-5y8bvp7kwcd4h0rb
Merged in lp:~nguyenqmai/duplicity/file-prefix-option.

Adding --file-prefix option so different sets of backups can be stored in the same bucket.  See blueprint at https://blueprints.launchpad.net/duplicity/+spec/file-prefix-option

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from duplicity import dup_time
26
26
from duplicity import globals
27
27
 
28
 
full_vol_re = re.compile("^duplicity-full"
 
28
full_vol_re = None
 
29
full_vol_re_short = None
 
30
full_manifest_re = None
 
31
full_manifest_re_short = None
 
32
inc_vol_re = None
 
33
inc_vol_re_short = None
 
34
inc_manifest_re = None
 
35
inc_manifest_re_short = None
 
36
full_sig_re = None
 
37
full_sig_re_short = None
 
38
new_sig_re = None
 
39
new_sig_re_short = None
 
40
 
 
41
def 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
56
                         "\\.(?P<time>.*?)"
30
57
                         "\\.vol(?P<num>[0-9]+)"
31
58
                         "\\.difftar"
32
59
                         "(?P<partial>(\\.part))?"
33
60
                         "($|\\.)")
34
61
 
35
 
full_vol_re_short = re.compile("^df"
 
62
    full_vol_re_short = re.compile("^" + globals.file_prefix + "df"
36
63
                               "\\.(?P<time>[0-9a-z]+?)"
37
64
                               "\\.(?P<num>[0-9a-z]+)"
38
65
                               "\\.dt"
39
66
                               "(?P<partial>(\\.p))?"
40
67
                               "($|\\.)")
41
68
 
42
 
full_manifest_re = re.compile("^duplicity-full"
 
69
    full_manifest_re = re.compile("^" + globals.file_prefix + "duplicity-full"
43
70
                              "\\.(?P<time>.*?)"
44
71
                              "\\.manifest"
45
72
                              "(?P<partial>(\\.part))?"
46
73
                              "($|\\.)")
47
74
 
48
 
full_manifest_re_short = re.compile("^df"
 
75
    full_manifest_re_short = re.compile("^" + globals.file_prefix + "df"
49
76
                                    "\\.(?P<time>[0-9a-z]+?)"
50
77
                                    "\\.m"
51
78
                                    "(?P<partial>(\\.p))?"
52
79
                                    "($|\\.)")
53
80
 
54
 
inc_vol_re = re.compile("^duplicity-inc"
 
81
    inc_vol_re = re.compile("^" + globals.file_prefix + "duplicity-inc"
55
82
                        "\\.(?P<start_time>.*?)"
56
83
                        "\\.to\\.(?P<end_time>.*?)"
57
84
                        "\\.vol(?P<num>[0-9]+)"
58
85
                        "\\.difftar"
59
86
                        "($|\\.)")
60
87
 
61
 
inc_vol_re_short = re.compile("^di"
 
88
    inc_vol_re_short = re.compile("^" + globals.file_prefix + "di"
62
89
                              "\\.(?P<start_time>[0-9a-z]+?)"
63
90
                              "\\.(?P<end_time>[0-9a-z]+?)"
64
91
                              "\\.(?P<num>[0-9a-z]+)"
65
92
                              "\\.dt"
66
93
                              "($|\\.)")
67
94
 
68
 
inc_manifest_re = re.compile("^duplicity-inc"
 
95
    inc_manifest_re = re.compile("^" + globals.file_prefix + "duplicity-inc"
69
96
                             "\\.(?P<start_time>.*?)"
70
97
                             "\\.to"
71
98
                             "\\.(?P<end_time>.*?)"
73
100
                             "(?P<partial>(\\.part))?"
74
101
                             "(\\.|$)")
75
102
 
76
 
inc_manifest_re_short = re.compile("^di"
 
103
    inc_manifest_re_short = re.compile("^" + globals.file_prefix + "di"
77
104
                                   "\\.(?P<start_time>[0-9a-z]+?)"
78
105
                                   "\\.(?P<end_time>[0-9a-z]+?)"
79
106
                                   "\\.m"
80
107
                                   "(?P<partial>(\\.p))?"
81
108
                                   "(\\.|$)")
82
109
 
83
 
full_sig_re = re.compile("^duplicity-full-signatures"
 
110
    full_sig_re = re.compile("^" + globals.file_prefix + "duplicity-full-signatures"
84
111
                         "\\.(?P<time>.*?)"
85
112
                         "\\.sigtar"
86
113
                         "(?P<partial>(\\.part))?"
87
114
                         "(\\.|$)")
88
115
 
89
 
full_sig_re_short = re.compile("^dfs"
 
116
    full_sig_re_short = re.compile("^" + globals.file_prefix + "dfs"
90
117
                               "\\.(?P<time>[0-9a-z]+?)"
91
118
                               "\\.st"
92
119
                               "(?P<partial>(\\.p))?"
93
120
                               "(\\.|$)")
94
121
 
95
 
new_sig_re = re.compile("^duplicity-new-signatures"
 
122
    new_sig_re = re.compile("^" + globals.file_prefix + "duplicity-new-signatures"
96
123
                        "\\.(?P<start_time>.*?)"
97
124
                        "\\.to"
98
125
                        "\\.(?P<end_time>.*?)"
100
127
                        "(?P<partial>(\\.part))?"
101
128
                        "(\\.|$)")
102
129
 
103
 
new_sig_re_short = re.compile("^dns"
 
130
    new_sig_re_short = re.compile("^" + globals.file_prefix + "dns"
104
131
                              "\\.(?P<start_time>[0-9a-z]+?)"
105
132
                              "\\.(?P<end_time>[0-9a-z]+?)"
106
133
                              "\\.st"