File: IBCarbonscan.py

package info (click to toggle)
python2.7 2.7.18-8%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,736 kB
  • sloc: python: 470,452; ansic: 443,657; sh: 17,616; asm: 14,304; makefile: 4,914; objc: 761; exp: 499; javascript: 314; cpp: 128; xml: 76
file content (47 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# IBCarbonscan.py

import sys

from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)

from scantools import Scanner_OSX

def main():
    print "---Scanning IBCarbonRuntime.h---"
    input = ["IBCarbonRuntime.h"]
    output = "IBCarbongen.py"
    defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
    scanner = IBCarbon_Scanner(input, output, defsoutput)
    scanner.scan()
    scanner.close()
    print "=== Testing definitions output code ==="
    execfile(defsoutput, {}, {})
    print "--done scanning, importing--"
    import IBCarbonsupport
    print "done"

class IBCarbon_Scanner(Scanner_OSX):

    def destination(self, type, name, arglist):
        classname = "IBCarbonFunction"
        listname = "functions"
        if arglist:
            t, n, m = arglist[0]
            if t == "IBNibRef" and m == "InMode":
                classname = "IBCarbonMethod"
                listname = "methods"
        return classname, listname

    def makeblacklistnames(self):
        return [
                "DisposeNibReference",                          # taken care of by destructor
                "CreateNibReferenceWithCFBundle",  ## need to wrap CFBundle.h properly first
                ]

    def makerepairinstructions(self):
        return []


if __name__ == "__main__":
    main()