diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-08-22 23:31:37 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-08-22 23:31:37 (GMT) |
commit | d59f8d0691aff6649c70bfc764f7edce8d5f105c (patch) | |
tree | 308b621325a5dd2793d80a95e728fb6b6f035676 /Mac/Modules/ah/ahscan.py | |
parent | f34a8bced262ad63564336de128c32b72eefec44 (diff) | |
download | cpython-d59f8d0691aff6649c70bfc764f7edce8d5f105c.zip cpython-d59f8d0691aff6649c70bfc764f7edce8d5f105c.tar.gz cpython-d59f8d0691aff6649c70bfc764f7edce8d5f105c.tar.bz2 |
Interface to Apple Help Manager.
Diffstat (limited to 'Mac/Modules/ah/ahscan.py')
-rw-r--r-- | Mac/Modules/ah/ahscan.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Mac/Modules/ah/ahscan.py b/Mac/Modules/ah/ahscan.py new file mode 100644 index 0000000..cced19f --- /dev/null +++ b/Mac/Modules/ah/ahscan.py @@ -0,0 +1,52 @@ +# Scan an Apple header file, generating a Python file of generator calls. + +import sys +import os +from bgenlocations import TOOLBOXDIR, BGENDIR +sys.path.append(BGENDIR) +from scantools import Scanner_OSX + +LONG = "AppleHelp" +SHORT = "ah" +OBJECT = "NOTUSED" + +def main(): + input = LONG + ".h" + output = SHORT + "gen.py" + defsoutput = TOOLBOXDIR + LONG + ".py" + scanner = MyScanner(input, output, defsoutput) + scanner.scan() + scanner.close() + print "=== Testing definitions output code ===" + execfile(defsoutput, {}, {}) + print "=== Done scanning and generating, now importing the generated code... ===" + exec "import " + SHORT + "support" + print "=== Done. It's up to you to compile it now! ===" + +class MyScanner(Scanner_OSX): + + def destination(self, type, name, arglist): + classname = "Function" + listname = "functions" + if arglist: + t, n, m = arglist[0] + # This is non-functional today + if t == OBJECT and m == "InMode": + classname = "Method" + listname = "methods" + return classname, listname + + def makeblacklistnames(self): + return [ + ] + + def makeblacklisttypes(self): + return [ + ] + + def makerepairinstructions(self): + return [ + ] + +if __name__ == "__main__": + main() |