@@ -291,24 +291,12 @@ class AfterTimepoint(TimeCondition):
291291
292292 Attributes:
293293 timepoint: The timepoint.
294- compare_fields: The fields to compare.
295- Fields: "year", "month", "day", "hour", "minute", "second"
296294 """
297295
298296 timepoint : datetime
299- compare_fields : T .Optional [T .List [str ]] = None
300297
301298 def satisfy (self , _ ) -> bool :
302- if self .compare_fields is None :
303- return datetime .now () > self .timepoint
304- else :
305- for field in self .compare_fields :
306- if field not in _valid_timepoint_fields :
307- raise ValueError (f"Invalid field: { field } " )
308- if getattr (datetime .now (), field ) >= \
309- getattr (self .timepoint , field ):
310- return False
311- return True
299+ return datetime .now () > self .timepoint
312300
313301
314302@dataclass
@@ -317,20 +305,8 @@ class BeforeTimepoint(TimeCondition):
317305
318306 Attributes:
319307 timepoint: The timepoint.
320- compare_fields: The fields to compare.
321- Fields: "year", "month", "day", "hour", "minute", "second"
322308 """
323309 timepoint : datetime
324- compare_fields : T .Optional [T .List [str ]] = None
325310
326311 def satisfy (self , _ ) -> bool :
327- if self .compare_fields is None :
328- return datetime .now () < self .timepoint
329- else :
330- for field in self .compare_fields :
331- if field not in _valid_timepoint_fields :
332- raise ValueError (f"Invalid field: { field } " )
333- if getattr (datetime .now (), field ) <= \
334- getattr (self .timepoint , field ):
335- return False
336- return True
312+ return datetime .now () < self .timepoint
0 commit comments