git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change the logic of clipping leases
[plcapi.git]
/
PLC
/
LeaseFilter.py
diff --git
a/PLC/LeaseFilter.py
b/PLC/LeaseFilter.py
index
4ed6c01
..
de340ea
100644
(file)
--- a/
PLC/LeaseFilter.py
+++ b/
PLC/LeaseFilter.py
@@
-64,10
+64,10
@@
class LeaseFilter(Filter):
# basic SQL utilities
@staticmethod
def sql_time_intersect(f1, u1, f2, u2):
# basic SQL utilities
@staticmethod
def sql_time_intersect(f1, u1, f2, u2):
- # either f2 is in [f1,u1
], or u2 is in [f1,u1], or f2<=f1<=
u1<=u2
+ # either f2 is in [f1,u1
[, or u2 is in ]f1,u1], or f2<=f1<
u1<=u2
return (
return (
- f"(({f1} <= {f2}) AND ({f2} <
=
{u1})) "
- f"OR (({f1} <
=
{u2}) AND ({u2} <= {u1})) "
+ f"(({f1} <= {f2}) AND ({f2} < {u1})) "
+ f"OR (({f1} < {u2}) AND ({u2} <= {u1})) "
f"OR (({f2}<={f1}) AND ({u1}<={u2}))")
@staticmethod
f"OR (({f2}<={f1}) AND ({u1}<={u2}))")
@staticmethod