예제 #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
파일: Coords.py 프로젝트: Moxikai/pubMunch
 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()