diff --git a/src/incendium/constants.py b/src/incendium/constants.py index d9ce218..52f32c0 100644 --- a/src/incendium/constants.py +++ b/src/incendium/constants.py @@ -2,6 +2,40 @@ from __future__ import unicode_literals +__all__ = [ + "CANCEL_TEXT", + "CANNOT_DELETE_ELEMENT", + "CANNOT_EDIT_ELEMENT", + "CONFIRM", + "DEFAULT_LANGUAGE", + "EDIT_ERROR", + "EDIT_SUCCESS", + "EDIT_SUCCESS_WITH_ERRORS", + "EMPTY_STRING", + "ERROR_REPORT", + "ERROR_WINDOW_TITLE", + "FORM_ERROR", + "GATEWAY_EXCEPTION", + "INFO_WINDOW_TITLE", + "MSSQL_SERVER_EXCEPTION", + "NEW_LINE", + "NEW_TABBED_LINE", + "NO_TEXT", + "OK_TEXT", + "PROCEED_WITHOUT_SAVING_CHANGES", + "PROCEED_WITH_ROWS_DELETION", + "PROCEED_WITH_ROW_DELETION", + "PROCEED_WITH_SAVING_CHANGES", + "SENDER", + "SMTP", + "SUCCESS_WINDOW_TITLE", + "TABBED_LINE", + "UNEXPECTED_ERROR", + "UNEXPECTED_ERROR_CAUSED_BY", + "WARNING_WINDOW_TITLE", + "YES_TEXT", +] + # Email settings. SMTP = "mail.mycompany.com:25" SENDER = "no-reply@mycompany.com" diff --git a/src/incendium/helper/types.py b/src/incendium/helper/types.py index 8b1f275..406d316 100644 --- a/src/incendium/helper/types.py +++ b/src/incendium/helper/types.py @@ -4,6 +4,8 @@ from java.lang import Exception as JavaException +__all__ = ["AnyStr", "DictIntStringAny", "DictStringAny", "InnerException", "Number"] + AnyStr = Union[str, unicode] DictIntStringAny = Dict[Union[int, str, unicode], Any] DictStringAny = Dict[Union[str, unicode], Any] diff --git a/src/incendium/net.py b/src/incendium/net.py index 2ca0050..97055d2 100644 --- a/src/incendium/net.py +++ b/src/incendium/net.py @@ -3,12 +3,14 @@ from __future__ import unicode_literals __all__ = [ + "HTML_ESCAPE_TABLE", + "report_error", "send_high_priority_email", "send_html_email", "send_plain_text_email", ] -from typing import List +from typing import Dict, List import system.net @@ -23,7 +25,7 @@ "<": "<", "\n": "
", "\t": " " * 4, -} +} # type: Dict[AnyStr, AnyStr] def _html_escape(text): diff --git a/stubs/stubs/incendium/net.pyi b/stubs/stubs/incendium/net.pyi index 016fc76..026b9bd 100644 --- a/stubs/stubs/incendium/net.pyi +++ b/stubs/stubs/incendium/net.pyi @@ -1,13 +1,18 @@ -from typing import List +from typing import Dict, List from incendium.helper.types import AnyStr +HTML_ESCAPE_TABLE: Dict[AnyStr, AnyStr] + def send_html_email( subject: AnyStr, body: AnyStr, to: List[AnyStr], priority: AnyStr = ... ) -> None: ... def send_high_priority_email( subject: AnyStr, body: AnyStr, to: List[AnyStr] ) -> None: ... +def report_error( + subject: AnyStr, message: AnyStr, details: AnyStr, to: List[AnyStr] +) -> None: ... def send_plain_text_email( subject: AnyStr, body: AnyStr, to: List[AnyStr], priority: AnyStr = ... ) -> None: ...