當前位置: 首頁>>代碼示例>>Python>>正文


Python IconsCollection.getGroups方法代碼示例

本文整理匯總了Python中outwiker.core.iconscollection.IconsCollection.getGroups方法的典型用法代碼示例。如果您正苦於以下問題:Python IconsCollection.getGroups方法的具體用法?Python IconsCollection.getGroups怎麽用?Python IconsCollection.getGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在outwiker.core.iconscollection.IconsCollection的用法示例。


在下文中一共展示了IconsCollection.getGroups方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testRenameGroup_03_self

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRenameGroup_03_self(self):
        os.mkdir(self.tempDir1)

        collection = IconsCollection(self.tempDir1)
        collection.addGroup('Новая группа')

        collection.renameGroup('Новая группа', 'Новая группа')
        self.assertEqual(collection.getGroups(), ['Новая группа'])

        newcollection = IconsCollection(self.tempDir1)
        self.assertEqual(newcollection.getGroups(), ['Новая группа'])
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:13,代碼來源:test_iconscollection.py

示例2: testAddGroup_01

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testAddGroup_01(self):
        os.mkdir(self.tempDir1)

        collection = IconsCollection(self.tempDir1)
        self.assertEqual(collection.getGroups(), [])

        collection.addGroup('Новая группа')
        self.assertEqual(collection.getGroups(), ['Новая группа'])

        newcollection1 = IconsCollection(self.tempDir1)
        self.assertEqual(newcollection1.getGroups(), ['Новая группа'])
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:13,代碼來源:test_iconscollection.py

示例3: testAddGroup_03

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testAddGroup_03 (self):
        os.mkdir (self.tempDir1)

        collection = IconsCollection (self.tempDir1)
        self.assertEqual (collection.getGroups(), [])

        collection.addGroup (u'Новая группа')
        collection.addGroup (u'Вторая группа')
        self.assertEqual (collection.getGroups(), [u'Вторая группа', u'Новая группа'])

        newcollection = IconsCollection (self.tempDir1)
        self.assertEqual (newcollection.getGroups(), [u'Вторая группа', u'Новая группа'])
開發者ID:LihMeh,項目名稱:outwiker,代碼行數:14,代碼來源:iconscollection.py

示例4: testRemoveGroup_01

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRemoveGroup_01 (self):
        os.mkdir (self.tempDir1)

        collection = IconsCollection (self.tempDir1)
        collection.addGroup (u'Новая группа')
        collection.addGroup (u'Другая группа')

        collection.removeGroup (u'Новая группа')
        self.assertEqual (collection.getGroups(), [u'Другая группа'])

        newcollection1 = IconsCollection (self.tempDir1)
        self.assertEqual (newcollection1.getGroups(), [u'Другая группа'])
開發者ID:LihMeh,項目名稱:outwiker,代碼行數:14,代碼來源:iconscollection.py

示例5: testRenameGroup_01

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRenameGroup_01 (self):
        os.mkdir (self.tempDir1)

        collection = IconsCollection (self.tempDir1)
        collection.addGroup (u'Новая группа')
        self.assertEqual (collection.getGroups(), [u'Новая группа'])

        collection.renameGroup (u'Новая группа', u'Переименованная группа')
        self.assertEqual (collection.getGroups(), [u'Переименованная группа'])

        newcollection1 = IconsCollection (self.tempDir1)
        self.assertEqual (newcollection1.getGroups(), [u'Переименованная группа'])
開發者ID:LihMeh,項目名稱:outwiker,代碼行數:14,代碼來源:iconscollection.py

示例6: testRenameGroup_04_self

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRenameGroup_04_self(self):
        files = ['new.png', 'image_01.JPG']
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]
        os.mkdir(self.tempDir1)

        collection = IconsCollection(self.tempDir1)
        collection.addGroup('Новая группа')
        collection.addIcons('Новая группа', fullPaths)

        collection.renameGroup('Новая группа', 'Новая группа')
        self.assertEqual(collection.getGroups(), ['Новая группа'])
        self.assertEqual(len(collection.getIcons('Новая группа')), 2)

        newcollection = IconsCollection(self.tempDir1)
        self.assertEqual(newcollection.getGroups(), ['Новая группа'])
        self.assertEqual(len(newcollection.getIcons('Новая группа')), 2)
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:18,代碼來源:test_iconscollection.py

