From 0c10d47a904868df15c12c8ec5d435799a852cc3 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 5 Dec 2009 20:07:53 +0000 Subject: [PATCH] Added a == to match to check more exact matches svn: r13717 --- src/gen/lib/date.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 8d62ad416..0fe6a6c28 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -984,12 +984,16 @@ class Date(object): other_start, other_stop = other_date.get_start_stop_range() self_start, self_stop = self.get_start_stop_range() - if comparison in ["=", "=="]: + if comparison == "=": # If some overlap then match is True, otherwise False. return ((self_start <= other_start <= self_stop) or (self_start <= other_stop <= self_stop) or (other_start <= self_start <= other_stop) or (other_start <= self_stop <= other_stop)) + elif comparison == "==": + # If they match exactly on start and stop + return ((self_start == other_start) and + (other_stop == other_stop)) elif comparison == "<": # If any < any return self_start < other_stop