Total Complexity | 2 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 100% |
1 | 1 | from plugin.core.backup.constants import BACKUP_PATH |
|
9 | 1 | class BackupSource(object): |
|
10 | 1 | @staticmethod |
|
11 | 1 | def path(group, timestamp, tag=None): |
|
12 | # Build directory |
||
13 | 1 | directory = os.path.join( |
|
14 | BACKUP_PATH, |
||
15 | group + '.bgr', |
||
16 | str(timestamp.year), |
||
17 | '%02d' % timestamp.month |
||
18 | ) |
||
19 | |||
20 | # Build name |
||
21 | 1 | name = '%02d_%02d%02d%02d%s' % ( |
|
22 | timestamp.day, |
||
23 | timestamp.hour, |
||
24 | timestamp.minute, |
||
25 | timestamp.second, |
||
26 | ('_%s' % tag) if tag else '' |
||
27 | ) |
||
28 | |||
29 | return directory, name, os.path.join(directory, name) |
||
30 |