You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
663 B

15 years ago
15 years ago
15 years ago
15 years ago
  1. # Generate python34stub.def out of python3.def
  2. # The regular import library cannot be used,
  3. # since it doesn't provide the right symbols for
  4. # data forwarding
  5. out = open("python34stub.def", "w")
  6. out.write('LIBRARY "python34"\n')
  7. out.write('EXPORTS\n')
  8. inp = open("python3.def")
  9. line = inp.readline()
  10. while line.strip().startswith(';'):
  11. line = inp.readline()
  12. line = inp.readline() # LIBRARY
  13. assert line.strip()=='EXPORTS'
  14. for line in inp:
  15. # SYM1=python34.SYM2[ DATA]
  16. head, tail = line.split('.')
  17. if 'DATA' in tail:
  18. symbol, tail = tail.split(' ')
  19. else:
  20. symbol = tail.strip()
  21. out.write(symbol+'\n')
  22. inp.close()
  23. out.close()