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

« back to all changes in this revision

Viewing changes to MoinMoin/wikiaction.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:
567
567
    if savetext is None:
568
568
        pg.sendEditor()
569
569
        return
 
570
  
 
571
    # did user hit cancel button?
 
572
    cancelled = request.form.has_key('button_cancel')
570
573
 
571
574
    # convert input from Graphical editor
572
 
    if lasteditor == 'gui':
573
 
        from MoinMoin.converter.text_html_text_x_moin import convert
574
 
        savetext = convert(request, pagename, savetext) # XXX error handling
 
575
    from MoinMoin.converter.text_html_text_x_moin import convert, ConvertError
 
576
    try:
 
577
        if lasteditor == 'gui':
 
578
            savetext = convert(request, pagename, savetext)
 
579
                
 
580
        # IMPORTANT: normalize text from the form. This should be done in
 
581
        # one place before we manipulate the text.
 
582
        savetext = pg.normalizeText(savetext, stripspaces=rstrip)
 
583
    except ConvertError:
 
584
        # we don't want to throw an exception if user cancelled anyway
 
585
        if not cancelled:
 
586
            raise
575
587
 
576
 
    # IMPORTANT: normalize text from the form. This should be done in
577
 
    # one place before we manipulate the text.
578
 
    savetext = pg.normalizeText(savetext, stripspaces=rstrip)
 
588
    if cancelled:
 
589
        pg.sendCancel(savetext or "", rev)
 
590
        return
579
591
 
580
592
    comment = wikiutil.clean_comment(comment)
581
593
 
582
 
    # Edit was canceled
583
 
    if request.form.has_key('button_cancel'):
584
 
        pg.sendCancel(savetext or "", rev)
585
 
        return
586
 
 
587
594
    # Add category
588
595
 
589
596
    # TODO: this code does not work with extended links, and is doing
775
782
        Page(request, pagename).send_page(request)
776
783
        return
777
784
 
778
 
    request.http_headers(["Content-type: text/plain;charset=%s" % config.charset])
779
 
 
780
785
    if request.form.has_key('rev'):
781
786
        try:
782
787
            rev = request.form['rev'][0]
790
795
    else:
791
796
        page = Page(request, pagename)
792
797
 
793
 
    text = page.get_raw_body()
794
 
    text = page.encodeTextMimeType(text)
795
 
    request.write(text)
796
 
    raise MoinMoinNoFooter
 
798
    page.send_raw()
797
799
 
798
800
 
799
801
def do_format(pagename, request):