[Python-checkins] python/dist/src/Tools/scripts combinerefs.py,1.1,1.2
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
2003年4月17日 18:02:41 -0700
Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv14422/Tools/scripts
Modified Files:
combinerefs.py
Log Message:
Heh -- I checked in an old version of this, at a time I documented the
internal read() as being a generator but hadn't yet changed it into one.
Index: combinerefs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/combinerefs.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** combinerefs.py 18 Apr 2003 00:45:59 -0000 1.1
--- combinerefs.py 18 Apr 2003 01:02:37 -0000 1.2
***************
*** 75,85 ****
# following it.
def read(fileiter, pat, whilematch):
- result = []
for line in fileiter:
if bool(pat.match(line)) == whilematch:
! result.append(line)
else:
break
- return result
def combine(fname):
--- 75,83 ----
# following it.
def read(fileiter, pat, whilematch):
for line in fileiter:
if bool(pat.match(line)) == whilematch:
! yield line
else:
break
def combine(fname):