Skip to content

Commit 9d97312

Browse files
committed
fixup! Allow to choose the Matcher from the command line
1 parent 17f4b2c commit 9d97312

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

rotate_backups/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,13 @@ def timestamp_pattern(self, value):
561561
set_property(self, 'matcher', FilenameMatcher(self.timestamp_pattern))
562562

563563
@mutable_property
564-
def unix_timestamp(self):
565-
return type(self.matcher) == TimestampMatcher
564+
def stat_timestamp(self):
565+
return type(self.matcher) == StatsMatcher
566566

567-
@unix_timestamp.setter
568-
def unix_timestamp(self, value):
567+
@stat_timestamp.setter
568+
def stat_timestamp(self, value):
569569
if value:
570-
set_property(self, 'matcher', TimestampMatcher())
570+
set_property(self, 'matcher', StatsMatcher())
571571
else:
572572
# Force re-setting the FilenameMatcher
573573
self.timestamp_pattern = self.timestamp_pattern

rotate_backups/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@
168168
readable and/or writable for the current user (or the user logged in to a
169169
remote system over SSH).
170170
171-
-U, --unix-timestamp
171+
-s, --stat-timestamp
172172
173-
Consider using mtime timestamps, instead of filenames, to determine the
173+
Use mtime stat timestamps, instead of filenames, to determine the
174174
date of each file.
175175
176176
-S, --syslog=CHOICE
@@ -250,7 +250,7 @@ def main():
250250
'minutely=', 'hourly=', 'daily=', 'weekly=', 'monthly=', 'yearly=',
251251
'timestamp-pattern=', 'include=', 'exclude=', 'parallel',
252252
'prefer-recent', 'relaxed', 'ionice=', 'config=',
253-
'removal-command=', 'use-sudo', 'unix-timestamp', 'syslog=',
253+
'removal-command=', 'use-sudo', 'stat-timestamp', 'syslog=',
254254
'force', 'dry-run', 'verbose', 'quiet', 'help',
255255
])
256256
for option, value in options:
@@ -289,8 +289,8 @@ def main():
289289
kw['removal_command'] = removal_command
290290
elif option in ('-u', '--use-sudo'):
291291
use_sudo = True
292-
elif option in ('-U', '--unix-timestamp'):
293-
kw['unix_timestamp'] = True
292+
elif option in ('-s', '--stat-timestamp'):
293+
kw['stat_timestamp'] = True
294294
elif option in ('-S', '--syslog'):
295295
use_syslog = coerce_boolean(value)
296296
elif option in ('-f', '--force'):

0 commit comments

Comments
 (0)