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


Python OutputManager.listPrint方法代码示例

本文整理汇总了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)
开发者ID:icclab,项目名称:powdernote,代码行数:10,代码来源:Powdernote_impl.py

示例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)
开发者ID:icclab,项目名称:powdernote,代码行数:53,代码来源:Powdernote_impl.py

示例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)
开发者ID:icclab,项目名称:powdernote,代码行数:17,代码来源:Powdernote_impl.py

示例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)
开发者ID:icclab,项目名称:powdernote,代码行数:19,代码来源:SwiftManager.py


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