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 CONTENT_LOCATIONS
|
||||
|
||||
from .URLBase import URLBase
|
||||
from .URLBase import PrivacyMode
|
||||
from .plugins.NotifyBase import NotifyBase
|
||||
from .config.ConfigBase import ConfigBase
|
||||
from .attachment.AttachBase import AttachBase
|
||||
from .url import URLBase
|
||||
from .url import PrivacyMode
|
||||
from .plugins.base import NotifyBase
|
||||
from .config.base import ConfigBase
|
||||
from .attachment.base import AttachBase
|
||||
|
||||
from .Apprise import Apprise
|
||||
from .AppriseAsset import AppriseAsset
|
||||
from .AppriseConfig import AppriseConfig
|
||||
from .AppriseAttachment import AppriseAttachment
|
||||
from .apprise import Apprise
|
||||
from .locale import AppriseLocale
|
||||
from .asset import AppriseAsset
|
||||
from .apprise_config import AppriseConfig
|
||||
from .apprise_attachment import AppriseAttachment
|
||||
|
||||
from . import decorators
|
||||
|
||||
|
@ -73,7 +74,7 @@ logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|||
__all__ = [
|
||||
# Core
|
||||
'Apprise', 'AppriseAsset', 'AppriseConfig', 'AppriseAttachment', 'URLBase',
|
||||
'NotifyBase', 'ConfigBase', 'AttachBase',
|
||||
'NotifyBase', 'ConfigBase', 'AttachBase', 'AppriseLocale',
|
||||
|
||||
# Reference
|
||||
'NotifyType', 'NotifyImageSize', 'NotifyFormat', 'OverflowMode',
|
||||
|
|
|
@ -33,18 +33,18 @@ from itertools import chain
|
|||
from . import common
|
||||
from .conversion import convert_between
|
||||
from .utils import is_exclusive_match
|
||||
from .NotificationManager import NotificationManager
|
||||
from .manager_plugins import NotificationManager
|
||||
from .utils import parse_list
|
||||
from .utils import parse_urls
|
||||
from .utils import cwe312_url
|
||||
from .emojis import apply_emojis
|
||||
from .logger import logger
|
||||
from .AppriseAsset import AppriseAsset
|
||||
from .AppriseConfig import AppriseConfig
|
||||
from .AppriseAttachment import AppriseAttachment
|
||||
from .AppriseLocale import AppriseLocale
|
||||
from .config.ConfigBase import ConfigBase
|
||||
from .plugins.NotifyBase import NotifyBase
|
||||
from .asset import AppriseAsset
|
||||
from .apprise_config import AppriseConfig
|
||||
from .apprise_attachment import AppriseAttachment
|
||||
from .locale import AppriseLocale
|
||||
from .config.base import ConfigBase
|
||||
from .plugins.base import NotifyBase
|
||||
|
||||
from . import plugins
|
||||
from . import __version__
|
|
@ -27,9 +27,9 @@
|
|||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from . import URLBase
|
||||
from .attachment.AttachBase import AttachBase
|
||||
from .AppriseAsset import AppriseAsset
|
||||
from .AttachmentManager import AttachmentManager
|
||||
from .attachment.base import AttachBase
|
||||
from .asset import AppriseAsset
|
||||
from .manager_attachment import AttachmentManager
|
||||
from .logger import logger
|
||||
from .common import ContentLocation
|
||||
from .common import CONTENT_LOCATIONS
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
from . import ConfigBase
|
||||
from . import CONFIG_FORMATS
|
||||
from .ConfigurationManager import ConfigurationManager
|
||||
from .manager_config import ConfigurationManager
|
||||
from . import URLBase
|
||||
from .AppriseAsset import AppriseAsset
|
||||
from .asset import AppriseAsset
|
||||
from . import common
|
||||
from .utils import GET_SCHEMA_RE
|
||||
from .utils import parse_list
|
|
@ -33,7 +33,7 @@ from os.path import dirname
|
|||
from os.path import isfile
|
||||
from os.path import abspath
|
||||
from .common import NotifyType
|
||||
from .NotificationManager import NotificationManager
|
||||
from .manager_plugins import NotificationManager
|
||||
|
||||
|
||||
# Grant access to our Notification Manager Singleton
|
|
@ -27,8 +27,8 @@
|
|||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Used for testing
|
||||
from .AttachBase import AttachBase
|
||||
from ..AttachmentManager import AttachmentManager
|
||||
from .base import AttachBase
|
||||
from ..manager_attachment import AttachmentManager
|
||||
|
||||
# Initalize our Attachment Manager Singleton
|
||||
A_MGR = AttachmentManager()
|
||||
|
@ -36,4 +36,5 @@ A_MGR = AttachmentManager()
|
|||
__all__ = [
|
||||
# Reference
|
||||
'AttachBase',
|
||||
'AttachmentManager',
|
||||
]
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
import os
|
||||
import time
|
||||
import mimetypes
|
||||
from ..URLBase import URLBase
|
||||
from ..url import URLBase
|
||||
from ..utils import parse_bool
|
||||
from ..common import ContentLocation
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class AttachBase(URLBase):
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
import re
|
||||
import os
|
||||
from .AttachBase import AttachBase
|
||||
from .base import AttachBase
|
||||
from ..common import ContentLocation
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class AttachFile(AttachBase):
|
|
@ -31,10 +31,10 @@ import os
|
|||
import requests
|
||||
import threading
|
||||
from tempfile import NamedTemporaryFile
|
||||
from .AttachBase import AttachBase
|
||||
from .base import AttachBase
|
||||
from ..common import ContentLocation
|
||||
from ..URLBase import PrivacyMode
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..url import PrivacyMode
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class AttachHTTP(AttachBase):
|
|
@ -27,8 +27,8 @@
|
|||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Used for testing
|
||||
from .ConfigBase import ConfigBase
|
||||
from ..ConfigurationManager import ConfigurationManager
|
||||
from .base import ConfigBase
|
||||
from ..manager_config import ConfigurationManager
|
||||
|
||||
# Initalize our Config Manager Singleton
|
||||
C_MGR = ConfigurationManager()
|
||||
|
@ -36,4 +36,5 @@ C_MGR = ConfigurationManager()
|
|||
__all__ = [
|
||||
# Reference
|
||||
'ConfigBase',
|
||||
'ConfigurationManager',
|
||||
]
|
||||
|
|
|
@ -33,15 +33,15 @@ import time
|
|||
|
||||
from .. import plugins
|
||||
from .. import common
|
||||
from ..AppriseAsset import AppriseAsset
|
||||
from ..URLBase import URLBase
|
||||
from ..ConfigurationManager import ConfigurationManager
|
||||
from ..asset import AppriseAsset
|
||||
from ..url import URLBase
|
||||
from ..utils import GET_SCHEMA_RE
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import parse_urls
|
||||
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
|
||||
VALID_TOKEN = re.compile(
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
import re
|
||||
import os
|
||||
from .ConfigBase import ConfigBase
|
||||
from .base import ConfigBase
|
||||
from ..common import ConfigFormat
|
||||
from ..common import ContentIncludeMode
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class ConfigFile(ConfigBase):
|
|
@ -28,11 +28,11 @@
|
|||
|
||||
import re
|
||||
import requests
|
||||
from .ConfigBase import ConfigBase
|
||||
from .base import ConfigBase
|
||||
from ..common import ConfigFormat
|
||||
from ..common import ContentIncludeMode
|
||||
from ..URLBase import PrivacyMode
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..url import PrivacyMode
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Support YAML formats
|
||||
# text/yaml
|
|
@ -26,8 +26,8 @@
|
|||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from .ConfigBase import ConfigBase
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from .base import ConfigBase
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class ConfigMemory(ConfigBase):
|
|
@ -29,7 +29,7 @@
|
|||
import re
|
||||
from markdown import markdown
|
||||
from .common import NotifyFormat
|
||||
from .URLBase import URLBase
|
||||
from .url import URLBase
|
||||
|
||||
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.
|
||||
|
||||
from ..plugins.NotifyBase import NotifyBase
|
||||
from ..NotificationManager import NotificationManager
|
||||
from ..plugins.base import NotifyBase
|
||||
from ..manager_plugins import NotificationManager
|
||||
from ..utils import URL_DETAILS_RE
|
||||
from ..utils import parse_url
|
||||
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
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from .CustomNotifyPlugin import CustomNotifyPlugin
|
||||
from .base import CustomNotifyPlugin
|
||||
|
||||
|
||||
def notify(on, name=None):
|
||||
|
|
|
@ -61,6 +61,9 @@ class PluginManager(metaclass=Singleton):
|
|||
# The module path to scan
|
||||
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
|
||||
_lock = threading.Lock()
|
||||
|
||||
|
@ -177,7 +180,7 @@ class PluginManager(metaclass=Singleton):
|
|||
# The .py extension is optional as we support loading directories
|
||||
# too
|
||||
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)
|
||||
|
||||
t_start = time.time()
|
||||
|
@ -188,10 +191,6 @@ class PluginManager(metaclass=Singleton):
|
|||
# keep going
|
||||
continue
|
||||
|
||||
elif match.group('name') == f'{self.fname_prefix}Base':
|
||||
# keep going
|
||||
continue
|
||||
|
||||
# Store our notification/plugin name:
|
||||
module_name = match.group('name')
|
||||
module_pyname = '{}.{}'.format(module_name_prefix, module_name)
|
||||
|
@ -216,7 +215,47 @@ class PluginManager(metaclass=Singleton):
|
|||
# logging found in import_module and not needed here
|
||||
continue
|
||||
|
||||
if not hasattr(module, module_name):
|
||||
module_class = None
|
||||
for m_class in [obj for obj in dir(module)
|
||||
if self.module_filter_re.match(obj)]:
|
||||
# Get our plugin
|
||||
plugin = getattr(module, m_class)
|
||||
if not hasattr(plugin, 'app_id'):
|
||||
# Filter out non-notification modules
|
||||
logger.trace(
|
||||
"(%s) import failed; no app_id defined in %s",
|
||||
self.name, m_class, os.path.join(module_path, f))
|
||||
continue
|
||||
|
||||
# Add our plugin name to our module map
|
||||
self._module_map[module_name] = {
|
||||
'plugin': set([plugin]),
|
||||
'module': module,
|
||||
'path': '{}.{}'.format(
|
||||
module_name_prefix, module_name),
|
||||
'native': True,
|
||||
}
|
||||
|
||||
fn = getattr(plugin, 'schemas', None)
|
||||
schemas = set([]) if not callable(fn) else fn(plugin)
|
||||
|
||||
# map our schema to our plugin
|
||||
for schema in schemas:
|
||||
if schema in self._schema_map:
|
||||
logger.error(
|
||||
"{} schema ({}) mismatch detected - {} to {}"
|
||||
.format(self.name, schema, self._schema_map,
|
||||
plugin))
|
||||
continue
|
||||
|
||||
# Assign 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.
|
||||
|
@ -226,38 +265,6 @@ class PluginManager(metaclass=Singleton):
|
|||
self.name, module_name, os.path.join(module_path, f))
|
||||
continue
|
||||
|
||||
# Get our plugin
|
||||
plugin = getattr(module, module_name)
|
||||
if not hasattr(plugin, 'app_id'):
|
||||
# Filter out non-notification modules
|
||||
logger.trace(
|
||||
"(%s) import failed; no app_id defined in %s",
|
||||
self.name, module_name, os.path.join(module_path, f))
|
||||
continue
|
||||
|
||||
# Add our plugin name to our module map
|
||||
self._module_map[module_name] = {
|
||||
'plugin': set([plugin]),
|
||||
'module': module,
|
||||
'path': '{}.{}'.format(module_name_prefix, module_name),
|
||||
'native': True,
|
||||
}
|
||||
|
||||
fn = getattr(plugin, 'schemas', None)
|
||||
schemas = set([]) if not callable(fn) else fn(plugin)
|
||||
|
||||
# map our schema to our plugin
|
||||
for schema in schemas:
|
||||
if schema in self._schema_map:
|
||||
logger.error(
|
||||
"{} schema ({}) mismatch detected - {} to {}"
|
||||
.format(self.name, schema, self._schema_map,
|
||||
plugin))
|
||||
continue
|
||||
|
||||
# Assign plugin
|
||||
self._schema_map[schema] = plugin
|
||||
|
||||
logger.trace(
|
||||
'{} {} loaded in {:.6f}s'.format(
|
||||
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
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import re
|
||||
from os.path import dirname
|
||||
from os.path import abspath
|
||||
from os.path import join
|
||||
|
@ -52,3 +53,7 @@ class AttachmentManager(PluginManager):
|
|||
|
||||
# The module path to scan
|
||||
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
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import re
|
||||
from os.path import dirname
|
||||
from os.path import abspath
|
||||
from os.path import join
|
||||
|
@ -52,3 +53,7 @@ class ConfigurationManager(PluginManager):
|
|||
|
||||
# The module path to scan
|
||||
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
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import re
|
||||
from os.path import dirname
|
||||
from os.path import abspath
|
||||
from os.path import join
|
||||
|
@ -52,3 +53,8 @@ class NotificationManager(PluginManager):
|
|||
|
||||
# The module path to scan
|
||||
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
|
||||
|
||||
# Used for testing
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NOTIFY_IMAGE_SIZES
|
||||
|
@ -40,9 +40,9 @@ from ..utils import parse_list
|
|||
from ..utils import cwe312_url
|
||||
from ..utils import GET_SCHEMA_RE
|
||||
from ..logger import logger
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..AppriseLocale import LazyTranslation
|
||||
from ..NotificationManager import NotificationManager
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..locale import LazyTranslation
|
||||
from ..manager_plugins import NotificationManager
|
||||
|
||||
|
||||
# Grant access to our Notification Manager Singleton
|
||||
|
|
|
@ -31,12 +31,12 @@ import requests
|
|||
from json import dumps
|
||||
import base64
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class AppriseAPIMethod:
|
|
@ -70,9 +70,9 @@
|
|||
import socket
|
||||
import sys
|
||||
from itertools import chain
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_call_sign
|
||||
from ..utils import parse_call_sign
|
|
@ -32,13 +32,13 @@
|
|||
import requests
|
||||
import json
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
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
|
|
@ -30,7 +30,7 @@ import asyncio
|
|||
import re
|
||||
from functools import partial
|
||||
|
||||
from ..URLBase import URLBase
|
||||
from ..url import URLBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..common import NOTIFY_TYPES
|
||||
|
@ -38,8 +38,8 @@ from ..common import NotifyFormat
|
|||
from ..common import NOTIFY_FORMATS
|
||||
from ..common import OverflowMode
|
||||
from ..common import OVERFLOW_MODES
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..AppriseAttachment import AppriseAttachment
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..apprise_attachment import AppriseAttachment
|
||||
|
||||
|
||||
class NotifyBase(URLBase):
|
|
@ -35,14 +35,14 @@ from hashlib import sha1
|
|||
from itertools import chain
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..utils import parse_bool
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..common import NotifyType
|
||||
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_TAG = '@all'
|
|
@ -36,13 +36,13 @@ import re
|
|||
import requests
|
||||
import json
|
||||
from itertools import chain
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
IS_GROUP_RE = re.compile(
|
|
@ -35,13 +35,13 @@
|
|||
# Messaging/post_messageSend
|
||||
import requests
|
||||
import json
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyBulkVS(NotifyBase):
|
|
@ -33,14 +33,14 @@
|
|||
#
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class BurstSMSCountryCode:
|
|
@ -35,10 +35,10 @@
|
|||
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyChantify(NotifyBase):
|
|
@ -43,13 +43,13 @@ import requests
|
|||
from json import dumps
|
||||
from base64 import b64encode
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Extend HTTP Error Messages
|
||||
CLICKSEND_HTTP_ERROR_MAP = {
|
|
@ -29,11 +29,11 @@
|
|||
import re
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class FORMPayloadField:
|
|
@ -30,11 +30,11 @@ import requests
|
|||
import base64
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class JSONPayloadField:
|
|
@ -30,11 +30,11 @@ import re
|
|||
import requests
|
||||
import base64
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class XMLPayloadField:
|
|
@ -39,13 +39,13 @@ import requests
|
|||
from json import dumps
|
||||
from json import loads
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import validate_regex
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Extend HTTP Error Messages
|
||||
D7NETWORKS_HTTP_ERROR_MAP = {
|
|
@ -51,9 +51,9 @@ from json import dumps
|
|||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_call_sign
|
||||
from ..utils import parse_call_sign
|
|
@ -27,11 +27,11 @@
|
|||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import sys
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Default our global support flag
|
||||
NOTIFY_DBUS_SUPPORT_ENABLED = False
|
|
@ -34,13 +34,13 @@ import base64
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Register at https://dingtalk.com
|
||||
# - 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 timezone
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..attachment.AttachBase import AttachBase
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..attachment.base import AttachBase
|
||||
|
||||
|
||||
# Used to detect user/role IDs
|
|
@ -41,12 +41,12 @@ from socket import error as SocketError
|
|||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyFormat, NotifyType
|
||||
from ..conversion import convert_between
|
||||
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
|
||||
|
||||
# Globally Default encoding mode set to Quoted Printable.
|
|
@ -34,12 +34,12 @@ import hashlib
|
|||
from json import dumps
|
||||
from json import loads
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..utils import parse_bool
|
||||
from ..common import NotifyType
|
||||
from .. import __version__ as VERSION
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyEmby(NotifyBase):
|
|
@ -37,10 +37,10 @@
|
|||
import requests
|
||||
from json import loads
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class Enigma2MessageType:
|
|
@ -50,15 +50,15 @@
|
|||
# You will need this in order to send an apprise messag
|
||||
import requests
|
||||
from json import dumps
|
||||
from ..NotifyBase import NotifyBase
|
||||
from ..base import NotifyBase
|
||||
from ...common import NotifyType
|
||||
from ...utils import validate_regex
|
||||
from ...utils import parse_list
|
||||
from ...utils import parse_bool
|
||||
from ...utils import dict_full_update
|
||||
from ...common import NotifyImageSize
|
||||
from ...AppriseAttachment import AppriseAttachment
|
||||
from ...AppriseLocale import gettext_lazy as _
|
||||
from ...apprise_attachment import AppriseAttachment
|
||||
from ...locale import gettext_lazy as _
|
||||
from .common import (FCMMode, FCM_MODES)
|
||||
from .priority import (FCM_PRIORITIES, FCMPriorityManager)
|
||||
from .color import FCMColorManager
|
|
@ -36,7 +36,7 @@
|
|||
import re
|
||||
from ...utils import parse_bool
|
||||
from ...common import NotifyType
|
||||
from ...AppriseAsset import AppriseAsset
|
||||
from ...asset import AppriseAsset
|
||||
|
||||
|
||||
class FCMColorManager:
|
|
@ -36,10 +36,10 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyFeishu(NotifyBase):
|
|
@ -44,14 +44,14 @@ import re
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
# Extend HTTP Error Messages
|
|
@ -36,9 +36,9 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyFreeMobile(NotifyBase):
|
|
@ -26,11 +26,11 @@
|
|||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Default our global support flag
|
||||
NOTIFY_GNOME_SUPPORT_ENABLED = False
|
|
@ -58,11 +58,11 @@ import re
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyGoogleChat(NotifyBase):
|
|
@ -34,10 +34,10 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType, NotifyFormat
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
# Priorities
|
|
@ -26,12 +26,12 @@
|
|||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Default our global support flag
|
||||
NOTIFY_GROWL_SUPPORT_ENABLED = False
|
|
@ -45,10 +45,11 @@
|
|||
#
|
||||
|
||||
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
|
||||
|
|
@ -34,11 +34,11 @@ from json import dumps
|
|||
|
||||
from uuid import uuid4
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyHomeAssistant(NotifyBase):
|
|
@ -31,12 +31,12 @@
|
|||
# https://httpsms.com
|
||||
import requests
|
||||
import json
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyHttpSMS(NotifyBase):
|
|
@ -44,11 +44,11 @@ import re
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyIFTTT(NotifyBase):
|
|
@ -39,13 +39,13 @@
|
|||
import re
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Extend HTTP Error Messages
|
||||
JOIN_HTTP_ERROR_MAP = {
|
|
@ -38,12 +38,12 @@
|
|||
import requests
|
||||
from json import loads
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Extend HTTP Error Messages
|
||||
# Based on https://kavenegar.com/rest.html
|
|
@ -39,10 +39,10 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Extend HTTP Error Messages
|
||||
KUMULOS_HTTP_ERROR_MAP = {
|
|
@ -90,10 +90,10 @@
|
|||
import re
|
||||
import requests
|
||||
from json import dumps
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
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_ipaddr
|
||||
|
|
@ -33,14 +33,14 @@ import requests
|
|||
import re
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import validate_regex
|
||||
from ..utils import parse_list
|
||||
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
|
|
@ -33,15 +33,15 @@ import re
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import parse_list
|
||||
from ..utils import is_hostname
|
||||
from ..utils import is_ipaddr
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..URLBase import PrivacyMode
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..url import PrivacyMode
|
||||
|
||||
|
||||
class LunaSeaMode:
|
|
@ -30,11 +30,11 @@ import platform
|
|||
import subprocess
|
||||
import os
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Default our global support flag
|
||||
NOTIFY_MACOSX_SUPPORT_ENABLED = False
|
|
@ -56,7 +56,7 @@
|
|||
#
|
||||
import requests
|
||||
from email.utils import formataddr
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyFormat
|
||||
from ..utils import parse_emails
|
||||
|
@ -64,7 +64,7 @@ from ..utils import parse_bool
|
|||
from ..utils import is_email
|
||||
from ..utils import validate_regex
|
||||
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:
|
||||
# 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 timezone
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..attachment.AttachBase import AttachBase
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..attachment.base import AttachBase
|
||||
|
||||
# Accept:
|
||||
# - @username
|
|
@ -37,8 +37,8 @@ from json import dumps
|
|||
from json import loads
|
||||
from time import time
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyFormat
|
||||
|
@ -46,7 +46,7 @@ from ..utils import parse_bool
|
|||
from ..utils import parse_list
|
||||
from ..utils import is_hostname
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Define default path
|
||||
MATRIX_V1_WEBHOOK_PATH = '/api/v1/matrix/hook'
|
|
@ -39,13 +39,13 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Some Reference Locations:
|
||||
# - https://docs.mattermost.com/developer/webhooks-incoming.html
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyMessageBird(NotifyBase):
|
|
@ -47,10 +47,10 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class MisskeyVisibility:
|
|
@ -38,12 +38,12 @@ import re
|
|||
from time import sleep
|
||||
from datetime import datetime
|
||||
from os.path import isfile
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Default our global support flag
|
||||
NOTIFY_MQTT_SUPPORT_ENABLED = False
|
|
@ -38,12 +38,12 @@
|
|||
import re
|
||||
import requests
|
||||
from json import dumps
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_phone_no, parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class MSG91PayloadField:
|
|
@ -81,7 +81,7 @@ import requests
|
|||
import json
|
||||
from json.decoder import JSONDecodeError
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyImageSize
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyFormat
|
||||
|
@ -89,8 +89,8 @@ from ..utils import parse_bool
|
|||
from ..utils import validate_regex
|
||||
from ..utils import apply_template
|
||||
from ..utils import TemplateType
|
||||
from ..AppriseAttachment import AppriseAttachment
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..apprise_attachment import AppriseAttachment
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyMSTeams(NotifyBase):
|
|
@ -28,11 +28,11 @@
|
|||
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyNextcloud(NotifyBase):
|
|
@ -29,11 +29,11 @@
|
|||
import requests
|
||||
|
||||
from json import dumps
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyNextcloudTalk(NotifyBase):
|
|
@ -43,11 +43,11 @@
|
|||
import re
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NoticaMode:
|
|
@ -31,9 +31,9 @@ import requests
|
|||
from json import dumps
|
||||
from itertools import chain
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import parse_list, parse_bool
|
||||
from ..utils import validate_regex
|
|
@ -44,11 +44,11 @@
|
|||
import re
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotificoFormat:
|
|
@ -41,18 +41,18 @@ from json import loads
|
|||
from json import dumps
|
||||
from os.path import basename
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
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_bool
|
||||
from ..utils import is_hostname
|
||||
from ..utils import is_ipaddr
|
||||
from ..utils import validate_regex
|
||||
from ..URLBase import PrivacyMode
|
||||
from ..attachment.AttachBase import AttachBase
|
||||
from ..url import PrivacyMode
|
||||
from ..attachment.base import AttachBase
|
||||
|
||||
|
||||
class NtfyMode:
|
|
@ -64,14 +64,14 @@ from datetime import datetime
|
|||
from datetime import timedelta
|
||||
from json import loads
|
||||
from json import dumps
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyFormat
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_email
|
||||
from ..utils import parse_emails
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyOffice365(NotifyBase):
|
|
@ -37,14 +37,14 @@ import requests
|
|||
from json import dumps
|
||||
from itertools import chain
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import validate_regex
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import is_email
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class OneSignalCategory:
|
|
@ -49,13 +49,13 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..utils import is_uuid
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class OpsgenieCategory(NotifyBase):
|
|
@ -34,13 +34,13 @@
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..common import NotifyImageSize
|
||||
from ..utils import validate_regex
|
||||
from ..utils import parse_bool
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class PagerDutySeverity:
|
|
@ -31,11 +31,11 @@ from json import dumps
|
|||
|
||||
from uuid import uuid4
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
# Actions
|
|
@ -30,10 +30,10 @@ import re
|
|||
import requests
|
||||
from json import dumps
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
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
|
||||
TARGET_LIST_DELIM = re.compile(r'[ \t\r\n,\\/]+')
|
|
@ -28,14 +28,14 @@
|
|||
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import is_email
|
||||
from ..utils import is_phone_no
|
||||
from ..utils import parse_list
|
||||
from ..utils import parse_bool
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
class NotifyPopcornNotify(NotifyBase):
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
import requests
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..common import NotifyType
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
|
||||
# Priorities
|
|
@ -30,13 +30,13 @@ import requests
|
|||
from json import dumps
|
||||
from json import loads
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..utils import is_email
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..attachment.AttachBase import AttachBase
|
||||
from ..locale import gettext_lazy as _
|
||||
from ..attachment.base import AttachBase
|
||||
|
||||
# Flag used as a placeholder to sending to all devices
|
||||
PUSHBULLET_SEND_TO_ALL = 'ALL_DEVICES'
|
|
@ -29,9 +29,9 @@
|
|||
import requests
|
||||
|
||||
from ..common import NotifyType
|
||||
from .NotifyBase import NotifyBase
|
||||
from .base import NotifyBase
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Syntax:
|
||||
# schan://{key}/
|
|
@ -31,12 +31,12 @@ import requests
|
|||
from json import dumps
|
||||
from itertools import chain
|
||||
|
||||
from .NotifyBase import NotifyBase
|
||||
from ..URLBase import PrivacyMode
|
||||
from .base import NotifyBase
|
||||
from ..url import PrivacyMode
|
||||
from ..common import NotifyType
|
||||
from ..utils import parse_list
|
||||
from ..utils import validate_regex
|
||||
from ..AppriseLocale import gettext_lazy as _
|
||||
from ..locale import gettext_lazy as _
|
||||
|
||||
# Used to detect and parse channels
|
||||
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