本文整理汇总了Python中outwiker.pages.wiki.wikipage.WikiPageFactory类的典型用法代码示例。如果您正苦于以下问题:Python WikiPageFactory类的具体用法?Python WikiPageFactory怎么用?Python WikiPageFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WikiPageFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testAttachmentsSizeWiki1
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)
示例2: __createWiki
def __createWiki (self):
# Здесь будет создаваться вики
self.path = u"../test/testwiki"
removeWiki (self.path)
self.rootwiki = WikiDocument.create (self.path)
WikiPageFactory.create (self.rootwiki, u"Страница 2", [])
示例3: testParseWithoutAttaches
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")
示例4: testPageCount2
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)
示例5: createNewWiki
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: registerActions
def registerActions (application):
"""
Зарегистрировать действия
"""
# Действия, связанные с разными типами страниц
from outwiker.pages.html.htmlpage import HtmlPageFactory
HtmlPageFactory.registerActions (application)
from outwiker.pages.wiki.wikipage import WikiPageFactory
WikiPageFactory.registerActions (application)
actionController = application.actionController
from outwiker.gui.actionslist import actionsList, polyactionsList
# Register the normal actions
map(lambda item: actionController.register(item[0](application),
item[1]),
actionsList)
# Register the polyactions
map(lambda item: actionController.register(PolyAction(application,
item[0],
item[1],
item[2]),
item[3]),
polyactionsList)
示例7: setUp
def setUp (self):
super (WikiTableDialogTest, self).setUp()
self._application = Application
config = GeneralGuiConfig (self._application.config)
config.tableColsCount.remove_option()
factory = WikiPageFactory()
self._testpage = factory.create (self.wikiroot, u"Страница 1", [])
示例8: setUp
def setUp(self):
self.initApplication()
self.wikiroot = self.createWiki()
config = GeneralGuiConfig(self.application.config)
config.tableColsCount.remove_option()
factory = WikiPageFactory()
self._testpage = factory.create(self.wikiroot, "Страница 1", [])
示例9: testSymbolsNotWhiteSpacesWiki
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)
示例10: testSymbolsCountWiki
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)
示例11: testAttachmentsSizeWiki4
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)
示例12: testAttachmentsSizeWiki3
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)
示例13: testMaxDepth3
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)
示例14: testFrequentTags2
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)
示例15: __createWiki
def __createWiki(self):
# Здесь будет создаваться вики
self.path = mkdtemp(prefix='Абырвалг абыр')
self.wikiroot = WikiDocument.create(self.path)
factory = WikiPageFactory()
factory.create(self.wikiroot, "Страница 1", [])