Don't getattr unless required in _visit_time_ranges
This commit is contained in:
parent
c9177e2338
commit
31a0f65a7e
@ -292,8 +292,6 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
|||||||
# recurrences too. This is not respected and client don't seem to bother
|
# recurrences too. This is not respected and client don't seem to bother
|
||||||
# either.
|
# either.
|
||||||
|
|
||||||
child = getattr(vobject_item, child_name.lower())
|
|
||||||
|
|
||||||
def getrruleset(child, ignore=()):
|
def getrruleset(child, ignore=()):
|
||||||
if (hasattr(child, "rrule") and
|
if (hasattr(child, "rrule") and
|
||||||
";UNTIL=" not in child.rrule.value.upper() and
|
";UNTIL=" not in child.rrule.value.upper() and
|
||||||
@ -506,12 +504,13 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
|||||||
if range_fn(dtstart, dtstart + DAY, is_recurrence):
|
if range_fn(dtstart, dtstart + DAY, is_recurrence):
|
||||||
return
|
return
|
||||||
|
|
||||||
elif isinstance(child, date):
|
else:
|
||||||
if range_fn(child, child + DAY, False):
|
# Match a property
|
||||||
return
|
child = getattr(vobject_item, child_name.lower())
|
||||||
|
if isinstance(child, date):
|
||||||
|
range_fn(child, child + DAY, False)
|
||||||
elif isinstance(child, datetime):
|
elif isinstance(child, datetime):
|
||||||
if range_fn(child, child + SECOND, False):
|
range_fn(child, child + SECOND, False)
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def _text_match(vobject_item, filter_, child_name, ns, attrib_name=None):
|
def _text_match(vobject_item, filter_, child_name, ns, attrib_name=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user