def on_but_mask_editor (self): logger.debug('onLogger', self.name) self.setStatus(1, 'Work with mask editor... DO NOT FORGET TO SAVE MASK!!!') mfname = self.fname_roi_mask_img.value() try : if cp.maskeditor is not None and not os.path.exists(mfname) : msg = 'File %s was not saved!\nContinue anyway?' % os.path.basename(mfname) logger.warning(msg, __name__) status = gu.confirm_or_cancel_dialog_box(parent=self, text=msg, title='Confirm or cancel') if not status : return self.disconnect(cp.maskeditor, QtCore.SIGNAL('MaskEditorWindowIsClosed()'), self.on_mask_editor_window_is_closed) cp.maskeditor.close() del cp.maskeditor cp.maskeditor = None self.but_mask_editor.setStyleSheet(cp.styleButtonLeft) self.but_mask_editor.setText(' 4. Open Mask Editor') except : self.but_mask_editor.setStyleSheet(cp.styleButtonGood) self.but_mask_editor.setText('Close Mask Editor') self.openFileWithImageArray() pars = self.dictOfMaskEditorPars () cp.maskeditor = MaskEditor(**pars) cp.maskeditor.move(self.pos().__add__(QtCore.QPoint(820,-7))) # open window with offset w.r.t. parent cp.maskeditor.show() self.connect(cp.maskeditor, QtCore.SIGNAL('MaskEditorWindowIsClosed()'), self.on_mask_editor_window_is_closed) self.setStatus(0)
def on_but_mask_editor(self): logger.debug('onLogger', self.name) self.setStatus( 1, 'Work with mask editor... DO NOT FORGET TO SAVE MASK!!!') mfname = self.fname_roi_mask_img.value() try: if cp.maskeditor is not None and not os.path.exists(mfname): msg = 'File %s was not saved!\nContinue anyway?' % os.path.basename( mfname) logger.warning(msg, __name__) status = gu.confirm_or_cancel_dialog_box( parent=self, text=msg, title='Confirm or cancel') if not status: return cp.maskeditor.close() del cp.maskeditor cp.maskeditor = None self.but_mask_editor.setStyleSheet(cp.styleButtonLeft) self.but_mask_editor.setText(' 4. Open Mask Editor') except: self.but_mask_editor.setStyleSheet(cp.styleButtonGood) self.but_mask_editor.setText('Close Mask Editor') self.openFileWithImageArray() pars = self.dictOfMaskEditorPars() cp.maskeditor = MaskEditor(**pars) cp.maskeditor.move(self.pos().__add__(QtCore.QPoint( 820, -7))) # open window with offset w.r.t. parent cp.maskeditor.show() self.setStatus(0)
def closeEvent(self, event): logger.debug('closeEvent', self.name) try: cp.maskeditor.close() except: pass cp.guiroimask = None
def closeEvent(self, event): logger.debug('closeEvent', self.name) #try : cp.guimain.close() #except : pass try : cp.guifilebrowser.close() except : pass try : cp.plotimgspe.close() except : pass cp.guialignment = None
def closeEvent(self, event): logger.debug('closeEvent', self.name) #try : cp.guimain.close() #except : pass #try : del cp.guimain #except : pass try : cp.maskeditor.close() except : pass try : cp.plotimgspe.close() except : pass cp.guimaskeditor = None
def test_log(): # set level: 'debug','info','warning','error','critical' log.setLevel('warning') # print messages of all levels: 1,2,4,8,16 for 'debug','info',... log.setPrintBits(0377) log.debug('This is a test message 1', __name__) log.info('This is a test message 2', __name__) log.warning('This is a test message 3', __name__) log.error('This is a test message 4', __name__) log.critical('This is a test message 5', __name__) log.critical('This is a test message 6') print 'getLogContent():\n', log.getLogContent() print 'getLogContentTotal():\n', log.getLogContentTotal()
def closeEvent(self, event): logger.debug('closeEvent', self.name) #try : cp.guimain.close() #except : pass #try : del cp.guimain #except : pass try: cp.maskeditor.close() except: pass try: cp.plotimgspe.close() except: pass cp.guimaskeditor = None
def onExit(self): logger.debug('onExit', self.name) self.close()