本文整理汇总了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
示例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()
示例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())
示例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
示例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())
示例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)