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


Python Page.getPageText方法代码示例

本文整理汇总了Python中MoinMoin.Page.Page.getPageText方法的典型用法代码示例。如果您正苦于以下问题:Python Page.getPageText方法的具体用法?Python Page.getPageText怎么用?Python Page.getPageText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MoinMoin.Page.Page的用法示例。


在下文中一共展示了Page.getPageText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: execute

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
def execute(macro, args):
    request = macro.request
    content = []
    page_name = macro.formatter.page.page_name

    # get args
    include_page_name = ''
    if args is not None:
        (include_page_name, _, hdf_text) = args.partition(',')

    include_page_name = wikiutil.AbsPageName(page_name, include_page_name)

    include_page = Page(request, include_page_name)

    if include_page is None:
        return ''
    if not request.user.may.read(include_page_name):
        return ''
      
    cstemplate = include_page.getPageText()

    pagename = macro.formatter.page.page_name
    
    hdf = neo_util.HDF()
    hdf.readString(hdf_text)

    hdf.setValue("Config.WhiteSpaceStrip ", "0")

    cs = neo_cs.CS(hdf)
    cs.parseStr(cstemplate)

    body = cs.render()

    body = wikiutil.renderText(request, WikiParser, body)
    return body
开发者ID:130s,项目名称:roswiki,代码行数:37,代码来源:CS.py

示例2: testBasicPackageThings

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
 def testBasicPackageThings(self):
     become_superuser(self.request)
     myPackage = DebugPackage(self.request, 'test')
     myPackage.installPackage()
     assert myPackage.msg == u'foo\nFooPage added \n'
     testseite2 = Page(self.request, 'TestSeite2')
     assert testseite2.getPageText() == "Hello world, I am the file testdatei"
     assert testseite2.isUnderlayPage()
开发者ID:steveyen,项目名称:moingo,代码行数:10,代码来源:test_packages.py

示例3: testBasicPackageThings

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
 def testBasicPackageThings(self):
     myPackage = DebugPackage(self.request, 'test')
     myPackage.installPackage()
     self.assertEqual(myPackage.msg, "foo\n")
     testseite2 = Page(self.request, 'TestSeite2')
     self.assertEqual(testseite2.getPageText(), "Hello world, I am the file testdatei")
     self.assert_(testseite2.isUnderlayPage())
     self.assert_(not Page(self.request, 'FooPage').exists())
开发者ID:imosts,项目名称:flume,代码行数:10,代码来源:test_packages.py

示例4: execute

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
def execute(macro, args):
    request = macro.request
    content = []
    page_name = macro.formatter.page.page_name

    # get args
    include_page_name = ''
    if args is not None:
        include_page_name = args

    include_page_name = wikiutil.AbsPageName(page_name, include_page_name)

    include_page = Page(request, include_page_name)

    if include_page is None:
        return ''
    if not request.user.may.read(include_page_name):
        return ''
      
    cstemplate = include_page.getPageText()

    pagename = macro.formatter.page.page_name
    kv_page = Page(request, pagename)
    kv_body = kv_page.get_body()
    
    hdf = neo_util.HDF()
    for line in kv_body.split("\n"):
      if line.startswith("##"):
        line = line[2:].strip()
        parts = line.split("=", 1)
        if len(parts) == 2:
          val = parts[1].strip()
          #val = parts[1].strip().encode('utf-8')  # swh
          hdf.setValue(parts[0].strip(), val)

    hdf.setValue("Config.WhiteSpaceStrip ", "0")

    cs = neo_cs.CS(hdf)
    cs.parseStr(cstemplate)

    body = cs.render()

    body = wikiutil.renderText(request, WikiParser, body)

    open("/tmp/out.html", "w").write(body)

    return body
开发者ID:130s,项目名称:roswiki,代码行数:49,代码来源:IncludeCSTemplate.py

示例5: execute

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
def execute(macro, args):
    request = macro.request
    content = []
    page_name = macro.formatter.page.page_name

    # get args
    include_page_name = ''
    if args is not None:
        include_page_name = args

    include_page_name = wikiutil.AbsPageName(page_name, include_page_name)

    include_page = Page(request, include_page_name)

    if include_page is None:
        return ''
    if not request.user.may.read(include_page_name):
        return ''
    else:
        return wikiutil.renderText(request, WikiParser, include_page.getPageText())
开发者ID:130s,项目名称:roswiki,代码行数:22,代码来源:IncludeWikiContent.py

示例6: newday

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageText [as 别名]
def newday (Wiki, ParentPage, TemplatePage, NewPage, Editor, UidName, GidName):

    from os import seteuid,setegid
    from pwd import getpwnam
    from grp import getgrnam

    uid = getpwnam(UidName).pw_uid
    gid = getgrnam(GidName).gr_gid

    setegid(gid)
    seteuid(uid)

    from MoinMoin.PageEditor import PageEditor
    from MoinMoin.Page import Page
    from MoinMoin.user import getUserId, User
    from MoinMoin.web.contexts import ScriptContext

    PageName = "%s/%s" % (ParentPage,NewPage)

    RequestPage = ScriptContext(Wiki, PageName)
    UserId = getUserId(RequestPage, Editor)
    RequestPage.user = User(RequestPage, UserId)

    Editor = PageEditor(RequestPage, PageName)
    Dummy, Revision, Exists = Editor.get_rev()

    if not Exists:

        RequestTemplate = ScriptContext(Wiki, TemplatePage)
        Viewer = Page(RequestTemplate, TemplatePage)

        Text = Viewer.getPageText().replace("@[email protected]", NewPage)
        Header = Viewer.getPageHeader()

        Text=Header+Text

        return Editor.saveText(Text, Revision)
开发者ID:Urlandi,项目名称:news2rss_moinmoin,代码行数:39,代码来源:newday.py


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