本文整理匯總了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))
)
示例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)))
示例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)
示例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)))