當前位置: 首頁>>代碼示例>>Python>>正文


Python IconsCollection.renameGroup方法代碼示例

本文整理匯總了Python中outwiker.core.iconscollection.IconsCollection.renameGroup方法的典型用法代碼示例。如果您正苦於以下問題:Python IconsCollection.renameGroup方法的具體用法?Python IconsCollection.renameGroup怎麽用?Python IconsCollection.renameGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在outwiker.core.iconscollection.IconsCollection的用法示例。


在下文中一共展示了IconsCollection.renameGroup方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testRenameGroup_03_self

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import renameGroup [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

示例2: testRenameGroup_01

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import renameGroup [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

示例3: testRenameGroup_04_self

# 需要導入模塊: from outwiker.core.iconscollection import IconsCollection [as 別名]
# 或者: from outwiker.core.iconscollection.IconsCollection import renameGroup [as 別名]
    def testRenameGroup_04_self(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.renameGroup('Новая группа', 'Новая группа')
        self.assertEqual(collection.getGroups(), ['Новая группа'])
        self.assertEqual(len(collection.getIcons('Новая группа')), 2)

        newcollection = IconsCollection(self.tempDir1)
        self.assertEqual(newcollection.getGroups(), ['Новая группа'])
        self.assertEqual(len(newcollection.getIcons('Новая группа')), 2)
開發者ID:Jenyay,項目名稱:outwiker,代碼行數:18,代碼來源:test_iconscollection.py


注:本文中的outwiker.core.iconscollection.IconsCollection.renameGroup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。