~ubuntu-branches/ubuntu/gutsy/moin/gutsy

« back to all changes in this revision

Viewing changes to MoinMoin/action/rss_rc.py

  • Committer: Bazaar Package Importer
  • Author(s): Sivan Greenberg
  • Date: 2006-07-09 19:28:02 UTC
  • Revision ID: james.westby@ubuntu.com-20060709192802-oaeuvt4v3e9300uj
Tags: 1.5.3-1ubuntu1
* Merge new debian version.
* Reapply Ubuntu changes:
    + debian/rules:
      - Comment out usage of control.ubuntu.in (doesn't fit!).
    + debian/control.in:
      - Dropped python2.3 binary package.
    + debian/control:
      - Dropped python2.3 binary, again.
      - Dropped python2.3-dev from Build-Depends-Indep.
    + debian/patches/001-attachment-xss-fix.patch:
      - Dropped this patch. It's now in upstream's distribution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    @license: GNU GPL, see COPYING for details.
9
9
"""
10
10
import StringIO, re, os, time
11
 
from MoinMoin import wikixml, config, wikiutil, util
 
11
from MoinMoin import wikixml, config, wikiutil
12
12
from MoinMoin.logfile import editlog
13
 
from MoinMoin.util.datetime import formathttpdate
 
13
from MoinMoin.util import timefuncs
14
14
from MoinMoin.Page import Page
15
15
from MoinMoin.wikixml.util import RssGenerator
16
16
 
68
68
            ((line.pagename in pages) and unique)): continue
69
69
        #if log.dayChanged() and log.daycount > _MAX_DAYS: break
70
70
        line.editor = line.getInterwikiEditorData(request)
71
 
        line.time = util.datetime.tmtuple(wikiutil.version2timestamp(line.ed_time_usecs)) # UTC
 
71
        line.time = timefuncs.tmtuple(wikiutil.version2timestamp(line.ed_time_usecs)) # UTC
72
72
        logdata.append(line)
73
73
        pages[line.pagename] = None
74
74
 
149
149
        else:
150
150
            handler.simpleNode('link', link)
151
151
            
152
 
        handler.simpleNode(('dc', 'date'), util.W3CDate(item.time))
 
152
        handler.simpleNode(('dc', 'date'), timefuncs.W3CDate(item.time))
153
153
 
154
154
        # description
155
155
        desc_text = item.comment
208
208
 
209
209
    # generate an Expires header, using whatever setting the admin
210
210
    # defined for suggested cache lifetime of the RecentChanges RSS doc
211
 
    expires = formathttpdate(time.time() + cfg.rss_cache)
 
211
    expires = timefuncs.formathttpdate(time.time() + cfg.rss_cache)
212
212
 
213
213
    httpheaders = ["Content-Type: text/xml; charset=%s" % config.charset,
214
 
                        "Expires: "+expires]
 
214
                   "Expires: %s" % expires]
215
215
 
216
216
    # use a correct Last-Modified header, set to whatever the mod date
217
217
    # on the most recent page was; if there were no mods, don't send one
218
218
    if lastmod:
219
 
        httpheaders.append("Last-Modified: "+formathttpdate(lastmod))
 
219
        httpheaders.append("Last-Modified: %s" % timefuncs.formathttpdate(lastmod))
220
220
 
221
221
    # send the generated XML document
222
222
    request.http_headers(httpheaders)