示例#1
0
 def __init__(self, r, g, b, h, s, v):
     """don't call directly use factory (from*) static methods, arguments are 0.0..1.0"""
     Immutable.__init__(self)
     self.__r = r
     self.__g = g
     self.__b = b
     self.__h = h
     self.__s = s
     self.__v = v
     self.mkImmutable()
示例#2
0
 def __init__(self, *args, **opts):
     """args are either one argument in the form chr:start-end, or
     chr, start, end. options are db="""
     Immutable.__init__(self)
     if len(args) == 1:
         self.__parse__(args[0])
     elif len(args) == 3:
         try:
             self.chr = args[0]
             self.start = int(args[1])
             self.end = int(args[2])
         except Exception, e:
             raise CoordsError("invalid coordinates: \"" + str(args) + "\": " + str(e))
示例#3
0
 def __init__(self, *args, **opts):
     """args are either one argument in the form chr:start-end, or
     chr, start, end. options are db="""
     Immutable.__init__(self)
     if len(args) == 1:
         self.__parse__(args[0])
     elif len(args) == 3:
         try:
             self.chr = args[0]
             self.start = int(args[1])
             self.end = int(args[2])
         except Exception, e:
             raise CoordsError("invalid coordinates: \"" + str(args) +
                               "\": " + str(e))
示例#4
0
 def X__setstate__(self, st):
     Immutable.__init__(self)
     (self.name, self.aliases, self.values, self.maxNumValue) = st
     for val in self.values:
         self.__dict__[val.name] = val
示例#5
0
 def __init__(self, val):
     Immutable.__init__(self)
     self.val = val
     self.mkImmutable()
示例#6
0
 def __init__(self, val=-1):
     Immutable.__init__(self)
     assert((val >= -1) and (val <= 2))
     self.val = val
     self.mkImmutable()
示例#7
0
 def __init__(self, start, end, val):
     Immutable.__init__(self)
     self.start = start
     self.end = end
     self.val = val
     self.mkImmutable()