PyEmailerAJM 1.8.2__tar.gz → 1.8.4__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.8.2 → pyemailerajm-1.8.4}/PKG-INFO +2 -2
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/__init__.py +1 -6
- pyemailerajm-1.8.4/PyEmailerAJM/_version.py +1 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/backend/logger.py +3 -16
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/py_emailer_ajm.py +43 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/searchers/searchers.py +2 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM.egg-info/PKG-INFO +2 -2
- pyemailerajm-1.8.2/PyEmailerAJM/_version.py +0 -1
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/LICENSE.txt +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/backend/__init__.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/backend/enums.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/backend/errs.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/backend/the_sandman.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/__init__.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/__init__.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/continuous_colorizer.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/continuous_monitor_base.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/email_state.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/snooze_tracking.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/continuous_monitor.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/continuous_monitor_alert_send.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/msg/__init__.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/msg/alert_messages.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/msg/factory.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/msg/msg.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/searchers/__init__.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM.egg-info/SOURCES.txt +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM.egg-info/dependency_links.txt +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM.egg-info/requires.txt +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM.egg-info/top_level.txt +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/README.md +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/setup.cfg +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/setup.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/tests/test_PyEmailerAJM.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/tests/test_logger.py +0 -0
- {pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/tests/test_snooze_tracking.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
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.8.
|
|
6
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.8.4.tar.gz
|
|
7
7
|
Author: Amcsparron
|
|
8
8
|
Author-email: amcsparron@albanyny.gov
|
|
9
9
|
License: MIT License
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
1
|
from importlib import import_module
|
|
3
|
-
# TODO: add these to other projects? and or EasyLogger?
|
|
4
|
-
__project_root__ = Path(__file__).parent.parent
|
|
5
|
-
__project_name__ = __project_root__.name
|
|
6
|
-
print(f'logs for {__project_name__} found in {__project_root__ / "logs"}')
|
|
7
2
|
|
|
8
3
|
|
|
9
4
|
def is_instance_of_dynamic(obj: object, base_class_path: str) -> bool:
|
|
@@ -29,5 +24,5 @@ from PyEmailerAJM.continuous_monitor.continuous_monitor import ContinuousMonitor
|
|
|
29
24
|
__all__ = ['EmailerNotSetupError', 'DisplayManualQuit', 'deprecated',
|
|
30
25
|
'Msg', 'FailedMsg', 'PyEmailer', 'EmailerInitializer',
|
|
31
26
|
'BaseSearcher', 'SubjectSearcher', 'ContinuousMonitor',
|
|
32
|
-
'
|
|
27
|
+
'is_instance_of_dynamic']
|
|
33
28
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.8.4'
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from logging import Filter, DEBUG, ERROR, Handler, FileHandler, StreamHandler, Logger, WARNING
|
|
2
|
-
from pathlib import Path
|
|
3
2
|
from typing import Union
|
|
4
3
|
|
|
5
4
|
from EasyLoggerAJM import EasyLogger, OutlookEmailHandler, StreamHandlerIgnoreExecInfo
|
|
6
5
|
from PyEmailerAJM.msg import Msg
|
|
7
|
-
from PyEmailerAJM import __project_name__, __project_root__
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
class DupeDebugFilter(Filter):
|
|
@@ -31,8 +29,6 @@ class DupeDebugFilter(Filter):
|
|
|
31
29
|
|
|
32
30
|
|
|
33
31
|
class PyEmailerLogger(EasyLogger):
|
|
34
|
-
ROOT_LOG_LOCATION_DEFAULT = Path(__project_root__, 'logs').resolve()
|
|
35
|
-
|
|
36
32
|
def __call__(self):
|
|
37
33
|
return self.logger
|
|
38
34
|
|
|
@@ -56,11 +52,12 @@ class PyEmailerLogger(EasyLogger):
|
|
|
56
52
|
:return: None
|
|
57
53
|
:rtype: None
|
|
58
54
|
"""
|
|
55
|
+
email_handler_class = kwargs.get('email_handler_class', OutlookEmailHandler)
|
|
59
56
|
# noinspection PyTypeChecker
|
|
60
|
-
|
|
57
|
+
email_handler_class.VALID_EMAIL_MSG_TYPES = [Msg]
|
|
61
58
|
try:
|
|
62
59
|
# noinspection PyTypeChecker
|
|
63
|
-
email_handler =
|
|
60
|
+
email_handler = email_handler_class(email_msg=kwargs.get('email_msg', None),
|
|
64
61
|
project_name=self.project_name,
|
|
65
62
|
logger_dir_path=self.log_location,
|
|
66
63
|
recipient=kwargs.get('logger_admins', None))
|
|
@@ -78,16 +75,6 @@ class PyEmailerLogger(EasyLogger):
|
|
|
78
75
|
def _add_filter_to_stream_handler(self, handler: StreamHandler):
|
|
79
76
|
self._add_dupe_debug_to_handler(handler)
|
|
80
77
|
|
|
81
|
-
@property
|
|
82
|
-
def project_name(self):
|
|
83
|
-
return super().project_name
|
|
84
|
-
|
|
85
|
-
@project_name.setter
|
|
86
|
-
def project_name(self, value):
|
|
87
|
-
if value is None:
|
|
88
|
-
value = __project_name__
|
|
89
|
-
super().__setattr__('_project_name', value)
|
|
90
|
-
|
|
91
78
|
def create_stream_handler(self, log_level_to_stream=WARNING, **kwargs):
|
|
92
79
|
stream_handler = kwargs.get('stream_handler_instance', StreamHandlerIgnoreExecInfo())
|
|
93
80
|
super().create_stream_handler(log_level_to_stream=log_level_to_stream,
|
|
@@ -30,6 +30,15 @@ from PyEmailerAJM.searchers import SubjectSearcher
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class EmailerInitializer:
|
|
33
|
+
"""
|
|
34
|
+
A class responsible for initializing and handling email-related operations through a specified
|
|
35
|
+
email application and namespace. The class uses COM (Component Object Model) to interact with
|
|
36
|
+
the email application and provides mechanisms for logging and email management.
|
|
37
|
+
|
|
38
|
+
Attributes:
|
|
39
|
+
DEFAULT_EMAIL_APP_NAME (str): Default application name for email, set to 'outlook.application'.
|
|
40
|
+
DEFAULT_NAMESPACE_NAME (str): Default namespace name for the email application, set to 'MAPI'.
|
|
41
|
+
"""
|
|
33
42
|
DEFAULT_EMAIL_APP_NAME = 'outlook.application'
|
|
34
43
|
DEFAULT_NAMESPACE_NAME = 'MAPI'
|
|
35
44
|
|
|
@@ -80,6 +89,40 @@ class EmailerInitializer:
|
|
|
80
89
|
|
|
81
90
|
|
|
82
91
|
class PyEmailer(EmailerInitializer, SubjectSearcher):
|
|
92
|
+
"""
|
|
93
|
+
The `PyEmailer` class is designed for managing and handling email-related operations.
|
|
94
|
+
It initializes email client settings, manages email folders, handles email messages,
|
|
95
|
+
and supports common email-related functionalities such as tracking, setting up emails,
|
|
96
|
+
and saving attachments.
|
|
97
|
+
The class extends functionality from `EmailerInitializer` and `SubjectSearcher`.
|
|
98
|
+
|
|
99
|
+
Attributes:
|
|
100
|
+
- `tab_char`: Specifies the tab character to be used.
|
|
101
|
+
- `signature_dir_path`: Defines the file path to the email signature directory.
|
|
102
|
+
- `DisplayEmailSendTrackingWarning`: Warning message displayed when email tracking cannot ensure delivery success.
|
|
103
|
+
- `FAILED_SEND_LOGGER_STRING`: Format string for logging failed email sends.
|
|
104
|
+
- `DEFAULT_TEMP_SAVE_PATH`: Default temporary directory for saving temporary files.
|
|
105
|
+
- `VALID_EMAIL_FOLDER_CHOICES`: List of valid folder indices for email directories.
|
|
106
|
+
|
|
107
|
+
Methods:
|
|
108
|
+
- `__init__`: Initializes an instance of the `PyEmailer` class with specified settings and optional arguments.
|
|
109
|
+
- `current_user_email`: Getter and setter for retrieving or setting the current user's email address.
|
|
110
|
+
- `email_signature`: Property that retrieves the email signature from a specified signature file.
|
|
111
|
+
- `send_success`: Getter and setter to track the send status of an email.
|
|
112
|
+
- `_display_tracking_warning_confirm`: Handles display and confirmation of email tracking warnings interactively.
|
|
113
|
+
- `display_tracker_check`: Prompts the user to confirm understanding of the email tracking warning; raises an exception if canceled.
|
|
114
|
+
- `_get_default_folder_for_email_dir`: Retrieves the default folder for a specified email directory index.
|
|
115
|
+
- `_GetReadFolder`: Helper method that retrieves the specified email folder or default folder, along with an optional subfolder.
|
|
116
|
+
- `GetMessages`: Retrieves messages from a specified folder or the currently set folder.
|
|
117
|
+
- `GetEmailMessageBody`: Deprecated method to retrieve the body of an email message; use the `Msg` class's `body` attribute instead.
|
|
118
|
+
- `FindMsgBySubject`: Deprecated method to search for messages by subject; use `find_messages_by_subject`.
|
|
119
|
+
- `SaveAllEmailAttachments`: Saves all attachments of a specified email to a given directory path.
|
|
120
|
+
- `SetupEmail`: Configures an email with recipient, subject, text, and optional attachments.
|
|
121
|
+
- `_manual_send_loop`: Handles an interactive loop to allow the manual sending of an email.
|
|
122
|
+
|
|
123
|
+
This class provides comprehensive methods and attributes for streamlining email-related workflows.
|
|
124
|
+
It emphasizes interaction, logging, and error handling for robust functionality.
|
|
125
|
+
"""
|
|
83
126
|
# the email tab_char
|
|
84
127
|
tab_char = ' '
|
|
85
128
|
signature_dir_path = join((environ['USERPROFILE']),
|
|
@@ -48,6 +48,8 @@ class BaseSearcher:
|
|
|
48
48
|
if msg:
|
|
49
49
|
matched_messages.append(msg)
|
|
50
50
|
continue
|
|
51
|
+
self.logger.info(f"{len(matched_messages)} messages found!")#, print_msg=True)
|
|
52
|
+
self.logger.info("Search Complete, returning Msg's")
|
|
51
53
|
return [m() for m in matched_messages]
|
|
52
54
|
|
|
53
55
|
def _search_for_match(self, normalized_search_str: str, message: CDispatch, normalized_message_attr: str,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
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.8.
|
|
6
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.8.4.tar.gz
|
|
7
7
|
Author: Amcsparron
|
|
8
8
|
Author-email: amcsparron@albanyny.gov
|
|
9
9
|
License: MIT License
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.8.2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/email_state.py
RENAMED
|
File without changes
|
{pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/backend/snooze_tracking.py
RENAMED
|
File without changes
|
{pyemailerajm-1.8.2 → pyemailerajm-1.8.4}/PyEmailerAJM/continuous_monitor/continuous_monitor.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
|