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


Python OutputManager.markdownPrint方法代码示例

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


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

示例1: readVersion

# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import markdownPrint [as 别名]
    def readVersion(self, noteId):
        '''
        outputs the content of a note version
        :param noteId:
        :return:
        '''
        if self._swiftManager.doesNoteExist(noteId) == True:
            note, title, versions, noteList = self._versionMngr._getVersionInfo(
                noteId)

            # user input for id, if the input is not an integer the error
            # message will be displayed
            try:
                readingVersion = int(
                    raw_input("Which version do you wish to read (id)? >"))
            except (ValueError):
                print "invalid input"
                sys.exit(1)

            for key, value in versions.iteritems():
                self._keyList.append(key)
                if key == readingVersion:
                    versionTitle = versions[key][1]
                    # get the content of the object
                    content = noteList[versionTitle]
                    # create the note title, composing from "vTIMESTAMP-id -
                    # title"
                    noteTitle = versionTitle + \
                        OutputManager.ID_TITLE_SEPERATOR + title

                    OutputManager.markdownPrint(noteTitle, content)
                else:
                    continue
            # as an information for the user, that the version doesn't exist
            if readingVersion not in self._keyList:
                print str(readingVersion) + " doesn't exist"
        # as an information for the user, that the note doesn't exist
        else:
            print "Note #" + str(noteId) + " doesn't exist"
开发者ID:icclab,项目名称:powdernote,代码行数:41,代码来源:Powdernote_impl.py

示例2: _readNote

# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import markdownPrint [as 别名]
 def _readNote(self, note):
     OutputManager.markdownPrint(note.getTitle(), note.getContent())
开发者ID:icclab,项目名称:powdernote,代码行数:4,代码来源:Powdernote_impl.py


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