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


Python PageEditor.get_rev方法代码示例

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


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

示例1: save_page

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import get_rev [as 别名]
 def save_page(self, output):
     editor = PageEditor(self.macro.request, self.pagename)
     text = self.create_header()
     text += editor.normalizeText(output)
     dummy, revision, exists = editor.get_rev() 
     try:
         res =  editor.saveText(text, revision, comment="updated by MakeList macro.")
         return res
     except editor.Unchanged:
         return "You did not change the page content, not saved!"
     except:
         return "An error occured!"
开发者ID:3100,项目名称:MoinMacro,代码行数:14,代码来源:MakeList.py

示例2: newday

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import get_rev [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

示例3: ScriptContext

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import get_rev [as 别名]
# coding: utf-8
import py

from MoinMoin import wikiutil

from MoinMoin.PageEditor import PageEditor
from MoinMoin.web.contexts import ScriptContext

pagename = 'Class_%23AC0'
req = ScriptContext('localhost:8080', pagename)
editor = PageEditor(request, pagename)
text = editor.normalizeText('''= #AC<sup>0</sup> = 

The class of functions from {0,1}<sup>n</sup> to nonnegative integers computed by polynomial-size constant-depth arithmetic circuits, using addition and multiplication gates and the constants 0 and 1.

Contained in GapAC<sup>0</sup>.''')
_, rev, _ = editor.get_rev()
editor.saveText(text, rev)
开发者ID:silky,项目名称:complexityzoo,代码行数:20,代码来源:meh.py


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