本文整理汇总了Python中OutputManager.OutputManager.listPrint方法的典型用法代码示例。如果您正苦于以下问题:Python OutputManager.listPrint方法的具体用法?Python OutputManager.listPrint怎么用?Python OutputManager.listPrint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputManager.OutputManager
的用法示例。
在下文中一共展示了OutputManager.listPrint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: searchInTitle
# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import listPrint [as 别名]
def searchInTitle(self, subString):
elementList = self._searchInTitleImpl(subString)
elementDict = {}
for elements in elementList:
id = elements[0]
elementDict[id] = elements
sorted(elementDict)
OutputManager.listPrint(elementDict, OutputManager.HEADER_FULL)
示例2: listNotesAndMeta
# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import listPrint [as 别名]
def listNotesAndMeta(self):
list = self._swiftManager.downloadObjectIds()
soDict = {}
sort = Configuration.entriessort
for element in list:
# exclude versions and deleted notes, that always begin with 'v'
if VersionManager.isVersionOrDeleted(element):
continue
id = SwiftManager.objIdToId(element)
if id is None:
raise RuntimeError(
"Can not get the ID from " +
element +
" ... should not happen, really")
metamngr = self._swiftManager.metaManagerFactory(element)
id = int(id)
crdate = metamngr.getCreateDate()
lastmod = metamngr.getLastModifiedDate()
tags = metamngr.getTags()
name = SwiftManager.objIdToTitle(element)
soDict[id] = [id, name, crdate, lastmod, tags]
if sort == "name":
soDict = OrderedDict(
sorted(
soDict.items(),
key=lambda k_v: k_v[1][1]))
elif sort == "crdate":
soDict = OrderedDict(
sorted(
soDict.items(),
key=lambda k_v1: datetime.strptime(
k_v1[1][2],
"%H:%M:%S, %d/%m/%Y").isoformat(),
reverse=True))
elif sort == "id":
sorted(soDict)
else:
soDict = OrderedDict(
sorted(
soDict.items(),
key=lambda k_v2: datetime.strptime(
k_v2[1][3],
"%H:%M:%S, %d/%m/%Y").isoformat(),
reverse=True))
OutputManager.listPrint(soDict, OutputManager.HEADER_FULL)
示例3: searchInTags
# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import listPrint [as 别名]
def searchInTags(self, substr):
'''
for every object in list check for tags
check if tags are the same
if tags in element meta
print element name
'''
elementList = self._searchInTagsImpl(substr)
dict = {}
for elements in elementList:
id = elements[0]
dict[id] = elements
sorted(dict)
OutputManager.listPrint(dict, OutputManager.HEADER_TAG)
示例4: printMeta
# 需要导入模块: from OutputManager import OutputManager [as 别名]
# 或者: from OutputManager.OutputManager import listPrint [as 别名]
def printMeta(self, metaId):
'''
prints the metadata of a single note
:param metaId:
:return:
'''
dict = {}
note = self.getNote(metaId)
mm = self.metaManagerFactory(note.getObjectId())
name = SwiftManager.objIdToTitle(note.getObjectId())
crDate = mm.getCreateDate()
lastmod = mm.getLastModifiedDate()
tags = mm.getTags()
dict[metaId] = [metaId, name, crDate, lastmod, tags]
sorted(dict)
OutputManager.listPrint(dict, OutputManager.HEADER_FULL)