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 | |
parent | 43cbd5afceff490d4691dcc841f8b3aa7cfbcb87 (diff) | |
download | openembedded-core-contrib-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')
-rw-r--r-- | bitbake/lib/bb/methodpool.py | 17 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 2 |
3 files changed, 10 insertions, 10 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 @@ from bb.utils import better_compile, better_exec from bb import error -# A dict of modules we have handled -# it is the number of .bbclasses + x in size -_parsed_methods = { } +# A dict of function names we have seen _parsed_fns = { } def insert_method(modulename, code, fn): @@ -56,15 +54,18 @@ def insert_method(modulename, code, fn): else: _parsed_fns[name] = modulename +# A dict of modules the parser has finished with +_parsed_methods = {} + def parsed_module(modulename): """ - Inform me file xyz was parsed + Has module been parsed? """ return modulename in _parsed_methods - -def get_parsed_dict(): +def set_parsed_module(modulename): """ - shortcut + Set module as parsed """ - return _parsed_methods + _parsed_methods[modulename] = True + diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index b88d5f5b39..4d3a623aa2 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -31,7 +31,6 @@ import itertools from bb import methodpool from bb.parse import logger -__parsed_methods__ = bb.methodpool.get_parsed_dict() _bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]") class StatementGroup(list): diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 625a2a21fd..2e0647b5df 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -161,7 +161,7 @@ def handle(fn, d, include): # we have parsed the bb class now if ext == ".bbclass" or ext == ".inc": - bb.methodpool.get_parsed_dict()[base_name] = 1 + bb.methodpool.set_parsed_module(base_name) return d |