comparison roundup/cgi/client.py @ 1634:e5e00d3a3fe2

better string splitting
author Richard Jones <richard@users.sourceforge.net>
date Fri, 09 May 2003 03:32:41 +0000
parents 8a908bbad1ef
children 4a47eb555e51
comparison
equal deleted inserted replaced
1633:ac5f7e5a11e5 1634:e5e00d3a3fe2
1 # $Id: client.py,v 1.115 2003-05-09 01:47:50 richard Exp $ 1 # $Id: client.py,v 1.116 2003-05-09 03:32:41 richard Exp $
2 2
3 __doc__ = """ 3 __doc__ = """
4 WWW request handler (also used in the stand-alone server). 4 WWW request handler (also used in the stand-alone server).
5 """ 5 """
6 6
7 import os, os.path, cgi, StringIO, urlparse, re, traceback, mimetypes, urllib 7 import os, os.path, cgi, StringIO, urlparse, re, traceback, mimetypes, urllib
8 import binascii, Cookie, time, random, MimeWriter, smtplib, socket, quopri 8 import binascii, Cookie, time, random, MimeWriter, smtplib, socket, quopri
9 import stat, rfc822, string 9 import stat, rfc822, string
10 10
11 from roundup import roundupdb, date, hyperdb, password 11 from roundup import roundupdb, date, hyperdb, password, token
12 from roundup.i18n import _ 12 from roundup.i18n import _
13 from roundup.cgi.templating import Templates, HTMLRequest, NoTemplate 13 from roundup.cgi.templating import Templates, HTMLRequest, NoTemplate
14 from roundup.cgi import cgitb 14 from roundup.cgi import cgitb
15 from roundup.cgi.PageTemplates import PageTemplate 15 from roundup.cgi.PageTemplates import PageTemplate
16 from roundup.rfc2822 import encode_header 16 from roundup.rfc2822 import encode_header
1321 else: 1321 else:
1322 if not self.form[key].value: 1322 if not self.form[key].value:
1323 continue 1323 continue
1324 if isinstance(props[key], hyperdb.String): 1324 if isinstance(props[key], hyperdb.String):
1325 v = self.form[key].value 1325 v = self.form[key].value
1326 l = wcre.split(v) 1326 l = token.token_split(v)
1327 if len(l) > 1: 1327 if len(l) > 1 or l[0] != v:
1328 self.form.value.remove(self.form[key]) 1328 self.form.value.remove(self.form[key])
1329 # replace the single value with the split list 1329 # replace the single value with the split list
1330 for v in l: 1330 for v in l:
1331 self.form.value.append(cgi.MiniFieldStorage(key, v)) 1331 self.form.value.append(cgi.MiniFieldStorage(key, v))
1332 1332

Roundup Issue Tracker: http://roundup-tracker.org/