pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/time/py-mxDateTime with is a reserved word for Python ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/99710e9a571e
branches:  trunk
changeset: 560929:99710e9a571e
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Jul 06 21:42:38 2009 +0000

description:
with is a reserved word for Python 2.6, so avoid it.

diffstat:

 time/py-mxDateTime/distinfo         |    3 +-
 time/py-mxDateTime/patches/patch-aa |  124 ++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 1 deletions(-)

diffs (139 lines):

diff -r aaef73291668 -r 99710e9a571e time/py-mxDateTime/distinfo
--- a/time/py-mxDateTime/distinfo       Mon Jul 06 18:28:41 2009 +0000
+++ b/time/py-mxDateTime/distinfo       Mon Jul 06 21:42:38 2009 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.7 2005/02/23 19:14:55 wiz Exp $
+$NetBSD: distinfo,v 1.8 2009/07/06 21:42:38 joerg Exp $
 
 SHA1 (egenix-mx-base-2.0.6.tar.gz) = 7f964408e3bd907c1a39b0f8d8d00d2367d97841
 RMD160 (egenix-mx-base-2.0.6.tar.gz) = dc25b5941cb790d1aa424a7eb1849ddf7231fa0e
 Size (egenix-mx-base-2.0.6.tar.gz) = 586854 bytes
+SHA1 (patch-aa) = 4d35beff0cef676a2c5bb28d379d36e29a94aaec
diff -r aaef73291668 -r 99710e9a571e time/py-mxDateTime/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/py-mxDateTime/patches/patch-aa       Mon Jul 06 21:42:38 2009 +0000
@@ -0,0 +1,124 @@
+$NetBSD: patch-aa,v 1.3 2009/07/06 21:42:38 joerg Exp $
+
+--- mx/TextTools/TextTools.py.orig     2009-07-06 21:37:44.000000000 +0000
++++ mx/TextTools/TextTools.py
+@@ -167,7 +167,7 @@ def word_in_list(l):
+ # Extra stuff useful in combination with the C functions
+ #
+ 
+-def replace(text,what,with,start=0,stop=None,
++def replace(text,what,with_,start=0,stop=None,
+ 
+             SearchObject=BMS,join=join,joinlist=joinlist,tag=tag,
+             string_replace=string.replace,type=type,
+@@ -188,11 +188,11 @@ def replace(text,what,with,start=0,stop=
+         what = so.match
+     if stop is None:
+         if start == 0 and len(what) < 2:
+-            return string_replace(text,what,with)
++            return string_replace(text,what,with_)
+         stop = len(text)
+     t = ((text,sWordStart,so,+2),
+          # Found something, replace and continue searching
+-         (with,Skip+AppendTagobj,len(what),-1,-1),
++         (with_,Skip+AppendTagobj,len(what),-1,-1),
+          # Rest of text
+          (text,Move,ToEOF)
+          )
+@@ -203,7 +203,7 @@ def replace(text,what,with,start=0,stop=
+ 
+ # Alternative (usually slower) versions using different techniques:
+ 
+-def _replace2(text,what,with,start=0,stop=None,
++def _replace2(text,what,with_,start=0,stop=None,
+ 
+               join=join,joinlist=joinlist,tag=tag,
+               StringType=types.StringType,BMS=BMS):
+@@ -222,13 +222,13 @@ def _replace2(text,what,with,start=0,sto
+         stop = len(text)
+     if type(what) == StringType:
+         what=BMS(what)
+-    t = ((with,sFindWord,what,+1,+0),)
++    t = ((with_,sFindWord,what,+1,+0),)
+     found,taglist,last = tag(text,t,start,stop)
+     if not found: 
+         return text
+     return join(joinlist(text,taglist))
+ 
+-def _replace3(text,what,with,
++def _replace3(text,what,with_,
+ 
+               join=string.join,FS=FS,
+               StringType=types.StringType):
+@@ -241,12 +241,12 @@ def _replace3(text,what,with,
+     l = []
+     x = 0
+     for left,right in slices:
+-        l.append(text[x:left] + with)
++        l.append(text[x:left] + with_)
+         x = right
+     l.append(text[x:])
+     return join(l,'')
+ 
+-def _replace4(text,what,with,
++def _replace4(text,what,with_,
+ 
+               join=join,joinlist=joinlist,tag=tag,FS=FS,
+               StringType=types.StringType):
+@@ -258,7 +258,7 @@ def _replace4(text,what,with,
+         return text
+     repl = [None]*len(slices)
+     for i in range(len(slices)):
+-        repl[i] = (with,)+slices[i]
++        repl[i] = (with_,)+slices[i]
+     return join(joinlist(text,repl))
+ 
+ def multireplace(text,replacements,start=0,stop=None,
+@@ -554,16 +554,16 @@ def _bench(file='mxTextTools/mxTextTools
+         print 'Replacing strings'
+         print '-'*72
+         print
+-        for what,with in (('m','M'),('mx','MX'),('mxText','MXTEXT'),
++        for what,with_ in (('m','M'),('mx','MX'),('mxText','MXTEXT'),
+                           ('hmm','HMM'),('hmmm','HMM'),('hmhmm','HMM')):
+-            print 'Replace "%s" with "%s"' % (what,with)
++            print 'Replace "%s" with "%s"' % (what,with_)
+             t.start()
+             for i in range(100):
+-                rtext = string.replace(text,what,with)
++                rtext = string.replace(text,what,with_)
+             print 'with string.replace:',t.stop(),'sec.'
+             t.start()
+             for i in range(100):
+-                ttext = replace(text,what,with)
++                ttext = replace(text,what,with_)
+             print 'with tag.replace:',t.stop(),'sec.'
+             if ttext != rtext:
+                 print 'results are NOT ok !'
+@@ -571,7 +571,7 @@ def _bench(file='mxTextTools/mxTextTools
+                 mismatch(rtext,ttext)
+             t.start()
+             for i in range(100):
+-                ttext = _replace2(text,what,with)
++                ttext = _replace2(text,what,with_)
+             print 'with tag._replace2:',t.stop(),'sec.'
+             if ttext != rtext:
+                 print 'results are NOT ok !'
+@@ -579,7 +579,7 @@ def _bench(file='mxTextTools/mxTextTools
+                 print rtext
+             t.start()
+             for i in range(100):
+-                ttext = _replace3(text,what,with)
++                ttext = _replace3(text,what,with_)
+             print 'with tag._replace3:',t.stop(),'sec.'
+             if ttext != rtext:
+                 print 'results are NOT ok !'
+@@ -587,7 +587,7 @@ def _bench(file='mxTextTools/mxTextTools
+                 print rtext
+             t.start()
+             for i in range(100):
+-                ttext = _replace4(text,what,with)
++                ttext = _replace4(text,what,with_)
+             print 'with tag._replace4:',t.stop(),'sec.'
+             if ttext != rtext:
+                 print 'results are NOT ok !'



Home | Main Index | Thread Index | Old Index