当前位置: 首页>>代码示例>>Python>>正文


Python wikipage.WikiPageFactory类代码示例

本文整理汇总了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)
开发者ID:qyqx,项目名称:outwiker,代码行数:7,代码来源:pagestatistics.py

示例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", [])
开发者ID:s200999900,项目名称:outwiker,代码行数:7,代码来源:parsertex.py

示例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")
开发者ID:qyqx,项目名称:outwiker,代码行数:7,代码来源:parsermisc.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:7,代码来源:treestatistics.py

示例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()
开发者ID:s200999900,项目名称:outwiker,代码行数:30,代码来源:commands.py

示例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)
开发者ID:,项目名称:,代码行数:26,代码来源:

示例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", [])
开发者ID:LihMeh,项目名称:outwiker,代码行数:8,代码来源:wikitabledialog.py

示例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", [])
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_wikitabledialog.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:pagestatistics.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:pagestatistics.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:pagestatistics.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:pagestatistics.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:treestatistics.py

示例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)
开发者ID:qyqx,项目名称:outwiker,代码行数:8,代码来源:treestatistics.py

示例15: __createWiki

    def __createWiki(self):
        # Здесь будет создаваться вики
        self.path = mkdtemp(prefix='Абырвалг абыр')

        self.wikiroot = WikiDocument.create(self.path)

        factory = WikiPageFactory()
        factory.create(self.wikiroot, "Страница 1", [])
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_wikicommanddates.py


注:本文中的outwiker.pages.wiki.wikipage.WikiPageFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。