comparison roundup/cgi/actions.py @ 7178:db06d4aeb978

unshadow stdlib token from roundup's token. This bites me every now and again when running pytest and pdb. Some submodules want to load the stdlib python and end up getting roundup's python and thing break with N_TOKENS not defined etc. So rename token.py to token_r.py (token_r(oundup)... hey naming things is hard) an change code as needed.
author John Rouillard <rouilj@ieee.org>
date Sun, 26 Feb 2023 12:00:35 -0500
parents 970cd6d2b8ea
children 804cc66692ac
comparison
equal deleted inserted replaced
7177:d787f7282ea3 7178:db06d4aeb978
3 import csv 3 import csv
4 import re 4 import re
5 import sys 5 import sys
6 from datetime import timedelta 6 from datetime import timedelta
7 7
8 from roundup import hyperdb, token, date, password 8 from roundup import hyperdb, token_r, date, password
9 from roundup.actions import Action as BaseAction 9 from roundup.actions import Action as BaseAction
10 from roundup.anypy import urllib_ 10 from roundup.anypy import urllib_
11 from roundup.anypy.html import html_escape 11 from roundup.anypy.html import html_escape
12 from roundup.anypy.strings import StringIO 12 from roundup.anypy.strings import StringIO
13 from roundup.cgi import exceptions, templating 13 from roundup.cgi import exceptions, templating
425 if not self.form[key].value: 425 if not self.form[key].value:
426 continue 426 continue
427 if isinstance(prop, hyperdb.String): 427 if isinstance(prop, hyperdb.String):
428 v = self.form[key].value 428 v = self.form[key].value
429 # If this ever has unbalanced quotes, hilarity will ensue 429 # If this ever has unbalanced quotes, hilarity will ensue
430 tokens = token.token_split(v) 430 tokens = token_r.token_split(v)
431 if len(tokens) != 1 or tokens[0] != v: 431 if len(tokens) != 1 or tokens[0] != v:
432 self.form.value.remove(self.form[key]) 432 self.form.value.remove(self.form[key])
433 # replace the single value with the split list 433 # replace the single value with the split list
434 for v in tokens: 434 for v in tokens:
435 self.form.value.append(cgi.MiniFieldStorage(key, v)) 435 self.form.value.append(cgi.MiniFieldStorage(key, v))

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