示例#1
0
文件: page.py 项目: HughP/nostaples
 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
文件: main.py 项目: HughP/nostaples
 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