Commit 977f3261 authored by Shane Hathaway's avatar Shane Hathaway

Fixed some re's

parent 90099db1
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
"$Id: DT_String.py,v 1.41 2001/04/27 20:27:39 shane Exp $" "$Id: DT_String.py,v 1.42 2001/04/27 20:59:34 shane Exp $"
from string import split, strip from string import split, strip
import thread,re import thread,re
...@@ -158,10 +158,10 @@ class String: ...@@ -158,10 +158,10 @@ class String:
r'%(' # beginning r'%(' # beginning
'(?P<name>[a-zA-Z0-9_/.-]+)' # tag name '(?P<name>[a-zA-Z0-9_/.-]+)' # tag name
'(' '('
'[\0- ]+' # space after tag name '[\000- ]+' # space after tag name
'(?P<args>([^)"]+("[^"]*")?\)*)' # arguments '(?P<args>([^)"]+("[^"]*")?)*)' # arguments
')?' ')?'
')(?P<fmt>[0-9]*[.]?[0-9]*[a-z]\|[]![])' # end ')(?P<fmt>[0-9]*[.]?[0-9]*[a-z]|[]![])' # end
, re.I) , re.I)
_parseTag__roles__=() _parseTag__roles__=()
......
...@@ -217,8 +217,8 @@ Evaluating expressions without rendering results ...@@ -217,8 +217,8 @@ Evaluating expressions without rendering results
''' # ' ''' # '
__rcs_id__='$Id: DT_Var.py,v 1.39 2001/04/27 20:27:39 shane Exp $' __rcs_id__='$Id: DT_Var.py,v 1.40 2001/04/27 20:59:34 shane Exp $'
__version__='$Revision: 1.39 $'[11:-2] __version__='$Revision: 1.40 $'[11:-2]
from DT_Util import parse_params, name_param, str from DT_Util import parse_params, name_param, str
import re, string, sys import re, string, sys
...@@ -378,7 +378,7 @@ def dollars_and_cents(v, name='(Unknown name)', md={}): ...@@ -378,7 +378,7 @@ def dollars_and_cents(v, name='(Unknown name)', md={}):
def thousands_commas(v, name='(Unknown name)', md={}, def thousands_commas(v, name='(Unknown name)', md={},
thou=re.compile( thou=re.compile(
r"([0-9])([0-9][0-9][0-9]([,.]\|$))").search): r"([0-9])([0-9][0-9][0-9]([,.]|$))").search):
v=str(v) v=str(v)
vl=split(v,'.') vl=split(v,'.')
if not vl: return v if not vl: return v
...@@ -390,7 +390,7 @@ def thousands_commas(v, name='(Unknown name)', md={}, ...@@ -390,7 +390,7 @@ def thousands_commas(v, name='(Unknown name)', md={},
while mo is not None: while mo is not None:
l = mo.start(0) l = mo.start(0)
v=v[:l+1]+','+v[l+1:] v=v[:l+1]+','+v[l+1:]
l=thou(v) mo=thou(v)
return v+s return v+s
def whole_dollars_with_commas(v, name='(Unknown name)', md={}): def whole_dollars_with_commas(v, name='(Unknown name)', md={}):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment