Пример #1
0
 def __init__(self, application, pil_image=None, resolution=constants.DEFAULT_SCAN_RESOLUTION, page_size=constants.DEFAULT_PAGE_SIZE):
     """
     Constructs the PageModel.
     
     @type pil_image: a PIL image
     @param pil_image: The image data for this page.
     @type page_size: str
     @param page_size: The name of the page size this image should be saved
                         in.
     @type resolution: int
     @param resolution: The dpi that the page was scanned at.
     """
     self.application = application
     Model.__init__(self)
     
     self.log = logging.getLogger(self.__class__.__name__)
     
     self.resolution = resolution
     self.page_size = page_size
     
     if pil_image:
         self._raw_pil_image = pil_image
         self._update_pixbuf()
         self._update_thumbnail_pixbuf()
     
     self.register_observer(self)
     
     # TODO: Wtf am I doing here, solves a bug, but why?
     self.accepts_spurious_change = lambda : True
     
     self.log.debug('Created.')
Пример #2
0
 def __init__(self, application):
     """
     Constructs the PreferencesModel.
     """
     Model.__init__(self)
     self.application = application
     
     self.log = logging.getLogger(self.__class__.__name__)
     
     self.log.debug('Created.')
Пример #3
0
 def __init__(self, application):
     """
     Constructs the MainModel, as well as necessary sub-models.
     """
     self.application = application
     Model.__init__(self)
     
     self.log = logging.getLogger(self.__class__.__name__)
     
     self.log.debug('Created.')
Пример #4
0
 def __init__(self):
     Model.__init__(self)
     self.__observer_threads = {}
     self._prop_lock = _threading.Lock()
     return