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.")
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.')
def as_timestamp(self, x): if isinstance(x, basestring): return _core.timestamp(x) return x