当前位置: 首页>>代码示例>>Python>>正文


Python Note.remove_png方法代码示例

本文整理汇总了Python中note.Note.remove_png方法的典型用法代码示例。如果您正苦于以下问题:Python Note.remove_png方法的具体用法?Python Note.remove_png怎么用?Python Note.remove_png使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在note.Note的用法示例。


在下文中一共展示了Note.remove_png方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainWindow

# 需要导入模块: from note import Note [as 别名]
# 或者: from note.Note import remove_png [as 别名]

#.........这里部分代码省略.........
                    os.remove(path)

                zipf.close()
            self.statusBar().showMessage('Exported annotations to file %s.'
                                                                    % filename)

    def slot_change_note(self):
        """
        Slot to add or edit note. Replaces current note display in
        annotationSourceTextEdit and annotationWidget with the new note.
        """
        self.ui.annotationSourceDockWidget.show()
        self.ui.actionAnnotationSource.setChecked(True)
        uid = self.ui.documentWidget.ImgLabel.current_uid
        if (self.displayed_uid != -1 and self.displayed_uid != -2):
            text = unicode(self.ui.annotationSourceTextEdit.toPlainText())
            self.current_note.text = text
        self.current_note = self.ui.documentWidget.ImgLabel.notes[uid]
        self.ui.annotationSourceTextEdit.setText(self.current_note.text)
        self.ui.annotationSourceDockWidget.setWindowTitle('Note %d - Source'
                                                        % self.current_note.uid)
        self.ui.annotationDockWidget.setWindowTitle('Note %d - LaTeX'
                                                        % self.current_note.uid)
        self.slot_force_compile()

    def slot_remove_note(self):
        """
        Removes note along with all its files. If the  current note is being
        replaced, blank annotationSourceTextEdit and annotationWidget.
        """
        uid = self.ui.documentWidget.ImgLabel.closest_id
        #print 'Current note: %d' % self.ui.documentWidget.ImgLabel.current_uid
        self.ui.documentWidget.ImgLabel.notes[uid].remove_files()
        self.ui.documentWidget.ImgLabel.notes[uid].remove_png()
        #print 'Main remove note %d' % uid
        if self.ui.documentWidget.ImgLabel.current_uid == uid:
            self.ui.annotationSourceTextEdit.setText('')
            white_pix = QtGui.QPixmap()
            white_pix.fill()
            self.ui.annotationWidget.ImgLabel.setPixmap(white_pix)
            self.ui.documentWidget.ImgLabel.displayed_uid = -2
            self.ui.documentWidget.ImgLabel.current_uid = -2
            self.ui.annotationSourceDockWidget.setWindowTitle('')
            self.ui.annotationDockWidget.setWindowTitle('')
        del self.ui.documentWidget.ImgLabel.notes[uid]
        self.ui.documentWidget.update_image()

    def slot_hide_controls(self):
        """ Slot to hide controls properly and avoid recursion. """
        if self.ui.controlsWidget.isVisible():
            self.ui.actionControls.setChecked(True)
        if self.ui.annotationDockWidget.isHidden():
            self.ui.actionControls.setChecked(False)

    def slot_hide_annotation(self):
        """ Slot to hide annotation properly and avoid recursion. """
        if self.ui.annotationDockWidget.isVisible():
            self.ui.actionAnnotation.setChecked(True)
        if self.ui.annotationDockWidget.isHidden():
            self.ui.actionAnnotation.setChecked(False)

    def slot_hide_annotation_source(self):
        """ Slot to hide annotation source properly and avoid recursion. """
        if self.ui.annotationSourceDockWidget.isVisible():
            self.ui.actionAnnotationSource.setChecked(True)
        if self.ui.annotationSourceDockWidget.isHidden():
开发者ID:cako,项目名称:notorius,代码行数:70,代码来源:window.py


注:本文中的note.Note.remove_png方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。