/Mac/Modules/ibcarbon/IBCarbonscan.py

http://unladen-swallow.googlecode.com/ · Python · 47 lines · 36 code · 10 blank · 1 comment · 4 complexity · aa74d19057c91216c6fd2a4fbc7c566e MD5 · raw file

  1. # IBCarbonscan.py
  2. import sys
  3. from bgenlocations import TOOLBOXDIR, BGENDIR
  4. sys.path.append(BGENDIR)
  5. from scantools import Scanner_OSX
  6. def main():
  7. print "---Scanning IBCarbonRuntime.h---"
  8. input = ["IBCarbonRuntime.h"]
  9. output = "IBCarbongen.py"
  10. defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
  11. scanner = IBCarbon_Scanner(input, output, defsoutput)
  12. scanner.scan()
  13. scanner.close()
  14. print "=== Testing definitions output code ==="
  15. execfile(defsoutput, {}, {})
  16. print "--done scanning, importing--"
  17. import IBCarbonsupport
  18. print "done"
  19. class IBCarbon_Scanner(Scanner_OSX):
  20. def destination(self, type, name, arglist):
  21. classname = "IBCarbonFunction"
  22. listname = "functions"
  23. if arglist:
  24. t, n, m = arglist[0]
  25. if t == "IBNibRef" and m == "InMode":
  26. classname = "IBCarbonMethod"
  27. listname = "methods"
  28. return classname, listname
  29. def makeblacklistnames(self):
  30. return [
  31. "DisposeNibReference", # taken care of by destructor
  32. "CreateNibReferenceWithCFBundle", ## need to wrap CFBundle.h properly first
  33. ]
  34. def makerepairinstructions(self):
  35. return []
  36. if __name__ == "__main__":
  37. main()