本文整理汇总了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"
示例2: _readNote
# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import markdownPrint [as 别名]
def _readNote(self, note):
OutputManager.markdownPrint(note.getTitle(), note.getContent())