From 7cb6d424d009c03820d9cf140fa2d4c462c6ec8d Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Mon, 3 Oct 2022 10:49:37 -0700 Subject: [PATCH] Re-export parse/format classes from main module Allow users to simply `from llsd import LLSDBinaryParser` --- llsd/__init__.py | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/llsd/__init__.py b/llsd/__init__.py index 9727479..85c3471 100644 --- a/llsd/__init__.py +++ b/llsd/__init__.py @@ -9,31 +9,9 @@ """ from llsd.base import (_LLSD, BINARY_MIME_TYPE, NOTATION_MIME_TYPE, XML_MIME_TYPE, LLSDParseError, LLSDSerializationError, LongType, UnicodeType, binary, starts_with, undef, uri) -from llsd.serde_binary import format_binary, parse_binary -from llsd.serde_notation import format_notation, parse_notation -from llsd.serde_xml import format_pretty_xml, format_xml, parse_xml - -__all__ = [ - "BINARY_MIME_TYPE", - "LLSD", - "LLSDParseError", - "LLSDSerializationError", - "LongType", - "NOTATION_MIME_TYPE", - "UnicodeType", - "XML_MIME_TYPE", - "binary", - "format_binary", - "format_notation", - "format_pretty_xml", - "format_xml", - "parse", - "parse_binary", - "parse_notation", - "parse_xml", - "undef", - "uri", -] +from llsd.serde_binary import LLSDBinaryParser, format_binary, parse_binary +from llsd.serde_notation import LLSDNotationFormatter, LLSDNotationParser, format_notation, parse_notation +from llsd.serde_xml import LLSDXMLFormatter, LLSDXMLPrettyFormatter, format_pretty_xml, format_xml, parse_xml def parse(something, mime_type = None): @@ -81,4 +59,4 @@ def __str__(self): as_xml = staticmethod(format_xml) as_pretty_xml = staticmethod(format_pretty_xml) as_binary = staticmethod(format_binary) - as_notation = staticmethod(format_notation) \ No newline at end of file + as_notation = staticmethod(format_notation)