示例7: _getGroupsInfo

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def _getGroupsInfo(self):
        result = []

        for n, path in enumerate(getIconsDirList()):
            # First None is root directory
            collection = IconsCollection(path)
            for groupname in [None] + sorted(collection.getGroups(), key=self._localize):
                # Get group name
                if groupname is None:
                    title = _(u'Not in groups')
                else:
                    title = self._localize(groupname)

                iconslist = collection.getIcons(groupname)
                cover = collection.getCover(groupname)
                if cover is None:
                    cover = self._default_group_cover

                group_type = (IconsGroupInfo.TYPE_BUILTIN if n == 0
                              else IconsGroupInfo.TYPE_CUSTOM)

                result.append(IconsGroupInfo(iconslist,
                                             title,
                                             cover,
                                             group_type=group_type,
                                             sort_key=os.path.basename))

        self._addRecentIconsGroup(result)
        eventParam = IconsGroupsListInitParams(result)
        self._application.onIconsGroupsListInit(self._page, eventParam)

        return eventParam.groupsList
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:34,代碼來源:iconspanel.py

示例8: testGroups_02

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testGroups_02(self):
        collection = IconsCollection('../test/icons/Только группы')

        self.assertEqual(len(collection.getIcons(None)), 0)
        self.assertEqual(collection.getGroups(), ['Группа 3', 'Группа 4'])
        self.assertEqual(len(collection.getIcons('Группа 3')), 3)
        self.assertEqual(len(collection.getIcons('Группа 4')), 4)
        self.assertIsNone(collection.getCover(None))
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:10,代碼來源:test_iconscollection.py

示例9: testEmpty_02

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testEmpty_02(self):
        collection = IconsCollection('../test/icons/Без иконок')

        self.assertEqual(collection.getIcons(None), [])
        self.assertEqual(collection.getGroups(), [])
        self.assertRaises(KeyError, collection.getIcons, 'Группа')
        self.assertRaises(KeyError, collection.getCover, 'Группа')
        self.assertIsNone(collection.getCover(''))
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:10,代碼來源:test_iconscollection.py

示例10: testRemoveGroup_02

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRemoveGroup_02(self):
        os.mkdir(self.tempDir1)

        collection = IconsCollection(self.tempDir1)
        collection.addGroup('Новая группа')

        collection.removeGroup('Новая группа')
        self.assertEqual(collection.getGroups(), [])
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:10,代碼來源:test_iconscollection.py

示例11: testGroups_01

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testGroups_01 (self):
        collection = IconsCollection (u'../test/icons/Иконки и группы')

        self.assertEqual (len (collection.getIcons(None)), 4)
        self.assertEqual (collection.getGroups(), [u'Группа 1', u'Группа 2'])
        self.assertEqual (len (collection.getIcons (u'Группа 1')), 3)
        self.assertEqual (len (collection.getIcons (u'Группа 2')), 4)
        self.assertIsNone (collection.getCover(None))
        self.assertTrue (collection.getCover(u'Группа 1').endswith (u'__cover.png'))
        self.assertIsNone (collection.getCover(u'Группа 2'))
開發者ID:LihMeh,項目名稱:outwiker,代碼行數:12,代碼來源:iconscollection.py

示例12: testRemoveGroup_04

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testRemoveGroup_04 (self):
        files = [u'new.png', u'image_01.JPG']
        fullPaths = [os.path.join (self.imagesDir, fname) for fname in files]

        os.mkdir (self.tempDir1)

        collection = IconsCollection (self.tempDir1)
        collection.addGroup (u'Новая группа')
        collection.addIcons (u'Новая группа', fullPaths)

        collection.removeGroup (u'Новая группа')
        self.assertEqual (collection.getGroups(), [])
開發者ID:LihMeh,項目名稱:outwiker,代碼行數:14,代碼來源:iconscollection.py

示例13: testSingleRoot

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import getGroups [as 別名]
    def testSingleRoot(self):
        collection = IconsCollection('../test/icons/Без групп')

        self.assertEqual(len(collection.getIcons(None)), 4)
        self.assertEqual(collection.getGroups(), [])
        self.assertTrue(collection.getCover(None).endswith('__cover.png'))
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:8,代碼來源:test_iconscollection.py


注:本文中的outwiker.core.iconscollection.IconsCollection.getGroups方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。