當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。