本文整理汇总了Python中outwiker.core.pageuiddepot.PageUidDepot类的典型用法代码示例。如果您正苦于以下问题:Python PageUidDepot类的具体用法?Python PageUidDepot怎么用?Python PageUidDepot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageUidDepot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSaveLoad_02
def testSaveLoad_02 (self):
depot = PageUidDepot()
uid = depot.createUid (self.wikiroot[u"Страница 2/Страница 3/Страница 4"])
depot_new = PageUidDepot(self.wikiroot)
self.assertEqual (depot_new[uid].title, u"Страница 4")
示例2: testSaveLoad_01
def testSaveLoad_01(self):
depot = PageUidDepot()
uid = depot.createUid(self.wikiroot["Страница 1"])
depot_new = PageUidDepot(self.wikiroot)
self.assertEqual(depot_new[uid].title, "Страница 1")
示例3: testRemovePage
def testRemovePage(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
uid = depot.createUid(page)
page.remove()
self.assertEqual(depot[uid], None)
示例4: testChangeUid_09
def testChangeUid_09(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
new_uid = "АБЫРВАЛГ"
depot.changeUid(page, new_uid)
self.assertEqual(depot["абырвалг"].title, "Страница 3")
示例5: testReadOnly_02
def testReadOnly_02(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
depot.createUid(page)
page.readonly = True
depot.createUid(page)
示例6: testApplication_01
def testApplication_01(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
uid = depot.createUid(page)
Application.wikiroot = self.wikiroot
self.assertEqual(Application.pageUidDepot[uid].title, "Страница 3")
示例7: testChangeUid_04
def testChangeUid_04 (self):
depot = PageUidDepot()
page = self.wikiroot[u"Страница 2/Страница 3"]
new_uid = u"Абырвалг"
depot.changeUid (page, new_uid)
self.assertRaises (ValueError,
depot.changeUid, self.wikiroot[u"Страница 1"], u"")
示例8: testChangeUid_05
def testChangeUid_05(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
new_uid = "Абырвалг"
depot.changeUid(page, new_uid)
page.remove()
self.assertEqual(depot[new_uid], None)
示例9: testRenamePage
def testRenamePage(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
uid = depot.createUid(page)
page.title = "Новый заголовок"
self.assertEqual(depot[uid].title, "Новый заголовок")
depot_new = PageUidDepot(self.wikiroot)
self.assertEqual(depot_new[uid].title, "Новый заголовок")
示例10: testChangeUid_08
def testChangeUid_08(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
new_uid = "Абырвалг"
depot.changeUid(page, new_uid)
self.assertRaises(KeyError,
depot.changeUid,
self.wikiroot["Страница 1"],
"абырвалг")
示例11: testChangeUid_01
def testChangeUid_01(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
new_uid = "Абырвалг"
depot.changeUid(page, new_uid)
self.assertEqual(depot[new_uid].title, "Страница 3")
depot_new = PageUidDepot(self.wikiroot)
self.assertEqual(depot_new[new_uid].title, "Страница 3")
示例12: testMovePage
def testMovePage(self):
depot = PageUidDepot()
page = self.wikiroot["Страница 2/Страница 3"]
uid = depot.createUid(page)
page.moveTo(self.wikiroot)
self.assertEqual(depot[uid].title, "Страница 3")
depot_new = PageUidDepot(self.wikiroot)
self.assertEqual(depot_new[uid].title, "Страница 3")
self.assertEqual(depot_new[uid].parent, self.wikiroot)
示例13: testChangeUid_10
def testChangeUid_10(self):
depot = PageUidDepot()
new_uid = "Абырвалг"
depot.changeUid(self.wikiroot["Страница 2/Страница 3"], new_uid)
depot2 = PageUidDepot()
depot2.changeUid(self.wikiroot["Страница 2"], new_uid)
depot3 = PageUidDepot(self.wikiroot)
self.assertEqual(depot3[new_uid].title, "Страница 3")
示例14: testCreateUid_03
def testCreateUid_03(self):
depot = PageUidDepot()
uid = depot.createUid(self.wikiroot["Страница 1"])
self.assertEqual(depot[uid.upper()], self.wikiroot["Страница 1"])
示例15: testCreateUid_02
def testCreateUid_02(self):
depot = PageUidDepot()
uid = depot.createUid(self.wikiroot["Страница 1"])
uid_new = depot.createUid(self.wikiroot["Страница 1"])
self.assertEqual(uid, uid_new)