4 from __future__
import print_function
5 from functools
import total_ordering
6 from PyCool
import cool
11 def __init__(self, run=None, lb=None, timerunlb=None,timebased=False):
12 if isinstance(run,IOVTime):
23 if timerunlb
is not None:
24 self.
run = timerunlb>>32
25 self.
lb = timerunlb&0xFFFFFFFF
33 return "%s" % time.strftime(
"%a %b %d %Y %X",time.gmtime(self.
time/1E9))
37 return "%i/%i" % (self.
run,self.
lb)
41 return self.
time<other.time
43 return self.
run<other.run
or self.
run==other.run
and self.
lb<other.lb
47 return self.
time==other.time
49 return self.
run==other.run
and self.
lb==other.lb
52 if isinstance(other, int):
54 elif isinstance(other, IOVTime):
66 return iovrange.isInRange(self)
69 def __init__(self, obj=None, starttime=None, endtime=None, runStart=None, lbStart=None, runEnd=None, lbEnd=None, timebased=False):
70 if isinstance(obj, cool.IObject):
73 elif isinstance(obj, IOVRange):
76 elif isinstance(starttime, IOVTime)
and isinstance(endtime, IOVTime):
79 elif isinstance(starttime,int)
and isinstance(endtime,int):
82 elif runStart
is not None and lbStart
is not None and runEnd
is not None and lbEnd
is not None:
86 print (
"IOVRange.__init__: Can't interpret arguments")
104 return (self.
startTime == other.startTime)
107 return (self.
startTime < other.startTime)