class infoLay(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, None) self.ean_edit = QtGui.QLineEdit() self.ean_edit.setDisabled(1) self.ean_edit.setMinimumWidth(70) self.ean_edit.setMaximumWidth(100) #Бла Бла бла еще много строчек кода
class infoLayMeta(type): def __init__(cls, name, bases, dict): super(infoLayMeta, cls).__init__(name, bases, dict) cls.instance = None def __call__(self,*args,**kw): if self.instance is None: self.instance = super(SingletonMeta, self).__call__(*args, **kw) return self.instance class infoLay(object): __metaclass__ = infoLayMeta def __init__(self): self.ean_edit = QtGui.QLineEdit() self.ean_edit.setDisabled(1) self.ean_edit.setMinimumWidth(70) self.ean_edit.setMaximumWidth(100) #Бла бла бла
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases