diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-22 13:53:11 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-23 09:22:44 +0100 |
| commit | c8cce4e0d6c25e4ee85cf23790363905a188eef4 (patch) | |
| tree | 820fb80062e12004f54a6919c74345abd77d9676 /bitbake/lib/bb/methodpool.py | |
| parent | 43cbd5afceff490d4691dcc841f8b3aa7cfbcb87 (diff) | |
| download | poky-c8cce4e0d6c25e4ee85cf23790363905a188eef4.tar.gz | |
bitbake: methodpool: Clean up the parsed module list handling to be slightly less insane
This removes some dubious functions and replaces them with a simpler, cleaner
API which better describes what the code is doing. Unused code/variables are
removed and comments tweaked.
(Bitbake rev: f1e943aebfb84e98253f3f21646d6765c4fa1d66)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/methodpool.py')
| -rw-r--r-- | bitbake/lib/bb/methodpool.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bitbake/lib/bb/methodpool.py b/bitbake/lib/bb/methodpool.py index 3b8e5c1137..2fb5d96a3f 100644 --- a/bitbake/lib/bb/methodpool.py +++ b/bitbake/lib/bb/methodpool.py | |||
| @@ -33,9 +33,7 @@ | |||
| 33 | from bb.utils import better_compile, better_exec | 33 | from bb.utils import better_compile, better_exec |
| 34 | from bb import error | 34 | from bb import error |
| 35 | 35 | ||
| 36 | # A dict of modules we have handled | 36 | # A dict of function names we have seen |
| 37 | # it is the number of .bbclasses + x in size | ||
| 38 | _parsed_methods = { } | ||
| 39 | _parsed_fns = { } | 37 | _parsed_fns = { } |
| 40 | 38 | ||
| 41 | def insert_method(modulename, code, fn): | 39 | def insert_method(modulename, code, fn): |
| @@ -56,15 +54,18 @@ def insert_method(modulename, code, fn): | |||
| 56 | else: | 54 | else: |
| 57 | _parsed_fns[name] = modulename | 55 | _parsed_fns[name] = modulename |
| 58 | 56 | ||
| 57 | # A dict of modules the parser has finished with | ||
| 58 | _parsed_methods = {} | ||
| 59 | |||
| 59 | def parsed_module(modulename): | 60 | def parsed_module(modulename): |
| 60 | """ | 61 | """ |
| 61 | Inform me file xyz was parsed | 62 | Has module been parsed? |
| 62 | """ | 63 | """ |
| 63 | return modulename in _parsed_methods | 64 | return modulename in _parsed_methods |
| 64 | 65 | ||
| 65 | 66 | def set_parsed_module(modulename): | |
| 66 | def get_parsed_dict(): | ||
| 67 | """ | 67 | """ |
| 68 | shortcut | 68 | Set module as parsed |
| 69 | """ | 69 | """ |
| 70 | return _parsed_methods | 70 | _parsed_methods[modulename] = True |
| 71 | |||
