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


Python IconsCollection.addGroup方法代码示例

本文整理汇总了Python中outwiker.core.iconscollection.IconsCollection.addGroup方法的典型用法代码示例。如果您正苦于以下问题:Python IconsCollection.addGroup方法的具体用法?Python IconsCollection.addGroup怎么用?Python IconsCollection.addGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在outwiker.core.iconscollection.IconsCollection的用法示例。


在下文中一共展示了IconsCollection.addGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testAddCover_01_group

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddCover_01_group(self):
        files = []
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

        groupname = 'Новая группа'

        os.mkdir(self.tempDir1)
        collection = IconsCollection(self.tempDir1)
        collection.addGroup(groupname)
        collection.addIcons(groupname, fullPaths)

        coverpath = os.path.join(self.imagesDir, 'icon.png')

        newCoverPath = os.path.join(self.tempDir1,
                                    groupname,
                                    IconsCollection.COVER_FILE_NAME)

        collection.setCover(groupname, coverpath)
        self.assertTrue(os.path.exists(newCoverPath))
        self.assertEqual(os.path.abspath(newCoverPath),
                         os.path.abspath(collection.getCover(groupname)))

        collection.setCover(groupname, coverpath)
        self.assertTrue(os.path.exists(os.path.join(
            self.tempDir1,
            groupname,
            IconsCollection.COVER_FILE_NAME))
        )
开发者ID:Jenyay,项目名称:outwiker,代码行数:30,代码来源:test_iconscollection.py

示例2: testRemoveGroup_02

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例3: testAddIcons_02_empty

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddIcons_02_empty(self):
        files = []
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

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

        collection.addIcons('Новая группа', fullPaths)
        self.assertEqual(collection.getIcons('Новая группа'), [])
开发者ID:Jenyay,项目名称:outwiker,代码行数:12,代码来源:test_iconscollection.py

示例4: testAddGroup_01

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例5: testRenameGroup_03_self

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例6: testRenameGroup_01

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例7: testRemoveGroup_01

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例8: testRemoveGroup_04

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testRemoveGroup_04(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.removeGroup('Новая группа')
        self.assertEqual(collection.getGroups(), [])
开发者ID:Jenyay,项目名称:outwiker,代码行数:14,代码来源:test_iconscollection.py

示例9: testRenameGroup_04_invalid

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testRenameGroup_04_invalid(self):
        os.mkdir(self.tempDir1)

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

        self.assertRaises(
            DuplicateGroupError,
            collection.renameGroup,
            'Новая группа',
            'Абырвалг')
开发者ID:Jenyay,项目名称:outwiker,代码行数:14,代码来源:test_iconscollection.py

示例10: testAddGroup_03

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [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

示例11: testAddIcons_16_invalid

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddIcons_16_invalid(self):
        files = ['invalid.png']
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

        groupname = 'Новая группа'

        os.mkdir(self.tempDir1)
        collection = IconsCollection(self.tempDir1)
        collection.addGroup(groupname)

        collection.addIcons(groupname, fullPaths)

        icons = sorted(collection.getIcons(groupname))
        self.assertEqual(len(icons), 0)
开发者ID:Jenyay,项目名称:outwiker,代码行数:16,代码来源:test_iconscollection.py

示例12: testRemoveGroup_03_invalid

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testRemoveGroup_03_invalid(self):
        os.mkdir(self.tempDir1)

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

        self.assertRaises(
            KeyError,
            collection.removeGroup,
            'Абырвалг')

        self.assertRaises(
            KeyError,
            collection.removeGroup,
            '')
开发者ID:Jenyay,项目名称:outwiker,代码行数:17,代码来源:test_iconscollection.py

示例13: testAddIcons_13

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddIcons_13(self):
        files = ['__sample.png']
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

        groupname = 'Новая группа'

        os.mkdir(self.tempDir1)
        collection = IconsCollection(self.tempDir1)
        collection.addGroup(groupname)

        collection.addIcons(groupname, fullPaths)

        icons = sorted(collection.getIcons(groupname))
        self.assertEqual(len(icons), 1)
        self.assertNotIn('__sample.png', icons[0])
        self.assertIn('sample.png', icons[0])
开发者ID:Jenyay,项目名称:outwiker,代码行数:18,代码来源:test_iconscollection.py

示例14: testAddIcons_10_not_exists

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddIcons_10_not_exists(self):
        files = ['new.png', 'image_01.JPG', 'notexists.png']
        fullPaths = [os.path.join(self.imagesDir, fname) for fname in files]

        groupname = 'Новая группа'

        os.mkdir(self.tempDir1)
        collection = IconsCollection(self.tempDir1)
        collection.addGroup(groupname)

        collection.addIcons(groupname, fullPaths)

        icons = sorted(collection.getIcons(groupname))
        self.assertEqual(len(icons), 2)
        self.assertIn('image_01.png', icons[0])
        self.assertIn('new.png', icons[1])
开发者ID:Jenyay,项目名称:outwiker,代码行数:18,代码来源:test_iconscollection.py

示例15: testAddIcons_11

# 需要导入模块: from outwiker.core.iconscollection import IconsCollection [as 别名]
# 或者: from outwiker.core.iconscollection.IconsCollection import addGroup [as 别名]
    def testAddIcons_11 (self):
        files = [u'new.png', u'new.png']
        fullPaths = [os.path.join (self.imagesDir, fname) for fname in files]

        groupname = u'Новая группа'

        os.mkdir (self.tempDir1)
        collection = IconsCollection (self.tempDir1)
        collection.addGroup (groupname)

        collection.addIcons (groupname, fullPaths)

        icons = sorted (collection.getIcons (groupname))
        self.assertEqual (len (icons), 2)
        self.assertIn (u'new.png', icons[0])
        self.assertIn (u'new_(1).png', icons[1])
开发者ID:LihMeh,项目名称:outwiker,代码行数:18,代码来源:iconscollection.py


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