本文整理汇总了Python中MoinMoin.Page.Page.getPageHeader方法的典型用法代码示例。如果您正苦于以下问题:Python Page.getPageHeader方法的具体用法?Python Page.getPageHeader怎么用?Python Page.getPageHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoinMoin.Page.Page
的用法示例。
在下文中一共展示了Page.getPageHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newday
# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageHeader [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)