mirror of
https://github.com/vivisect/vivisect
synced 2026-06-08 18:04:23 +00:00
80de840881
A lot of cleanup things in prep for a python 3 transition. Getting rid of the old exception syntax, converting prints over to logging, cutting random scraps of code to be proper unit tests, cut away some older bits of code, etc. This still works in python2. It's just a lot of tidying up. There are no major functionality changes.
28 lines
614 B
Python
28 lines
614 B
Python
|
|
import os
|
|
import zipfile
|
|
|
|
pkgnames = ('Elf', 'PE', 'cobra', 'envi', 'vdb', 'visgraph', 'vqt', 'vstruct', 'vtrace')
|
|
|
|
|
|
def addPythonSources( zfile, dirname, filenames ):
|
|
if dirname.find('.svn') != -1:
|
|
return
|
|
|
|
for fname in filenames:
|
|
if not fname.endswith('.py'):
|
|
continue
|
|
|
|
filepath = os.path.join(dirname, fname)
|
|
zfile.write(filepath, filepath)
|
|
|
|
|
|
def getSourceZip(fname='vdb.pyz'):
|
|
z = zipfile.ZipFile(fname, 'w')
|
|
for pypkg in pkgnames:
|
|
os.path.walk(pypkg, addPythonSources, z)
|
|
|
|
z.write('vdbbin', '__main__.py')
|
|
z.close()
|
|
return fname
|