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


Python IconsCollection.setCover方法代码示例

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


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

示例1: testAddCover_01_group

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

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

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

        collection.setCover (u'', coverpath)
        self.assertFalse (os.path.exists (os.path.join (self.tempDir1, IconsCollection.COVER_FILE_NAME)))
开发者ID:LihMeh,项目名称:outwiker,代码行数:10,代码来源:iconscollection.py

示例3: testAddCover_05_root

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

        coverpath = os.path.join (self.imagesDir, u'first.jpg')

        collection.setCover (None, coverpath)
        self.assertTrue (os.path.exists (os.path.join (self.tempDir1, IconsCollection.COVER_FILE_NAME)))

        self.assertEqual (self.__getMaxImageSize (os.path.join (
            self.tempDir1,
            IconsCollection.COVER_FILE_NAME)), 16)
开发者ID:LihMeh,项目名称:outwiker,代码行数:14,代码来源:iconscollection.py

示例4: testAddCover_03_root

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

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

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

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

        collection.setCover (u'', coverpath)
        self.assertTrue (os.path.exists (os.path.join (self.tempDir1, IconsCollection.COVER_FILE_NAME)))
开发者ID:LihMeh,项目名称:outwiker,代码行数:16,代码来源:iconscollection.py


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