diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 15:47:39 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 15:47:39 -0500 |
commit | fe6a756f95d724456c368544949d41c16d0cc95b (patch) | |
tree | 655a0428186a7f911456d15b6f94af68c3f0e2d4 | |
parent | 032b5f464198b27d6163696484314ce19e7083e1 (diff) |
Simplified the builder registration.
-rw-r--r-- | beautifulsoup/builder/__init__.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/beautifulsoup/builder/__init__.py b/beautifulsoup/builder/__init__.py index 1ece168..5e55f7f 100644 --- a/beautifulsoup/builder/__init__.py +++ b/beautifulsoup/builder/__init__.py @@ -165,7 +165,7 @@ class HTMLTreeBuilder(TreeBuilder): return False -def register_builders_from(module, add_to_all) +def register_builders_from(module): # I'm fairly sure this is not the best way to do this. # Copy everything mentioned in the builder module's __all__ into @@ -174,10 +174,11 @@ def register_builders_from(module, add_to_all) for name in module.__all__: setattr(this_module, name, getattr(module, name)) - # Add all names from the builder module's __all__ to these names. - add_to_all += module.__all__ + # Add all names from the builder module's __all__ to this module's + # __all__. + this_module.__all__ += module.__all__ import _lxml -register_builders_from(_lxml, __all__) -import html5lib -register_builders_from(_html5lib, __all__) +register_builders_from(_lxml) +import _html5lib +register_builders_from(_html5lib) |