本文整理汇总了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)))