Code Repositories xandikos / upstream/0_git20170301
Properly compare time values. Jelmer Vernooń≥ 2 years ago
2 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 - standards compliant
1 - standards complete
2 - backed by git
3 * easily hackable/editable with standard tools (e.g. git/vim)
4 * version tracked
5 - unit tested
6565 for field in fields:
6666 old_value = old_component.get(field)
6767 new_value = new_component.get(field)
68 if old_value != new_value:
68 if (old_value.to_ical() if old_value else None) != (new_value.to_ical() if new_value else None):
6969 yield (field, old_value, new_value)
7070
7171
8282 return "calendar item"
8383
8484
85 DELTA_IGNORE_FIELDS = set(["LAST-MODIFIED", "SEQUENCE", "DTSTAMP", "PRODID", "CREATED"])
85 DELTA_IGNORE_FIELDS = set(["LAST-MODIFIED", "SEQUENCE", "DTSTAMP", "PRODID", "CREATED", "COMPLETED"])
8686
8787
8888 def describe_calendar_delta(old_cal, new_cal):
117117 yield "changed location of %s to %s" % (description, new_value)
118118 elif (old_component.name.upper() == "VTODO" and
119119 field.upper() == "PERCENT-COMPLETE"):
120 yield "%s marked as %d%% complete." % (
120 yield "%s marked as %d%% completed." % (
121121 description, new_value)
122122 else:
123123 yield "modified field %s in %s" % (field, description)