本文整理汇总了Python中outwiker.pages.wiki.wikipage.WikiPageFactory.create方法的典型用法代码示例。如果您正苦于以下问题:Python WikiPageFactory.create方法的具体用法?Python WikiPageFactory.create怎么用?Python WikiPageFactory.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类outwiker.pages.wiki.wikipage.WikiPageFactory
的用法示例。
在下文中一共展示了WikiPageFactory.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testPageCount2
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testPageCount2 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
treeStat = self.loader[self.__pluginname].getTreeStat (testPage)
self.assertEqual (treeStat.pageCount, 1)
示例2: testParseWithoutAttaches
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testParseWithoutAttaches (self):
pagetitle = u"Страница 666"
WikiPageFactory.create (self.rootwiki, pagetitle, [])
parser = Parser(self.rootwiki[pagetitle], Application.config)
parser.toHtml (u"Attach:bla-bla-bla")
示例3: testAttachmentsSizeWiki1
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testAttachmentsSizeWiki1 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
pageStat = self.loader[self.__pluginname].getPageStat (testPage)
self.assertEqual (pageStat.attachmentsSize, 0)
示例4: __createWiki
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def __createWiki (self):
# Здесь будет создаваться вики
self.path = u"../test/testwiki"
removeWiki (self.path)
self.rootwiki = WikiDocument.create (self.path)
WikiPageFactory.create (self.rootwiki, u"Страница 2", [])
示例5: createNewWiki
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def createNewWiki (parentwnd):
"""
Создать новую вики
parentwnd - окно-владелец диалога выбора файла
"""
dlg = wx.FileDialog (parentwnd, style = wx.FD_SAVE)
newPageTitle = _(u"First Wiki Page")
newPageContent = _(u"""!! First Wiki Page
This is the first page. You can use a text formating: '''bold''', ''italic'', {+underlined text+}, [[http://jenyay.net | link]] and others.
""")
if dlg.ShowModal() == wx.ID_OK:
try:
from outwiker.pages.wiki.wikipage import WikiPageFactory
newwiki = WikiDocument.create (dlg.GetPath ())
WikiPageFactory.create (newwiki, newPageTitle, [_(u"test")])
firstPage = newwiki[newPageTitle]
firstPage.content = newPageContent
Application.wikiroot = newwiki
Application.wikiroot.selectedPage = firstPage
except (IOError, OSError) as e:
# TODO: проверить под Windows
MessageBox (_(u"Can't create wiki\n") + unicode (str (e), "utf8"),
_(u"Error"), wx.OK | wx.ICON_ERROR)
dlg.Destroy()
示例6: testMaxDepth3
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testMaxDepth3 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
WikiPageFactory.create (self.rootwiki, u"Страница 2", [])
treeStat = self.loader[self.__pluginname].getTreeStat (self.rootwiki)
self.assertEqual (len (treeStat.maxDepth), 2)
self.assertEqual (treeStat.maxDepth[0][0], 1)
示例7: testSymbolsNotWhiteSpacesWiki
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testSymbolsNotWhiteSpacesWiki (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
testPage.content = u"Бла бла бла\r\n\t\t\tАбырвалг "
pageStat = self.loader[self.__pluginname].getPageStat (testPage)
self.assertEqual (pageStat.symbolsNotWhiteSpaces, 17)
示例8: testSymbolsCountWiki
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testSymbolsCountWiki (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
testPage.content = u"Бла бла бла"
pageStat = self.loader[self.__pluginname].getPageStat (testPage)
self.assertEqual (pageStat.symbols, 11)
示例9: testAttachmentsSizeWiki4
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testAttachmentsSizeWiki4 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
Attachment (testPage).attach (self.fullFilesPath)
pageStat = self.loader[self.__pluginname].getPageStat (testPage)
self.assertAlmostEqual (pageStat.attachmentsSize, 11771, delta=300)
示例10: testAttachmentsSizeWiki3
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testAttachmentsSizeWiki3 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
testPage = self.rootwiki[u"Страница 1"]
Attachment (testPage).attach (self.fullFilesPath[0:3])
pageStat = self.loader[self.__pluginname].getPageStat (testPage)
self.assertEqual (pageStat.attachmentsSize, 2037)
示例11: testFrequentTags2
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testFrequentTags2 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [u"тег 1"])
treeStat = self.loader[self.__pluginname].getTreeStat (self.rootwiki)
self.assertEqual (len (treeStat.frequentTags), 1)
self.assertEqual (treeStat.frequentTags[0][0], u"тег 1")
self.assertEqual (treeStat.frequentTags[0][1], 1)
示例12: __createWiki
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def __createWiki(self):
# Здесь будет создаваться вики
self.path = mkdtemp(prefix='Абырвалг абыр')
self.wikiroot = WikiDocument.create(self.path)
factory = WikiPageFactory()
factory.create(self.wikiroot, "Страница 1", [])
示例13: testAttachmentSize2
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testAttachmentSize2 (self):
treeStat = self.loader[self.__pluginname].getTreeStat (self.rootwiki)
WikiPageFactory.create (self.rootwiki, u"Страница 1", [])
pagesList = treeStat.pageAttachmentsSize
self.assertEqual (len (pagesList), 1)
self.assertEqual (pagesList[0][0], self.rootwiki[u"Страница 1"])
self.assertEqual (pagesList[0][1], 0)
示例14: setUp
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def setUp (self):
BaseMainWndTest.setUp (self)
self.path = u"../test/testwiki"
removeWiki (self.path)
self.wikiroot = WikiDocument.create (self.path)
WikiPageFactory.create (self.wikiroot, u"Викистраница", [])
WikiPageFactory.create (self.wikiroot, u"Викистраница 2", [])
示例15: testTagsCount4
# 需要导入模块: from outwiker.pages.wiki.wikipage import WikiPageFactory [as 别名]
# 或者: from outwiker.pages.wiki.wikipage.WikiPageFactory import create [as 别名]
def testTagsCount4 (self):
WikiPageFactory.create (self.rootwiki, u"Страница 1", [u"Тег 1", u"Тег 2", u"Тег 3"])
WikiPageFactory.create (self.rootwiki[u"Страница 1"], u"Страница 2", [u"Тег 4"])
WikiPageFactory.create (self.rootwiki[u"Страница 1/Страница 2"], u"Страница 3", [u"Тег 1", u"Тег 2"])
WikiPageFactory.create (self.rootwiki, u"Страница 4", [])
WikiPageFactory.create (self.rootwiki[u"Страница 1"], u"Страница 5", [])
treeStat = self.loader[self.__pluginname].getTreeStat (self.rootwiki)
self.assertEqual (treeStat.tagsCount, 4)