mirror of https://github.com/caronc/apprise
Refactor: Python Module Naming & Namespace Harmonization (#1119)
parent
08cb018e11
commit
b8da1334ab
|
@ -49,16 +49,17 @@ from .common import CONTENT_INCLUDE_MODES
|
||||||
from .common import ContentLocation
|
from .common import ContentLocation
|
||||||
from .common import CONTENT_LOCATIONS
|
from .common import CONTENT_LOCATIONS
|
||||||
|
|
||||||
from .URLBase import URLBase
|
from .url import URLBase
|
||||||
from .URLBase import PrivacyMode
|
from .url import PrivacyMode
|
||||||
from .plugins.NotifyBase import NotifyBase
|
from .plugins.base import NotifyBase
|
||||||
from .config.ConfigBase import ConfigBase
|
from .config.base import ConfigBase
|
||||||
from .attachment.AttachBase import AttachBase
|
from .attachment.base import AttachBase
|
||||||
|
|
||||||
from .Apprise import Apprise
|
from .apprise import Apprise
|
||||||
from .AppriseAsset import AppriseAsset
|
from .locale import AppriseLocale
|
||||||
from .AppriseConfig import AppriseConfig
|
from .asset import AppriseAsset
|
||||||
from .AppriseAttachment import AppriseAttachment
|
from .apprise_config import AppriseConfig
|
||||||
|
from .apprise_attachment import AppriseAttachment
|
||||||
|
|
||||||
from . import decorators
|
from . import decorators
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ logging.getLogger(__name__).addHandler(logging.NullHandler())
|
||||||
__all__ = [
|
__all__ = [
|
||||||
# Core
|
# Core
|
||||||
'Apprise', 'AppriseAsset', 'AppriseConfig', 'AppriseAttachment', 'URLBase',
|
'Apprise', 'AppriseAsset', 'AppriseConfig', 'AppriseAttachment', 'URLBase',
|
||||||
'NotifyBase', 'ConfigBase', 'AttachBase',
|
'NotifyBase', 'ConfigBase', 'AttachBase', 'AppriseLocale',
|
||||||
|
|
||||||
# Reference
|
# Reference
|
||||||
'NotifyType', 'NotifyImageSize', 'NotifyFormat', 'OverflowMode',
|
'NotifyType', 'NotifyImageSize', 'NotifyFormat', 'OverflowMode',
|
||||||
|
|
|
@ -33,18 +33,18 @@ from itertools import chain
|
||||||
from . import common
|
from . import common
|
||||||
from .conversion import convert_between
|
from .conversion import convert_between
|
||||||
from .utils import is_exclusive_match
|
from .utils import is_exclusive_match
|
||||||
from .NotificationManager import NotificationManager
|
from .manager_plugins import NotificationManager
|
||||||
from .utils import parse_list
|
from .utils import parse_list
|
||||||
from .utils import parse_urls
|
from .utils import parse_urls
|
||||||
from .utils import cwe312_url
|
from .utils import cwe312_url
|
||||||
from .emojis import apply_emojis
|
from .emojis import apply_emojis
|
||||||
from .logger import logger
|
from .logger import logger
|
||||||
from .AppriseAsset import AppriseAsset
|
from .asset import AppriseAsset
|
||||||
from .AppriseConfig import AppriseConfig
|
from .apprise_config import AppriseConfig
|
||||||
from .AppriseAttachment import AppriseAttachment
|
from .apprise_attachment import AppriseAttachment
|
||||||
from .AppriseLocale import AppriseLocale
|
from .locale import AppriseLocale
|
||||||
from .config.ConfigBase import ConfigBase
|
from .config.base import ConfigBase
|
||||||
from .plugins.NotifyBase import NotifyBase
|
from .plugins.base import NotifyBase
|
||||||
|
|
||||||
from . import plugins
|
from . import plugins
|
||||||
from . import __version__
|
from . import __version__
|
|
@ -27,9 +27,9 @@
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from . import URLBase
|
from . import URLBase
|
||||||
from .attachment.AttachBase import AttachBase
|
from .attachment.base import AttachBase
|
||||||
from .AppriseAsset import AppriseAsset
|
from .asset import AppriseAsset
|
||||||
from .AttachmentManager import AttachmentManager
|
from .manager_attachment import AttachmentManager
|
||||||
from .logger import logger
|
from .logger import logger
|
||||||
from .common import ContentLocation
|
from .common import ContentLocation
|
||||||
from .common import CONTENT_LOCATIONS
|
from .common import CONTENT_LOCATIONS
|
|
@ -28,9 +28,9 @@
|
||||||
|
|
||||||
from . import ConfigBase
|
from . import ConfigBase
|
||||||
from . import CONFIG_FORMATS
|
from . import CONFIG_FORMATS
|
||||||
from .ConfigurationManager import ConfigurationManager
|
from .manager_config import ConfigurationManager
|
||||||
from . import URLBase
|
from . import URLBase
|
||||||
from .AppriseAsset import AppriseAsset
|
from .asset import AppriseAsset
|
||||||
from . import common
|
from . import common
|
||||||
from .utils import GET_SCHEMA_RE
|
from .utils import GET_SCHEMA_RE
|
||||||
from .utils import parse_list
|
from .utils import parse_list
|
|
@ -33,7 +33,7 @@ from os.path import dirname
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from os.path import abspath
|
from os.path import abspath
|
||||||
from .common import NotifyType
|
from .common import NotifyType
|
||||||
from .NotificationManager import NotificationManager
|
from .manager_plugins import NotificationManager
|
||||||
|
|
||||||
|
|
||||||
# Grant access to our Notification Manager Singleton
|
# Grant access to our Notification Manager Singleton
|
|
@ -27,8 +27,8 @@
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
# Used for testing
|
# Used for testing
|
||||||
from .AttachBase import AttachBase
|
from .base import AttachBase
|
||||||
from ..AttachmentManager import AttachmentManager
|
from ..manager_attachment import AttachmentManager
|
||||||
|
|
||||||
# Initalize our Attachment Manager Singleton
|
# Initalize our Attachment Manager Singleton
|
||||||
A_MGR = AttachmentManager()
|
A_MGR = AttachmentManager()
|
||||||
|
@ -36,4 +36,5 @@ A_MGR = AttachmentManager()
|
||||||
__all__ = [
|
__all__ = [
|
||||||
# Reference
|
# Reference
|
||||||
'AttachBase',
|
'AttachBase',
|
||||||
|
'AttachmentManager',
|
||||||
]
|
]
|
||||||
|
|
|
@ -29,10 +29,10 @@
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import mimetypes
|
import mimetypes
|
||||||
from ..URLBase import URLBase
|
from ..url import URLBase
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..common import ContentLocation
|
from ..common import ContentLocation
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AttachBase(URLBase):
|
class AttachBase(URLBase):
|
|
@ -28,9 +28,9 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
from .AttachBase import AttachBase
|
from .base import AttachBase
|
||||||
from ..common import ContentLocation
|
from ..common import ContentLocation
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AttachFile(AttachBase):
|
class AttachFile(AttachBase):
|
|
@ -31,10 +31,10 @@ import os
|
||||||
import requests
|
import requests
|
||||||
import threading
|
import threading
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
from .AttachBase import AttachBase
|
from .base import AttachBase
|
||||||
from ..common import ContentLocation
|
from ..common import ContentLocation
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AttachHTTP(AttachBase):
|
class AttachHTTP(AttachBase):
|
|
@ -27,8 +27,8 @@
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
# Used for testing
|
# Used for testing
|
||||||
from .ConfigBase import ConfigBase
|
from .base import ConfigBase
|
||||||
from ..ConfigurationManager import ConfigurationManager
|
from ..manager_config import ConfigurationManager
|
||||||
|
|
||||||
# Initalize our Config Manager Singleton
|
# Initalize our Config Manager Singleton
|
||||||
C_MGR = ConfigurationManager()
|
C_MGR = ConfigurationManager()
|
||||||
|
@ -36,4 +36,5 @@ C_MGR = ConfigurationManager()
|
||||||
__all__ = [
|
__all__ = [
|
||||||
# Reference
|
# Reference
|
||||||
'ConfigBase',
|
'ConfigBase',
|
||||||
|
'ConfigurationManager',
|
||||||
]
|
]
|
||||||
|
|
|
@ -33,15 +33,15 @@ import time
|
||||||
|
|
||||||
from .. import plugins
|
from .. import plugins
|
||||||
from .. import common
|
from .. import common
|
||||||
from ..AppriseAsset import AppriseAsset
|
from ..asset import AppriseAsset
|
||||||
from ..URLBase import URLBase
|
from ..url import URLBase
|
||||||
from ..ConfigurationManager import ConfigurationManager
|
|
||||||
from ..utils import GET_SCHEMA_RE
|
from ..utils import GET_SCHEMA_RE
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import parse_urls
|
from ..utils import parse_urls
|
||||||
from ..utils import cwe312_url
|
from ..utils import cwe312_url
|
||||||
from ..NotificationManager import NotificationManager
|
from ..manager_config import ConfigurationManager
|
||||||
|
from ..manager_plugins import NotificationManager
|
||||||
|
|
||||||
# Test whether token is valid or not
|
# Test whether token is valid or not
|
||||||
VALID_TOKEN = re.compile(
|
VALID_TOKEN = re.compile(
|
|
@ -28,10 +28,10 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
from .ConfigBase import ConfigBase
|
from .base import ConfigBase
|
||||||
from ..common import ConfigFormat
|
from ..common import ConfigFormat
|
||||||
from ..common import ContentIncludeMode
|
from ..common import ContentIncludeMode
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class ConfigFile(ConfigBase):
|
class ConfigFile(ConfigBase):
|
|
@ -28,11 +28,11 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
from .ConfigBase import ConfigBase
|
from .base import ConfigBase
|
||||||
from ..common import ConfigFormat
|
from ..common import ConfigFormat
|
||||||
from ..common import ContentIncludeMode
|
from ..common import ContentIncludeMode
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Support YAML formats
|
# Support YAML formats
|
||||||
# text/yaml
|
# text/yaml
|
|
@ -26,8 +26,8 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from .ConfigBase import ConfigBase
|
from .base import ConfigBase
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class ConfigMemory(ConfigBase):
|
class ConfigMemory(ConfigBase):
|
|
@ -29,7 +29,7 @@
|
||||||
import re
|
import re
|
||||||
from markdown import markdown
|
from markdown import markdown
|
||||||
from .common import NotifyFormat
|
from .common import NotifyFormat
|
||||||
from .URLBase import URLBase
|
from .url import URLBase
|
||||||
|
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
# POSSIBILITY OF SUCH DAMAGE.USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# POSSIBILITY OF SUCH DAMAGE.USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from ..plugins.NotifyBase import NotifyBase
|
from ..plugins.base import NotifyBase
|
||||||
from ..NotificationManager import NotificationManager
|
from ..manager_plugins import NotificationManager
|
||||||
from ..utils import URL_DETAILS_RE
|
from ..utils import URL_DETAILS_RE
|
||||||
from ..utils import parse_url
|
from ..utils import parse_url
|
||||||
from ..utils import url_assembly
|
from ..utils import url_assembly
|
|
@ -26,7 +26,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from .CustomNotifyPlugin import CustomNotifyPlugin
|
from .base import CustomNotifyPlugin
|
||||||
|
|
||||||
|
|
||||||
def notify(on, name=None):
|
def notify(on, name=None):
|
||||||
|
|
|
@ -61,6 +61,9 @@ class PluginManager(metaclass=Singleton):
|
||||||
# The module path to scan
|
# The module path to scan
|
||||||
module_path = join(abspath(dirname(__file__)), _id)
|
module_path = join(abspath(dirname(__file__)), _id)
|
||||||
|
|
||||||
|
# For filtering our result when scanning a module
|
||||||
|
module_filter_re = re.compile(r'^(?P<name>((?!_)[A-Za-z0-9]+))$')
|
||||||
|
|
||||||
# thread safe loading
|
# thread safe loading
|
||||||
_lock = threading.Lock()
|
_lock = threading.Lock()
|
||||||
|
|
||||||
|
@ -177,7 +180,7 @@ class PluginManager(metaclass=Singleton):
|
||||||
# The .py extension is optional as we support loading directories
|
# The .py extension is optional as we support loading directories
|
||||||
# too
|
# too
|
||||||
module_re = re.compile(
|
module_re = re.compile(
|
||||||
r'^(?P<name>' + self.fname_prefix + r'[a-z0-9]+)(\.py)?$',
|
r'^(?P<name>(?!base|_)[a-z0-9_]+)(\.py)?$',
|
||||||
re.I)
|
re.I)
|
||||||
|
|
||||||
t_start = time.time()
|
t_start = time.time()
|
||||||
|
@ -188,10 +191,6 @@ class PluginManager(metaclass=Singleton):
|
||||||
# keep going
|
# keep going
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif match.group('name') == f'{self.fname_prefix}Base':
|
|
||||||
# keep going
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Store our notification/plugin name:
|
# Store our notification/plugin name:
|
||||||
module_name = match.group('name')
|
module_name = match.group('name')
|
||||||
module_pyname = '{}.{}'.format(module_name_prefix, module_name)
|
module_pyname = '{}.{}'.format(module_name_prefix, module_name)
|
||||||
|
@ -216,30 +215,24 @@ class PluginManager(metaclass=Singleton):
|
||||||
# logging found in import_module and not needed here
|
# logging found in import_module and not needed here
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not hasattr(module, module_name):
|
module_class = None
|
||||||
# Not a library we can load as it doesn't follow the simple
|
for m_class in [obj for obj in dir(module)
|
||||||
# rule that the class must bear the same name as the
|
if self.module_filter_re.match(obj)]:
|
||||||
# notification file itself.
|
|
||||||
logger.trace(
|
|
||||||
"%s (%s) import failed; no filename/Class "
|
|
||||||
"match found in %s",
|
|
||||||
self.name, module_name, os.path.join(module_path, f))
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Get our plugin
|
# Get our plugin
|
||||||
plugin = getattr(module, module_name)
|
plugin = getattr(module, m_class)
|
||||||
if not hasattr(plugin, 'app_id'):
|
if not hasattr(plugin, 'app_id'):
|
||||||
# Filter out non-notification modules
|
# Filter out non-notification modules
|
||||||
logger.trace(
|
logger.trace(
|
||||||
"(%s) import failed; no app_id defined in %s",
|
"(%s) import failed; no app_id defined in %s",
|
||||||
self.name, module_name, os.path.join(module_path, f))
|
self.name, m_class, os.path.join(module_path, f))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Add our plugin name to our module map
|
# Add our plugin name to our module map
|
||||||
self._module_map[module_name] = {
|
self._module_map[module_name] = {
|
||||||
'plugin': set([plugin]),
|
'plugin': set([plugin]),
|
||||||
'module': module,
|
'module': module,
|
||||||
'path': '{}.{}'.format(module_name_prefix, module_name),
|
'path': '{}.{}'.format(
|
||||||
|
module_name_prefix, module_name),
|
||||||
'native': True,
|
'native': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +251,20 @@ class PluginManager(metaclass=Singleton):
|
||||||
# Assign plugin
|
# Assign plugin
|
||||||
self._schema_map[schema] = plugin
|
self._schema_map[schema] = plugin
|
||||||
|
|
||||||
|
# Store our class
|
||||||
|
module_class = m_class
|
||||||
|
break
|
||||||
|
|
||||||
|
if not module_class:
|
||||||
|
# Not a library we can load as it doesn't follow the simple
|
||||||
|
# rule that the class must bear the same name as the
|
||||||
|
# notification file itself.
|
||||||
|
logger.trace(
|
||||||
|
"%s (%s) import failed; no filename/Class "
|
||||||
|
"match found in %s",
|
||||||
|
self.name, module_name, os.path.join(module_path, f))
|
||||||
|
continue
|
||||||
|
|
||||||
logger.trace(
|
logger.trace(
|
||||||
'{} {} loaded in {:.6f}s'.format(
|
'{} {} loaded in {:.6f}s'.format(
|
||||||
self.name, module_name, (time.time() - tl_start)))
|
self.name, module_name, (time.time() - tl_start)))
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
import re
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
from os.path import abspath
|
from os.path import abspath
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
@ -52,3 +53,7 @@ class AttachmentManager(PluginManager):
|
||||||
|
|
||||||
# The module path to scan
|
# The module path to scan
|
||||||
module_path = join(abspath(dirname(__file__)), _id)
|
module_path = join(abspath(dirname(__file__)), _id)
|
||||||
|
|
||||||
|
# For filtering our result set
|
||||||
|
module_filter_re = re.compile(
|
||||||
|
r'^(?P<name>' + fname_prefix + r'(?!Base)[A-Za-z0-9]+)$')
|
|
@ -26,6 +26,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
import re
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
from os.path import abspath
|
from os.path import abspath
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
@ -52,3 +53,7 @@ class ConfigurationManager(PluginManager):
|
||||||
|
|
||||||
# The module path to scan
|
# The module path to scan
|
||||||
module_path = join(abspath(dirname(__file__)), _id)
|
module_path = join(abspath(dirname(__file__)), _id)
|
||||||
|
|
||||||
|
# For filtering our result set
|
||||||
|
module_filter_re = re.compile(
|
||||||
|
r'^(?P<name>' + fname_prefix + r'(?!Base)[A-Za-z0-9]+)$')
|
|
@ -26,6 +26,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
import re
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
from os.path import abspath
|
from os.path import abspath
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
@ -52,3 +53,8 @@ class NotificationManager(PluginManager):
|
||||||
|
|
||||||
# The module path to scan
|
# The module path to scan
|
||||||
module_path = join(abspath(dirname(__file__)), _id)
|
module_path = join(abspath(dirname(__file__)), _id)
|
||||||
|
|
||||||
|
# For filtering our result set
|
||||||
|
module_filter_re = re.compile(
|
||||||
|
r'^(?P<name>' + fname_prefix +
|
||||||
|
r'(?!Base|ImageSize|Type)[A-Za-z0-9]+)$')
|
|
@ -30,7 +30,7 @@ import os
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
# Used for testing
|
# Used for testing
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
|
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NOTIFY_IMAGE_SIZES
|
from ..common import NOTIFY_IMAGE_SIZES
|
||||||
|
@ -40,9 +40,9 @@ from ..utils import parse_list
|
||||||
from ..utils import cwe312_url
|
from ..utils import cwe312_url
|
||||||
from ..utils import GET_SCHEMA_RE
|
from ..utils import GET_SCHEMA_RE
|
||||||
from ..logger import logger
|
from ..logger import logger
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..AppriseLocale import LazyTranslation
|
from ..locale import LazyTranslation
|
||||||
from ..NotificationManager import NotificationManager
|
from ..manager_plugins import NotificationManager
|
||||||
|
|
||||||
|
|
||||||
# Grant access to our Notification Manager Singleton
|
# Grant access to our Notification Manager Singleton
|
||||||
|
|
|
@ -31,12 +31,12 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AppriseAPIMethod:
|
class AppriseAPIMethod:
|
|
@ -70,9 +70,9 @@
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_call_sign
|
from ..utils import is_call_sign
|
||||||
from ..utils import parse_call_sign
|
from ..utils import parse_call_sign
|
|
@ -32,13 +32,13 @@
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Sounds generated off of: https://github.com/Finb/Bark/tree/master/Sounds
|
# Sounds generated off of: https://github.com/Finb/Bark/tree/master/Sounds
|
|
@ -30,7 +30,7 @@ import asyncio
|
||||||
import re
|
import re
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from ..URLBase import URLBase
|
from ..url import URLBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..common import NOTIFY_TYPES
|
from ..common import NOTIFY_TYPES
|
||||||
|
@ -38,8 +38,8 @@ from ..common import NotifyFormat
|
||||||
from ..common import NOTIFY_FORMATS
|
from ..common import NOTIFY_FORMATS
|
||||||
from ..common import OverflowMode
|
from ..common import OverflowMode
|
||||||
from ..common import OVERFLOW_MODES
|
from ..common import OVERFLOW_MODES
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..AppriseAttachment import AppriseAttachment
|
from ..apprise_attachment import AppriseAttachment
|
||||||
|
|
||||||
|
|
||||||
class NotifyBase(URLBase):
|
class NotifyBase(URLBase):
|
|
@ -35,14 +35,14 @@ from hashlib import sha1
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default to sending to all devices if nothing is specified
|
# Default to sending to all devices if nothing is specified
|
||||||
DEFAULT_TAG = '@all'
|
DEFAULT_TAG = '@all'
|
|
@ -36,13 +36,13 @@ import re
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
IS_GROUP_RE = re.compile(
|
IS_GROUP_RE = re.compile(
|
|
@ -35,13 +35,13 @@
|
||||||
# Messaging/post_messageSend
|
# Messaging/post_messageSend
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyBulkVS(NotifyBase):
|
class NotifyBulkVS(NotifyBase):
|
|
@ -33,14 +33,14 @@
|
||||||
#
|
#
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class BurstSMSCountryCode:
|
class BurstSMSCountryCode:
|
|
@ -35,10 +35,10 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyChantify(NotifyBase):
|
class NotifyChantify(NotifyBase):
|
|
@ -43,13 +43,13 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
||||||
CLICKSEND_HTTP_ERROR_MAP = {
|
CLICKSEND_HTTP_ERROR_MAP = {
|
|
@ -29,11 +29,11 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class FORMPayloadField:
|
class FORMPayloadField:
|
|
@ -30,11 +30,11 @@ import requests
|
||||||
import base64
|
import base64
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class JSONPayloadField:
|
class JSONPayloadField:
|
|
@ -30,11 +30,11 @@ import re
|
||||||
import requests
|
import requests
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class XMLPayloadField:
|
class XMLPayloadField:
|
|
@ -39,13 +39,13 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
||||||
D7NETWORKS_HTTP_ERROR_MAP = {
|
D7NETWORKS_HTTP_ERROR_MAP = {
|
|
@ -51,9 +51,9 @@ from json import dumps
|
||||||
import requests
|
import requests
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_call_sign
|
from ..utils import is_call_sign
|
||||||
from ..utils import parse_call_sign
|
from ..utils import parse_call_sign
|
|
@ -27,11 +27,11 @@
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default our global support flag
|
# Default our global support flag
|
||||||
NOTIFY_DBUS_SUPPORT_ENABLED = False
|
NOTIFY_DBUS_SUPPORT_ENABLED = False
|
|
@ -34,13 +34,13 @@ import base64
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Register at https://dingtalk.com
|
# Register at https://dingtalk.com
|
||||||
# - Download their PC based software as it is the only way you can create
|
# - Download their PC based software as it is the only way you can create
|
|
@ -50,14 +50,14 @@ from datetime import timedelta
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timezone
|
from datetime import timezone
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..attachment.AttachBase import AttachBase
|
from ..attachment.base import AttachBase
|
||||||
|
|
||||||
|
|
||||||
# Used to detect user/role IDs
|
# Used to detect user/role IDs
|
|
@ -41,12 +41,12 @@ from socket import error as SocketError
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timezone
|
from datetime import timezone
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyFormat, NotifyType
|
from ..common import NotifyFormat, NotifyType
|
||||||
from ..conversion import convert_between
|
from ..conversion import convert_between
|
||||||
from ..utils import is_ipaddr, is_email, parse_emails, is_hostname
|
from ..utils import is_ipaddr, is_email, parse_emails, is_hostname
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..logger import logger
|
from ..logger import logger
|
||||||
|
|
||||||
# Globally Default encoding mode set to Quoted Printable.
|
# Globally Default encoding mode set to Quoted Printable.
|
|
@ -34,12 +34,12 @@ import hashlib
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from .. import __version__ as VERSION
|
from .. import __version__ as VERSION
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyEmby(NotifyBase):
|
class NotifyEmby(NotifyBase):
|
|
@ -37,10 +37,10 @@
|
||||||
import requests
|
import requests
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class Enigma2MessageType:
|
class Enigma2MessageType:
|
|
@ -50,15 +50,15 @@
|
||||||
# You will need this in order to send an apprise messag
|
# You will need this in order to send an apprise messag
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from ..NotifyBase import NotifyBase
|
from ..base import NotifyBase
|
||||||
from ...common import NotifyType
|
from ...common import NotifyType
|
||||||
from ...utils import validate_regex
|
from ...utils import validate_regex
|
||||||
from ...utils import parse_list
|
from ...utils import parse_list
|
||||||
from ...utils import parse_bool
|
from ...utils import parse_bool
|
||||||
from ...utils import dict_full_update
|
from ...utils import dict_full_update
|
||||||
from ...common import NotifyImageSize
|
from ...common import NotifyImageSize
|
||||||
from ...AppriseAttachment import AppriseAttachment
|
from ...apprise_attachment import AppriseAttachment
|
||||||
from ...AppriseLocale import gettext_lazy as _
|
from ...locale import gettext_lazy as _
|
||||||
from .common import (FCMMode, FCM_MODES)
|
from .common import (FCMMode, FCM_MODES)
|
||||||
from .priority import (FCM_PRIORITIES, FCMPriorityManager)
|
from .priority import (FCM_PRIORITIES, FCMPriorityManager)
|
||||||
from .color import FCMColorManager
|
from .color import FCMColorManager
|
|
@ -36,7 +36,7 @@
|
||||||
import re
|
import re
|
||||||
from ...utils import parse_bool
|
from ...utils import parse_bool
|
||||||
from ...common import NotifyType
|
from ...common import NotifyType
|
||||||
from ...AppriseAsset import AppriseAsset
|
from ...asset import AppriseAsset
|
||||||
|
|
||||||
|
|
||||||
class FCMColorManager:
|
class FCMColorManager:
|
|
@ -36,10 +36,10 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyFeishu(NotifyBase):
|
class NotifyFeishu(NotifyBase):
|
|
@ -44,14 +44,14 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
|
@ -36,9 +36,9 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyFreeMobile(NotifyBase):
|
class NotifyFreeMobile(NotifyBase):
|
|
@ -26,11 +26,11 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default our global support flag
|
# Default our global support flag
|
||||||
NOTIFY_GNOME_SUPPORT_ENABLED = False
|
NOTIFY_GNOME_SUPPORT_ENABLED = False
|
|
@ -58,11 +58,11 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyGoogleChat(NotifyBase):
|
class NotifyGoogleChat(NotifyBase):
|
|
@ -34,10 +34,10 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType, NotifyFormat
|
from ..common import NotifyType, NotifyFormat
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Priorities
|
# Priorities
|
|
@ -26,12 +26,12 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default our global support flag
|
# Default our global support flag
|
||||||
NOTIFY_GROWL_SUPPORT_ENABLED = False
|
NOTIFY_GROWL_SUPPORT_ENABLED = False
|
|
@ -45,10 +45,11 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from .NotifyDiscord import NotifyDiscord
|
# Import namespace so the class won't conflict with the actual Notify object
|
||||||
|
from . import discord
|
||||||
|
|
||||||
|
|
||||||
class NotifyGuilded(NotifyDiscord):
|
class NotifyGuilded(discord.NotifyDiscord):
|
||||||
"""
|
"""
|
||||||
A wrapper to Guilded Notifications
|
A wrapper to Guilded Notifications
|
||||||
|
|
|
@ -34,11 +34,11 @@ from json import dumps
|
||||||
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyHomeAssistant(NotifyBase):
|
class NotifyHomeAssistant(NotifyBase):
|
|
@ -31,12 +31,12 @@
|
||||||
# https://httpsms.com
|
# https://httpsms.com
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyHttpSMS(NotifyBase):
|
class NotifyHttpSMS(NotifyBase):
|
|
@ -44,11 +44,11 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyIFTTT(NotifyBase):
|
class NotifyIFTTT(NotifyBase):
|
|
@ -39,13 +39,13 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
||||||
JOIN_HTTP_ERROR_MAP = {
|
JOIN_HTTP_ERROR_MAP = {
|
|
@ -38,12 +38,12 @@
|
||||||
import requests
|
import requests
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
||||||
# Based on https://kavenegar.com/rest.html
|
# Based on https://kavenegar.com/rest.html
|
|
@ -39,10 +39,10 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Extend HTTP Error Messages
|
# Extend HTTP Error Messages
|
||||||
KUMULOS_HTTP_ERROR_MAP = {
|
KUMULOS_HTTP_ERROR_MAP = {
|
|
@ -90,10 +90,10 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..utils import is_hostname
|
from ..utils import is_hostname
|
||||||
from ..utils import is_ipaddr
|
from ..utils import is_ipaddr
|
||||||
|
|
|
@ -33,14 +33,14 @@ import requests
|
||||||
import re
|
import re
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Used to break path apart into list of streams
|
# Used to break path apart into list of streams
|
|
@ -33,15 +33,15 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import is_hostname
|
from ..utils import is_hostname
|
||||||
from ..utils import is_ipaddr
|
from ..utils import is_ipaddr
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
|
|
||||||
|
|
||||||
class LunaSeaMode:
|
class LunaSeaMode:
|
|
@ -30,11 +30,11 @@ import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default our global support flag
|
# Default our global support flag
|
||||||
NOTIFY_MACOSX_SUPPORT_ENABLED = False
|
NOTIFY_MACOSX_SUPPORT_ENABLED = False
|
|
@ -56,7 +56,7 @@
|
||||||
#
|
#
|
||||||
import requests
|
import requests
|
||||||
from email.utils import formataddr
|
from email.utils import formataddr
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..utils import parse_emails
|
from ..utils import parse_emails
|
||||||
|
@ -64,7 +64,7 @@ from ..utils import parse_bool
|
||||||
from ..utils import is_email
|
from ..utils import is_email
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..logger import logger
|
from ..logger import logger
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Provide some known codes Mailgun uses and what they translate to:
|
# Provide some known codes Mailgun uses and what they translate to:
|
||||||
# Based on https://documentation.mailgun.com/en/latest/api-intro.html#errors
|
# Based on https://documentation.mailgun.com/en/latest/api-intro.html#errors
|
|
@ -33,16 +33,16 @@ from json import dumps, loads
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timezone
|
from datetime import timezone
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..attachment.AttachBase import AttachBase
|
from ..attachment.base import AttachBase
|
||||||
|
|
||||||
# Accept:
|
# Accept:
|
||||||
# - @username
|
# - @username
|
|
@ -37,8 +37,8 @@ from json import dumps
|
||||||
from json import loads
|
from json import loads
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
|
@ -46,7 +46,7 @@ from ..utils import parse_bool
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import is_hostname
|
from ..utils import is_hostname
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Define default path
|
# Define default path
|
||||||
MATRIX_V1_WEBHOOK_PATH = '/api/v1/matrix/hook'
|
MATRIX_V1_WEBHOOK_PATH = '/api/v1/matrix/hook'
|
|
@ -39,13 +39,13 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Some Reference Locations:
|
# Some Reference Locations:
|
||||||
# - https://docs.mattermost.com/developer/webhooks-incoming.html
|
# - https://docs.mattermost.com/developer/webhooks-incoming.html
|
|
@ -34,12 +34,12 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no
|
from ..utils import parse_phone_no
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyMessageBird(NotifyBase):
|
class NotifyMessageBird(NotifyBase):
|
|
@ -47,10 +47,10 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class MisskeyVisibility:
|
class MisskeyVisibility:
|
|
@ -38,12 +38,12 @@ import re
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Default our global support flag
|
# Default our global support flag
|
||||||
NOTIFY_MQTT_SUPPORT_ENABLED = False
|
NOTIFY_MQTT_SUPPORT_ENABLED = False
|
|
@ -38,12 +38,12 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_phone_no, parse_bool
|
from ..utils import parse_phone_no, parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class MSG91PayloadField:
|
class MSG91PayloadField:
|
|
@ -81,7 +81,7 @@ import requests
|
||||||
import json
|
import json
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
|
@ -89,8 +89,8 @@ from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import apply_template
|
from ..utils import apply_template
|
||||||
from ..utils import TemplateType
|
from ..utils import TemplateType
|
||||||
from ..AppriseAttachment import AppriseAttachment
|
from ..apprise_attachment import AppriseAttachment
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyMSTeams(NotifyBase):
|
class NotifyMSTeams(NotifyBase):
|
|
@ -28,11 +28,11 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyNextcloud(NotifyBase):
|
class NotifyNextcloud(NotifyBase):
|
|
@ -29,11 +29,11 @@
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyNextcloudTalk(NotifyBase):
|
class NotifyNextcloudTalk(NotifyBase):
|
|
@ -43,11 +43,11 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NoticaMode:
|
class NoticaMode:
|
|
@ -31,9 +31,9 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import parse_list, parse_bool
|
from ..utils import parse_list, parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
|
@ -44,11 +44,11 @@
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotificoFormat:
|
class NotificoFormat:
|
|
@ -41,18 +41,18 @@ from json import loads
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import is_hostname
|
from ..utils import is_hostname
|
||||||
from ..utils import is_ipaddr
|
from ..utils import is_ipaddr
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..attachment.AttachBase import AttachBase
|
from ..attachment.base import AttachBase
|
||||||
|
|
||||||
|
|
||||||
class NtfyMode:
|
class NtfyMode:
|
|
@ -64,14 +64,14 @@ from datetime import datetime
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from json import loads
|
from json import loads
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyFormat
|
from ..common import NotifyFormat
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_email
|
from ..utils import is_email
|
||||||
from ..utils import parse_emails
|
from ..utils import parse_emails
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyOffice365(NotifyBase):
|
class NotifyOffice365(NotifyBase):
|
|
@ -37,14 +37,14 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import is_email
|
from ..utils import is_email
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class OneSignalCategory:
|
class OneSignalCategory:
|
|
@ -49,13 +49,13 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import is_uuid
|
from ..utils import is_uuid
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class OpsgenieCategory(NotifyBase):
|
class OpsgenieCategory(NotifyBase):
|
|
@ -34,13 +34,13 @@
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class PagerDutySeverity:
|
class PagerDutySeverity:
|
|
@ -31,11 +31,11 @@ from json import dumps
|
||||||
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Actions
|
# Actions
|
|
@ -30,10 +30,10 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Used to break path apart into list of targets
|
# Used to break path apart into list of targets
|
||||||
TARGET_LIST_DELIM = re.compile(r'[ \t\r\n,\\/]+')
|
TARGET_LIST_DELIM = re.compile(r'[ \t\r\n,\\/]+')
|
|
@ -28,14 +28,14 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import is_email
|
from ..utils import is_email
|
||||||
from ..utils import is_phone_no
|
from ..utils import is_phone_no
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import parse_bool
|
from ..utils import parse_bool
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotifyPopcornNotify(NotifyBase):
|
class NotifyPopcornNotify(NotifyBase):
|
|
@ -28,10 +28,10 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
# Priorities
|
# Priorities
|
|
@ -30,13 +30,13 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..utils import is_email
|
from ..utils import is_email
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
from ..attachment.AttachBase import AttachBase
|
from ..attachment.base import AttachBase
|
||||||
|
|
||||||
# Flag used as a placeholder to sending to all devices
|
# Flag used as a placeholder to sending to all devices
|
||||||
PUSHBULLET_SEND_TO_ALL = 'ALL_DEVICES'
|
PUSHBULLET_SEND_TO_ALL = 'ALL_DEVICES'
|
|
@ -29,9 +29,9 @@
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Syntax:
|
# Syntax:
|
||||||
# schan://{key}/
|
# schan://{key}/
|
|
@ -31,12 +31,12 @@ import requests
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .base import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..url import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..locale import gettext_lazy as _
|
||||||
|
|
||||||
# Used to detect and parse channels
|
# Used to detect and parse channels
|
||||||
IS_CHANNEL = re.compile(r'^#?(?P<name>[A-Za-z0-9]+)$')
|
IS_CHANNEL = re.compile(r'^#?(?P<name>[A-Za-z0-9]+)$')
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue