* [gentoo-commits] gentoo-x86 commit in dev-python/simpleparse/files: simpleparse-2.1.0_alpha1-python-2.6.patch
@ 2009-08-30 21:47 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 2+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-08-30 21:47 UTC (permalink / raw
To: gentoo-commits
arfrever 09/08/30 21:47:13
Added: simpleparse-2.1.0_alpha1-python-2.6.patch
Log:
Fix compatibility with Python 2.6 (without fixing of deprecation warnings) (bug #283167).
(Portage version: 14170-svn/cvs/Linux x86_64)
Revision Changes Path
1.1 dev-python/simpleparse/files/simpleparse-2.1.0_alpha1-python-2.6.patch
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/simpleparse/files/simpleparse-2.1.0_alpha1-python-2.6.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/simpleparse/files/simpleparse-2.1.0_alpha1-python-2.6.patch?rev=1.1&content-type=text/plain
Index: simpleparse-2.1.0_alpha1-python-2.6.patch
===================================================================
--- stt/TextTools/TextTools.py
+++ stt/TextTools/TextTools.py
@@ -167,7 +167,7 @@
# 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=TextSearch,join=join,joinlist=joinlist,tag=tag,
string_replace=string.replace,type=type,
@@ -188,11 +188,11 @@
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,13 +203,13 @@
# 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,
TextSearchType=TextSearchType,TextSearch=TextSearch):
"""Analogon to string.replace; returns a string with all occurences
- of what in text[start:stop] replaced by with.
+ of what in text[start:stop] replaced by with_.
This version uses a one entry tag-table and a
Boyer-Moore-Search-object. what can be a string or a
@@ -226,13 +226,13 @@
stop = len(text)
if type(what) is not TextSearchType:
what=TextSearch(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,TextSearch=TextSearch,
TextSearchType=TextSearchType):
@@ -245,12 +245,12 @@
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,TextSearch=TextSearch,
TextSearchType=TextSearchType):
@@ -262,7 +262,7 @@
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,
@@ -569,16 +569,16 @@
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 !'
@@ -586,7 +586,7 @@
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 !'
@@ -594,7 +594,7 @@
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 !'
@@ -602,7 +602,7 @@
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 !'
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in dev-python/simpleparse/files: simpleparse-2.1.0_alpha1-python-2.6.patch
@ 2010-12-18 15:02 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 2+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-12-18 15:02 UTC (permalink / raw
To: gentoo-commits
arfrever 10/12/18 15:02:46
Removed: simpleparse-2.1.0_alpha1-python-2.6.patch
Log:
Delete older ebuild.
(Portage version: 2.2.0_alpha9_p3/cvs/Linux x86_64)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-18 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-30 21:47 [gentoo-commits] gentoo-x86 commit in dev-python/simpleparse/files: simpleparse-2.1.0_alpha1-python-2.6.patch Arfrever Frehtes Taifersar Arahesis (arfrever)
-- strict thread matches above, loose matches on Subject: below --
2010-12-18 15:02 Arfrever Frehtes Taifersar Arahesis (arfrever)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox