[Zope-Checkins] CVS: Zope2 - ts_regex_new.py:1.1.2.3 ts_regex.py:1.7.158.4

andreas@serenade.digicool.com andreas@serenade.digicool.com
Tue, 17 Apr 2001 16:51:41 -0400


Update of /cvs-repository/Zope2/lib/python
In directory serenade.digicool.com:/tmp/cvs-serv26725

Modified Files:
      Tag: ajung-2_4-ts_regex-exterminiation-branch
	ts_regex_new.py ts_regex.py 
Log Message:
update



--- Updated File ts_regex_new.py in package Zope2 --
--- ts_regex_new.py	2001/04/17 19:12:02	1.1.2.2
+++ ts_regex_new.py	2001/04/17 20:51:41	1.1.2.3
@@ -112,6 +112,8 @@
 class compile:
 
     def __init__(self, *args):
+        self.translate = args[0]
+        self.givenpat  = _rcCV(args[0])
 
         if len(args)==1:
             self._re = re.compile(_rcCV(args[0]))
@@ -162,8 +164,8 @@
             try: l.append(mo.group(g))
             except: l.append(None)      
 
-        if len(l) >1: return mo.end(0), tuple(l)
-        else: return mo.end(0), l[0]
+        if len(l) >1: return mo.end(0)-pos, tuple(l)
+        else: return mo.end(0)-pos, l[0]
 
       
 

--- Updated File ts_regex.py in package Zope2 --
--- ts_regex.py	2001/04/17 19:12:02	1.7.158.3
+++ ts_regex.py	2001/04/17 20:51:41	1.7.158.4
@@ -173,7 +173,10 @@
         """
         x = self._old.match_group(str,group,pos)
         y = self._new.match_group(str,group,pos)
-        if x!=y: print 'Warning: match_group(%s,%s,%s) %s vs %s' % (str,group,pos,x,y)
+        if x!=y: 
+            print 'Warning: match_group(%s,%s,%s) %s vs %s' % (str,group,pos,x,y)
+            print self._old.givenpat
+            print self._new.givenpat
         return x