本文整理汇总了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(), ['Новая группа'])
示例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(), ['Новая группа'])
示例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'Новая группа'])
示例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'Другая группа'])
示例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'Переименованная группа'])
示例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)
示例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
示例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))
示例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(''))
示例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(), [])
示例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'))
示例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(), [])
示例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'))