4 from functools
import total_ordering
5 from PyCool
import cool
10 def __init__(self, run=None, lb=None, timerunlb=None,timebased=False):
11 if isinstance(run,IOVTime):
22 if timerunlb
is not None:
23 self.
run = timerunlb>>32
24 self.
lb = timerunlb&0xFFFFFFFF
32 return "%s" % time.strftime(
"%a %b %d %Y %X",time.gmtime(self.
time/1E9))
36 return "%i/%i" % (self.
run,self.
lb)
40 return self.
time<other.time
42 return self.
run<other.run
or self.
run==other.run
and self.
lb<other.lb
46 return self.
time==other.time
48 return self.
run==other.run
and self.
lb==other.lb
51 if isinstance(other, int):
53 elif isinstance(other, IOVTime):
65 return iovrange.isInRange(self)
68 def __init__(self, obj=None, starttime=None, endtime=None, runStart=None, lbStart=None, runEnd=None, lbEnd=None, timebased=False):
69 if isinstance(obj, cool.IObject):
72 elif isinstance(obj, IOVRange):
75 elif isinstance(starttime, IOVTime)
and isinstance(endtime, IOVTime):
78 elif isinstance(starttime,int)
and isinstance(endtime,int):
81 elif runStart
is not None and lbStart
is not None and runEnd
is not None and lbEnd
is not None:
85 print (
"IOVRange.__init__: Can't interpret arguments")
103 return (self.
startTime == other.startTime)
106 return (self.
startTime < other.startTime)