Example #1
0
 def __get__(self, instance, type=None):
     # Under certain circumstances, PyQt will try and access these properties
     # while loading the ui file, so we have to be robust to failures.
     # However, we print out a warning if things fail.
     try:
         widget = reduce(getattr, [instance] + self._att)
         return self.getter(widget)
     except Exception:
         logger.info("An error occured when accessing attribute {0} of {1}. Returning None.".format('.'.join(self._att), instance))
         return None
Example #2
0
 def __get__(self, instance, type=None):
     # Under certain circumstances, PyQt will try and access these properties
     # while loading the ui file, so we have to be robust to failures.
     # However, we print out a warning if things fail.
     try:
         widget = reduce(getattr, [instance] + self._att)
         return self.getter(widget)
     except Exception:
         logger.info("An error occured when accessing attribute {0} of {1}. Returning None.".format('.'.join(self._att), instance))
         return None
Example #3
0
 def __set__(self, instance, value):
     widget = reduce(getattr, [instance] + self._att)
     self.setter(widget, value)
Example #4
0
 def __set__(self, instance, value):
     v = self.key.split('.')
     attr = reduce(getattr, [instance] + v[:-1])
     setattr(attr, v[-1], value)
Example #5
0
 def __set__(self, instance, value):
     widget = reduce(getattr, [instance] + self._att)
     self.setter(widget, value)
Example #6
0
 def __get__(self, instance, type=None):
     widget = reduce(getattr, [instance] + self._att)
     return self.getter(widget)
Example #7
0
 def __set__(self, instance, value):
     v = self.key.split('.')
     attr = reduce(getattr, [instance] + v[:-1])
     setattr(attr, v[-1], value)
Example #8
0
 def __get__(self, instance, type=None):
     widget = reduce(getattr, [instance] + self._att)
     return self.getter(widget)