Commits

Jonathan Eunice  committed cae7a84

More pep8 cleanups. Modified import strategy in __init__.py to use __all__ in
core.py

  • Participants
  • Parent commits 67e4834

Comments (0)

Files changed (2)

File namedentities/__init__.py

-from namedentities.core import named_entities, numeric_entities, hex_entities, \
-                               unicode_entities, unescape, \
-                               encode_ampersands
+from namedentities.core import *

File namedentities/core.py

 NAMED_ENT   = unicode('&{0};')
 NUMERIC_ENT = unicode('&#{0};')
 
+__all__ = """named_entities numeric_entities hex_entities
+             unicode_entities unescape encode_ampersands""".strip().split()
+
 
 def unescape(text):
     """
         text = m.group(0)
         if text[:2] == "&#":            # numeric entity
             try:
-                codepoint = int(text[3:-1], 16) if text[:3] == "&#x" else int(text[2:-1])
+                codepoint = int(text[3:-1], 16) if text[:3] == "&#x" \
+                            else int(text[2:-1])
                 if codepoint != 38 and codepoint != 60 and codepoint != 62:
                     return unichr(codepoint)
             except ValueError: