diff options
Diffstat (limited to 'bitbake/lib/bb/parse/parse_c/BBHandler.py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_c/BBHandler.py | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/parse_c/BBHandler.py b/bitbake/lib/bb/parse/parse_c/BBHandler.py new file mode 100644 index 0000000000..300871d9e3 --- /dev/null +++ b/bitbake/lib/bb/parse/parse_c/BBHandler.py | |||
@@ -0,0 +1,65 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (C) 2006 Holger Hans Peter Freyther | ||
5 | # | ||
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
7 | # of this software and associated documentation files (the "Software"), to deal | ||
8 | # in the Software without restriction, including without limitation the rights | ||
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
10 | # copies of the Software, and to permit persons to whom the Software is | ||
11 | # furnished to do so, subject to the following conditions: | ||
12 | # | ||
13 | # The above copyright notice and this permission notice shall be included in all | ||
14 | # copies or substantial portions of the Software. | ||
15 | # | ||
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
19 | # SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
20 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
21 | # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR | ||
22 | # THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | # | ||
24 | |||
25 | from bb import data | ||
26 | from bb.parse import ParseError | ||
27 | |||
28 | # | ||
29 | # This is the Python Part of the Native Parser Implementation. | ||
30 | # We will only parse .bbclass, .inc and .bb files but no | ||
31 | # configuration files. | ||
32 | # supports, init and handle are the public methods used by | ||
33 | # parser module | ||
34 | # | ||
35 | # The rest of the methods are internal implementation details. | ||
36 | |||
37 | |||
38 | |||
39 | # | ||
40 | # internal | ||
41 | # | ||
42 | |||
43 | |||
44 | # | ||
45 | # public | ||
46 | # | ||
47 | def supports(fn, data): | ||
48 | return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc" | ||
49 | |||
50 | def init(fn, data): | ||
51 | print "Init" | ||
52 | |||
53 | def handle(fn, data, include): | ||
54 | print "" | ||
55 | print "fn: %s" % fn | ||
56 | print "data: %s" % data | ||
57 | print "include: %s" % include | ||
58 | |||
59 | pass | ||
60 | |||
61 | # Inform bitbake that we are a parser | ||
62 | # We need to define all three | ||
63 | from bb.parse import handlers | ||
64 | handlers.append( {'supports' : supports, 'handle': handle, 'init' : init}) | ||
65 | del handlers | ||