Skip to content

Commit

Permalink
added classifications to package
Browse files Browse the repository at this point in the history
  • Loading branch information
kootenpv committed Aug 4, 2015
1 parent 1fc3810 commit 49fb40c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bdist_rpm]
doc_files = README.rst

[bdist_wheel]
[wheel]
universal = 1
30 changes: 28 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

MAJOR_VERSION = '0'
MINOR_VERSION = '4'
MICRO_VERSION = '89'
MICRO_VERSION = '90'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)

setup(name = 'yagmail',
Expand All @@ -22,4 +22,30 @@
entry_points = {
'console_scripts': ['yagmail = yagmail.yagmail:main']
},
zip_safe = False)
classifiers = [
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Customer Service'
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: Microsoft',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Unix',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Communications :: Email',
'Topic :: Communications :: Email :: Email Clients (MUA)',
'Topic :: Software Development',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Debuggers',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Software Distribution',
'Topic :: System :: Systems Administration',
'Topic :: Utilities'
],
zip_safe = False)
2 changes: 1 addition & 1 deletion yagmail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__project__ = 'yagmail'
__version__ = "0.4.89"
__version__ = "0.4.90"

from .error import YagConnectionClosed
from .error import YagAddressError
Expand Down
16 changes: 8 additions & 8 deletions yagmail/yagmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,8 @@ def send(self, to = None, subject = None, contents = None, cc = None, bcc = None
addresses = self._resolveAddresses(to, cc, bcc, validate_email, throw_invalid_exception)
if not addresses['recipients']:
return {}
msg = self._prepare_message(addresses, subject, contents, use_cache)

if headers is not None:
# Strangely, msg does not have an update method, so then manually.
for k,v in headers.items():
msg[k] = v

msg = self._prepare_message(addresses, subject, contents, use_cache, headers)

if preview_only:
return addresses, msg.as_string()
return self._attempt_send(addresses['recipients'], msg.as_string())
Expand Down Expand Up @@ -180,14 +175,19 @@ def _resolveAddresses(self, to, cc, bcc, validate_email, throw_invalid_exception
addresses['recipients'].remove(email_addr)
return addresses

def _prepare_message(self, addresses, subject, contents, use_cache):
def _prepare_message(self, addresses, subject, contents, use_cache, headers):
""" Prepare a MIME message """
if self.is_closed:
raise YagConnectionClosed('Login required again')
if isinstance(contents, str):
contents = [contents]
has_embedded_images, content_objects = self._prepare_contents(contents, use_cache)
msg = MIMEMultipart()
if headers is not None:
# Strangely, msg does not have an update method, so then manually.
for k,v in headers.items():
msg[k] = v

msg_alternative = MIMEMultipart('alternative')
msg_related = MIMEMultipart('related')
msg.attach(msg_alternative)
Expand Down

0 comments on commit 49fb40c

Please sign in to comment.