Skip to content

Instantly share code, notes, and snippets.

@SamKLowe
Created October 23, 2018 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamKLowe/23c0174e4bec309f65dd76336f6843ec to your computer and use it in GitHub Desktop.
Save SamKLowe/23c0174e4bec309f65dd76336f6843ec to your computer and use it in GitHub Desktop.
extract xilinx ise output script
with open('compxlib.log.sam') as infile, open('compile.sh', 'w') as outfile:
copy = False
getNextLine = 0;
for line in infile:
copy = False
if line.startswith('Executing cmd') == 1:
copy = True
myTuple = line.partition('\'');
myString = myTuple[2]
myTuple = myString.partition('\'');
if line.endswith('-f\n'):
getNextLine = 1;
if myTuple[0].startswith('unzip') == 0:
outfile.write(myTuple[0].strip())
if getNextLine == 0:
outfile.write('\n')
else:
if getNextLine == 1:
myTuple = line.partition('\'');
outfile.write(' ');
outfile.write(myTuple[0])
outfile.write('\n')
getNextLine = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment