diff -ur pylibpcap-0.5.1/build-tools/docify-shadow.py pylibpcap-0.5.1-fixed/build-tools/docify-shadow.py --- pylibpcap-0.5.1/build-tools/docify-shadow.py 2005-11-18 08:38:13.000000000 +0200 +++ pylibpcap-0.5.1-fixed/build-tools/docify-shadow.py 2006-09-14 02:03:41.000000000 +0300 @@ -20,7 +20,7 @@ data=f.readlines() for i in xrange(0,len(data)): - match=re.search('^.*def __del__',data[i]) + match=re.search('^.*__repr__ =',data[i]) # Changed from '^.*def __del__' to '__repr__ =' if match: #print match.group(0) i=i+1 @@ -36,7 +36,7 @@ pymeths=[] for i in xrange (i,len(data)): - if re.search('^.*def __repr__', data[i]): + if re.search('^.__del__ =', data[i]): # changed from ^.*def __repr__ to '^.*__del =' break pymeths.append(data[i]) @@ -67,10 +67,16 @@ break # spit out the next 2 lines verbatim +# that's three lines: +# this = _pcap.new_pcapObject(*args) +# try: self.this.append(this) +# except: self.this = this outfile.write(data[i]) -i=i+1 +i+=1 outfile.write(data[i]) -i=i+1 +i+=1 +outfile.write(data[i]) +i+=1 outfile.write(' import sys\n') outfile.write(' if sys.version[0]==\'2\':\n') diff -ur pylibpcap-0.5.1/mk-constants.py pylibpcap-0.5.1-fixed/mk-constants.py --- pylibpcap-0.5.1/mk-constants.py 2004-06-07 08:34:49.000000000 +0300 +++ pylibpcap-0.5.1-fixed/mk-constants.py 2006-09-14 01:55:14.000000000 +0300 @@ -79,6 +79,13 @@ rcs = ' $Id: pylibpcap-swig-1.3.29.patch,v 1.1 2006/09/19 20:58:22 liquidx Exp $\n' fp.write(string.replace(rcs, '$', '')) fp.write(' Do not edit this file directly, it will be overwritten \n*/\n\n') +fp.write('// Adding statements taken from pylibpcap-0.4 source\n') +fp.write('#define SWIG_PY_INT\t1\n') +fp.write('#define SWIG_PY_FLOAT\t2\n') +fp.write('#define SWIG_PY_STRING\t3\n') +fp.write('#define SWIG_PY_POINTER\t4\n') +fp.write('#define SWIG_PY_BINARY\t5\n') +fp.write('//\n') fp.write('static struct swig_const_info const pcapmodule_DLT[] = {\n') for dlt in linktypes: fp.write('#ifdef %s\n' % (dlt,))