Exemple #1
0
    def validate_options(self):
        if not self.opts.remove_after:
            self.usage_error()

        self.opts.remove_after = _core.timestamp(self.opts.remove_after)

        if self.opts.remove_after.as_datetime() > datetime.now():
            raise AssertionError("--remove-after must be in the past.")
Exemple #2
0
    def validate_options(self):
        if not self.opts.remove_after:
            self.usage_error()

        self.opts.remove_after = _core.timestamp(self.opts.remove_after)

        if self.opts.remove_after.as_datetime() > datetime.now():
            raise AssertionError('--remove-after must be in the past.')
Exemple #3
0
 def as_timestamp(self, x):
     if isinstance(x, basestring):
         return _core.timestamp(x)
     return x