mirror of https://github.com/caronc/apprise
Added default configuration paths for Microsoft users (#111)
parent
9a26de53c3
commit
ac56a409a0
|
@ -25,9 +25,11 @@
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import logging
|
import logging
|
||||||
|
import platform
|
||||||
import sys
|
import sys
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
from os.path import expandvars
|
||||||
|
|
||||||
from . import NotifyType
|
from . import NotifyType
|
||||||
from . import Apprise
|
from . import Apprise
|
||||||
|
@ -54,6 +56,16 @@ DEFAULT_SEARCH_PATHS = (
|
||||||
'~/.config/apprise.yml',
|
'~/.config/apprise.yml',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Detect Windows
|
||||||
|
if platform.system() == 'Windows':
|
||||||
|
# Default Search Path for Windows Users
|
||||||
|
DEFAULT_SEARCH_PATHS = (
|
||||||
|
expandvars('%APPDATA%/Apprise/apprise'),
|
||||||
|
expandvars('%APPDATA%/Apprise/apprise.yml'),
|
||||||
|
expandvars('%LOCALAPPDATA%/Apprise/apprise'),
|
||||||
|
expandvars('%LOCALAPPDATA%/Apprise/apprise.yml'),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def print_help_msg(command):
|
def print_help_msg(command):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,11 +24,23 @@
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
import mock
|
||||||
from apprise import cli
|
from apprise import cli
|
||||||
from apprise import NotifyBase
|
from apprise import NotifyBase
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
from apprise.plugins import SCHEMA_MAP
|
from apprise.plugins import SCHEMA_MAP
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Python v3.4+
|
||||||
|
from importlib import reload
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
# Python v3.0-v3.3
|
||||||
|
from imp import reload
|
||||||
|
except ImportError:
|
||||||
|
# Python v2.7
|
||||||
|
pass
|
||||||
|
|
||||||
# Disable logging for a cleaner testing output
|
# Disable logging for a cleaner testing output
|
||||||
import logging
|
import logging
|
||||||
logging.disable(logging.CRITICAL)
|
logging.disable(logging.CRITICAL)
|
||||||
|
@ -157,3 +169,16 @@ def test_apprise_cli(tmpdir):
|
||||||
'--tag', 'tagd',
|
'--tag', 'tagd',
|
||||||
])
|
])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
|
||||||
|
|
||||||
|
@mock.patch('platform.system')
|
||||||
|
def test_apprise_cli_windows_env(mock_system):
|
||||||
|
"""
|
||||||
|
API: Apprise() CLI Windows Environment
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Force a windows environment
|
||||||
|
mock_system.return_value = 'Windows'
|
||||||
|
|
||||||
|
# Reload our module
|
||||||
|
reload(cli)
|
||||||
|
|
Loading…
Reference in New Issue