8000 Make setup.py source distribution work by dss09 · Pull Request #34 · charlierguo/gmail · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make setup.py source distribution work #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ tmtags

## Test Account details
spec/account.yml
dist
*.egg-info
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.md
26 changes: 18 additions & 8 deletions gmail/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def __init__(self, mailbox, uid):
self.thread_id = None
self.thread = []
self.message_id = None

self.attachments = None



def is_read(self):
Expand Down Expand Up @@ -166,13 +166,23 @@ def parse(self, raw_message):
if re.search(r'X-GM-MSGID (\d+)', raw_headers):
self.message_id = re.search(r'X-GM-MSGID (\d+)', raw_headers).groups(1)[0]


# Parse attachments into attachment objects array for this message
self.attachments = [
Attachment(attachment) for attachment in self.message._payload
if not isinstance(attachment, basestring) and attachment.get('Content-Disposition') is not None
]

self.attachments = []
def make_attachement(attachments):
for attachment in attachments:
if isinstance(attachment, basestring):
continue
if attachment.get_content_type() == 'message/rfc822':
make_attachement(attachment.get_payload())
else:
if not attachment.is_multipart():
self.attachments.append(Attachment(attachment))
else:
make_attachement(attachment.get_payload())

make_attachement(self.message.get_payload())


def fetch(self):
if not self.message:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(fname):

setup(
name = "gmail",
version = "0.0.5",
version = "0.0.7",
author = "Charlie Guo",
author_email = "FIXME",
description = ("A Pythonic interface for Google Mail."),
Expand Down
0