PyEmailerAJM 1.9.4__tar.gz → 1.9.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PKG-INFO +2 -2
- pyemailerajm-1.9.4.2/PyEmailerAJM/_version.py +1 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/backend/logger.py +5 -1
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/backend/the_sandman.py +10 -2
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/continuous_monitor.py +3 -3
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/continuous_monitor_alert_send.py +1 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/msg/alert_messages.py +1 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM.egg-info/PKG-INFO +2 -2
- pyemailerajm-1.9.4/PyEmailerAJM/_version.py +0 -1
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/LICENSE.txt +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/backend/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/backend/enums.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/backend/errs.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/continuous_colorizer.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/continuous_monitor_base.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/email_state.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/snooze_tracking.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/msg/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/msg/factory.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/msg/msg.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/py_emailer_ajm.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/searchers/__init__.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/searchers/factory.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/searchers/searchers.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM.egg-info/SOURCES.txt +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM.egg-info/dependency_links.txt +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM.egg-info/requires.txt +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM.egg-info/top_level.txt +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/README.md +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/setup.cfg +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/setup.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_PyEmailerAJM.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_continuous_monitor_base.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_email_signature.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_logger.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_msg_properties.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_searcher_factory.py +0 -0
- {pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/tests/test_snooze_tracking.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.9.4
|
|
3
|
+
Version: 1.9.4.2
|
|
4
4
|
Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
|
|
5
5
|
Home-page: https://github.com/amcsparron2793-Water/PyEmailer
|
|
6
|
-
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.9.4.tar.gz
|
|
6
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.9.4.2.tar.gz
|
|
7
7
|
Author: Amcsparron
|
|
8
8
|
Author-email: amcsparron@albanyny.gov
|
|
9
9
|
License: MIT License
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.9.4.2'
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
from logging import Filter, DEBUG, ERROR, Handler, FileHandler, StreamHandler, Logger, WARNING
|
|
2
|
-
from typing import Union
|
|
2
|
+
from typing import Union, TYPE_CHECKING
|
|
3
3
|
|
|
4
4
|
from EasyLoggerAJM import EasyLogger
|
|
5
5
|
from EasyLoggerAJM.logger_parts import OutlookEmailHandler, StreamHandlerIgnoreExecInfo
|
|
6
6
|
from PyEmailerAJM.msg import Msg
|
|
7
7
|
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
# noinspection PyProtectedMember
|
|
10
|
+
from EasyLoggerAJM.easy_logger import _EasyLoggerCustomLogger
|
|
11
|
+
|
|
8
12
|
|
|
9
13
|
class DupeDebugFilter(Filter):
|
|
10
14
|
PREFIXES_TO_IGNORE = ["FW:", "RE:"]
|
|
@@ -64,6 +64,7 @@ class TheSandman:
|
|
|
64
64
|
|
|
65
65
|
def _setup_sleep_in_rounds(self, **kwargs):
|
|
66
66
|
self.sleep_time_start = datetime.now().strftime('%m/%d/%Y %H:%M')
|
|
67
|
+
kwargs.setdefault('print_msg', True)
|
|
67
68
|
if self.use_visual_sleep:
|
|
68
69
|
kwargs['print_msg'] = False
|
|
69
70
|
self._is_time_remaining = False
|
|
@@ -77,7 +78,6 @@ class TheSandman:
|
|
|
77
78
|
|
|
78
79
|
def sleep_in_rounds(self, rounds=2, **kwargs):
|
|
79
80
|
kwargs = self._setup_sleep_in_rounds(**kwargs)
|
|
80
|
-
|
|
81
81
|
for sleep_round in range(rounds):
|
|
82
82
|
self._sleep_round(sleep_round, rounds, **kwargs)
|
|
83
83
|
|
|
@@ -95,6 +95,12 @@ class TheSandman:
|
|
|
95
95
|
else:
|
|
96
96
|
raise
|
|
97
97
|
|
|
98
|
+
def _basic_log_or_print_sleep_time_string(self, **kwargs):
|
|
99
|
+
if hasattr(self, 'logger'):
|
|
100
|
+
self.logger.info(self.sleep_time_string, **kwargs)
|
|
101
|
+
if kwargs.get('print_msg', False) and not hasattr(self, 'logger'):
|
|
102
|
+
print(self.sleep_time_string)
|
|
103
|
+
|
|
98
104
|
def sleep(self, sleep_time_seconds: int, **kwargs):
|
|
99
105
|
"""
|
|
100
106
|
:param sleep_time_seconds: The number of seconds the function should pause execution.
|
|
@@ -104,12 +110,14 @@ class TheSandman:
|
|
|
104
110
|
"""
|
|
105
111
|
|
|
106
112
|
self.sleep_time_string = self.sleep_time if not self._is_time_remaining else sleep_time_seconds
|
|
107
|
-
self.
|
|
113
|
+
self._basic_log_or_print_sleep_time_string(**kwargs)
|
|
114
|
+
|
|
108
115
|
if self.use_visual_sleep:
|
|
109
116
|
self.visual_sleep(sleep_time_seconds)
|
|
110
117
|
else:
|
|
111
118
|
sleep(sleep_time_seconds)
|
|
112
119
|
|
|
120
|
+
# TODO: this stays if standalone sandman is used
|
|
113
121
|
@classmethod
|
|
114
122
|
def is_snooze_expired(cls, snoozed_at: datetime, snooze_expiration_limit_hours: Optional[int] = None):
|
|
115
123
|
if not snooze_expiration_limit_hours:
|
{pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/continuous_monitor.py
RENAMED
|
@@ -91,7 +91,7 @@ class ContinuousMonitor(ContinuousMonitorBase):
|
|
|
91
91
|
|
|
92
92
|
self.snooze_tracker.snooze_msgs(self.all_messages)
|
|
93
93
|
|
|
94
|
-
def endless_watch(self, stop_condition: Callable[[], bool] = None):
|
|
94
|
+
def endless_watch(self, stop_condition: Callable[[], bool] = None, **kwargs):
|
|
95
95
|
if not self.dev_mode:
|
|
96
96
|
self._set_args_for_endless_watch()
|
|
97
97
|
|
|
@@ -102,9 +102,9 @@ class ContinuousMonitor(ContinuousMonitorBase):
|
|
|
102
102
|
|
|
103
103
|
while not stop_condition():
|
|
104
104
|
try:
|
|
105
|
-
self.check_for_alerts()
|
|
105
|
+
self.check_for_alerts(**kwargs)
|
|
106
106
|
self._was_refreshed = False
|
|
107
|
-
self.sleep_timer.sleep_in_rounds()
|
|
107
|
+
self.sleep_timer.sleep_in_rounds(**kwargs)
|
|
108
108
|
except KeyboardInterrupt:
|
|
109
109
|
self.logger.error("KeyboardInterrupt detected, exiting program.")
|
|
110
110
|
break
|
|
@@ -11,6 +11,7 @@ NO_COLORIZER = False
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
# TODO: create a version that does not monitor the inbox and only sends emails when triggered
|
|
14
|
+
# IE get rid of _AlertMsg etc for this new class - see HTTPServerMonitorEmail
|
|
14
15
|
class ContinuousMonitorAlertSend(ContinuousMonitor):
|
|
15
16
|
ADMIN_EMAIL_LOGGER = []
|
|
16
17
|
ADMIN_EMAIL = []
|
|
@@ -144,6 +144,7 @@ class _AlertMsgBase(Msg, _AlertCheckMethods):
|
|
|
144
144
|
if not snooze_checker_entry and self.msg_snoozed_time:
|
|
145
145
|
# FIXME: is this the cause of the "\snooze_tracking.py", line 102, in write_entry
|
|
146
146
|
# TypeError: fromisoformat: argument must be str
|
|
147
|
+
# TODO: change this to be able to accept a passed in class
|
|
147
148
|
snooze_expired = TheSandman.is_snooze_expired(self.msg_snoozed_time)
|
|
148
149
|
elif not snooze_checker_entry and not self.msg_snoozed_time:
|
|
149
150
|
snooze_expired = True
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.9.4
|
|
3
|
+
Version: 1.9.4.2
|
|
4
4
|
Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
|
|
5
5
|
Home-page: https://github.com/amcsparron2793-Water/PyEmailer
|
|
6
|
-
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.9.4.tar.gz
|
|
6
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.9.4.2.tar.gz
|
|
7
7
|
Author: Amcsparron
|
|
8
8
|
Author-email: amcsparron@albanyny.gov
|
|
9
9
|
License: MIT License
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.9.4'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyemailerajm-1.9.4 → pyemailerajm-1.9.4.2}/PyEmailerAJM/continuous_monitor/backend/email_state.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|