Attachment 'xmlrpcpageinfo.patch'

Download

   1 diff -r 7e4b68c11362 MoinMoin/Page.py
   2 --- a/MoinMoin/Page.py	Tue Apr 29 16:25:39 2008 +0200
   3 +++ b/MoinMoin/Page.py	Fri May 02 20:36:21 2008 +0800
   4 @@ -547,25 +547,24 @@ class Page(object):
   5  
   6          result = None
   7          if not self.rev:
   8 -            log = self._last_edited(request)
   9 -            if log:
  10 -                editordata = log.getInterwikiEditorData(request)
  11 -                editor = editordata[1]
  12 -                if editordata[0] == 'interwiki':
  13 -                    editor = "%s:%s" % editordata[1]
  14 -                else: # 'ip'
  15 -                    editor = editordata[1]
  16 -                result = {
  17 -                    'timestamp': log.ed_time_usecs,
  18 -                    'editor': editor,
  19 -                }
  20 -                del log
  21 -        if not result:
  22 -            version = self.mtime_usecs()
  23 +            line = self._last_edited(request)
  24 +        else:
  25 +            from MoinMoin.logfile import editlog
  26 +            for line in editlog.EditLog(request, rootpagename=self.page_name):
  27 +                if int(line.rev) == self.rev:
  28 +                    break
  29 +            else:
  30 +                line = None
  31 +        if line:
  32 +            editordata = line.getInterwikiEditorData(request)
  33 +            editor = editordata[1]
  34 +            if editordata[0] == 'interwiki':
  35 +                editor = "%s:%s" % editordata[1]
  36              result = {
  37 -                'timestamp': version,
  38 -                'editor': '?',
  39 +                'timestamp': line.ed_time_usecs,
  40 +                'editor': editor,
  41              }
  42 +            del line
  43  
  44          return result
  45  
  46 diff -r 7e4b68c11362 MoinMoin/xmlrpc/__init__.py
  47 --- a/MoinMoin/xmlrpc/__init__.py	Tue Apr 29 16:25:39 2008 +0200
  48 +++ b/MoinMoin/xmlrpc/__init__.py	Fri May 02 20:36:21 2008 +0800
  49 @@ -409,6 +409,9 @@ class XmlRpcBase:
  50  
  51          # Get page info
  52          last_edit = page.last_edit(self.request)
  53 +        # Really get info?
  54 +        if not last_edit:
  55 +            return self.noSuchPageFault()
  56          mtime = wikiutil.version2timestamp(long(last_edit['timestamp'])) # must be long for py 2.2.x
  57          gmtuple = tuple(time.gmtime(mtime))

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-05-02 02:38:13, 1.4 KB) [[attachment:Page.py.patch]]
  • [get | view] (2008-05-02 12:44:10, 2.1 KB) [[attachment:xmlrpcpageinfo.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.