本文整理汇总了Python中MoinMoin.Page.Page.last_edit方法的典型用法代码示例。如果您正苦于以下问题:Python Page.last_edit方法的具体用法?Python Page.last_edit怎么用?Python Page.last_edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoinMoin.Page.Page
的用法示例。
在下文中一共展示了Page.last_edit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: xmlrpc_getPageInfoVersion
# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import last_edit [as 别名]
def xmlrpc_getPageInfoVersion(self, pagename, rev):
""" Return page information for specific revision
@param pagename: the name of the page (utf-8)
@param rev: revision to get info about (XXX int?)
@rtype: dict XXX ??
@return: page information
* name (string): the canonical page name, UTF-8.
* lastModified (date): Last modification date, UTC.
* author (string): author name, UTF-8.
* version (int): current version
"""
pn = self._instr(pagename)
# User may read this page?
if not self.request.user.may.read(pn):
return self.notAllowedFault()
if rev != None:
page = Page(self.request, pn, rev=rev)
else:
page = Page(self.request, pn)
rev = page.current_rev()
# Non existing page?
if not page.exists():
return self.noSuchPageFault()
# Get page info
last_edit = page.last_edit(self.request)
mtime = wikiutil.version2timestamp(int(last_edit['timestamp']))
gmtuple = tuple(time.gmtime(mtime))
version = rev # our new rev numbers: 1,2,3,4,....
#######################################################################
# BACKWARDS COMPATIBILITY CODE - remove when 1.2.x is regarded stone age
# as we run a feed for BadContent on MoinMaster, we want to stay
# compatible here for a while with 1.2.x moins asking us for BadContent
# 1.3 uses the lastModified field for checking for updates, so it
# should be no problem putting the old UNIX timestamp style of version
# number in the version field
if self.request.cfg.sitename == 'MoinMaster' and pagename == 'BadContent':
version = int(mtime)
#######################################################################
return {
'name': pagename,
'lastModified' : xmlrpclib.DateTime(gmtuple),
'author': self._outstr(last_edit['editor']),
'version': version,
}