def testObject(self): print o = Object() self.assertEquals(True, o.to_bool(True)) self.assertEquals(False, o.to_bool(False)) self.assertEquals(True, o.to_bool("True")) self.assertEquals(False, o.to_bool("False")) self.assertRaises(TypeError, o.to_bool, 42) self.assertRaises(TypeError, o.to_bool, "FOOBAR")
def __init__(self): Object.__init__(self) self.enabled = False self.container = None self.type = 'console' self.title = None # TODO: use preferences self.xmin = 0 self.xmax = 0 self.yminl = 0 self.ymaxl = 0 self.yminr = 0 self.ymaxr = 0 self.overlay = False
def __setattr__(self, name, value): if name in self.attrs: self.attrs[name]['value'] = value Object.__setattr__(self, name, value)
def __getattr__(self, name): return Object.__getattr__(self, name)
def __init__(self, *args, **kwargs): Object.__init__(self, *args, **kwargs) self.socket = None
def __init__(self): Object.__init__(self) self.__storage = { 'data': [] }