Tweak japanese/ruby-mecab version 0.996_1
[dports.git] / japanese / mailman / files / extra-patch-Mailman-Cgi-private.py
1 --- Mailman/Cgi/private.py.orig 2010-09-21 03:18:27.000000000 +0900
2 +++ Mailman/Cgi/private.py      2011-04-08 22:28:09.000000000 +0900
3 @@ -116,6 +116,7 @@
4  
5      i18n.set_language(mlist.preferred_language)
6      doc.set_language(mlist.preferred_language)
7 +    is_cgi = 0
8  
9      cgidata = cgi.FieldStorage()
10      username = cgidata.getvalue('username', '')
11 @@ -179,6 +180,10 @@
12          elif true_filename.endswith('.gz'):
13              import gzip
14              f = gzip.open(true_filename, 'r')
15 +        elif true_filename.endswith('namazu.cgi'):
16 +            os.putenv('SCRIPT_NAME', 'namazu.cgi')
17 +            f = os.popen(true_filename, 'r')
18 +            is_cgi = 1
19          else:
20              f = open(true_filename, 'r')
21      except IOError:
22 @@ -188,6 +193,7 @@
23          print doc.Format()
24          syslog('error', 'Private archive file not found: %s', true_filename)
25      else:
26 -        print 'Content-type: %s\n' % ctype
27 +        if not is_cgi:
28 +            print 'Content-type: %s\n' % ctype
29          sys.stdout.write(f.read())
30          f.close()