Changeset 66

Show
Ignore:
Timestamp:
11/07/07 02:53:29 (1 year ago)
Author:
amcgregor
Message:

Added Revision keyword to appropriate files.

Location:
branches/3.0
Files:
1 added
13 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/setup.cfg

    • Property svn:keywords set to Revision
    r33 r66  
     1# $Revision$ 
     2 
    13[egg_info] 
    24tag_build = .dev 
  • branches/3.0/setup.py

    • Property svn:keywords set to Revision
    r52 r66  
    11#!/usr/bin/env python 
    22# encoding: utf-8 
     3 
     4__version__ = "$Revision$" 
    35 
    46import sys 
     
    6365                        'turbomail.extensions': [ 
    6466                                "utf8qp = turbomail.extensions.utf8qp", 
    65                                 "smime = turbomail.extensions.smime", 
     67#                               "smime = turbomail.extensions.smime", 
    6668#                               "gpg = turbomail.extensions.gpg", 
    6769                        ] 
  • branches/3.0/turbomail/api.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66__all__ = ['Extension', 'ProviderFactory', 'Provider', 'Manager'] 
    77 
  • branches/3.0/turbomail/control.py

    • Property svn:keywords set to Revision
    r65 r66  
    2020""" 
    2121 
    22 __version__ = "$Revision: 1 $" 
     22__version__ = "$Revision$" 
    2323 
    2424import logging 
  • branches/3.0/turbomail/exceptions.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""Exceptions used by TurboMail to report common errors.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66__all__ = ['MailException', 'MailNotEnabledError', 'MailConfigurationError', 'ProviderException', 'ProviderExhaustedException', 'ManagerException'] 
    77 
  • branches/3.0/turbomail/extensions/utf8qp.py

    • Property svn:keywords set to Revision
    r65 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import logging 
  • branches/3.0/turbomail/managers/demand.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import logging 
  • branches/3.0/turbomail/managers/immediate.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import logging 
  • branches/3.0/turbomail/message.py

    • Property svn:keywords set to Revision
    r52 r66  
    22 
    33"""MIME-encoded electronic mail message classes.""" 
     4 
     5__version__ = "$Revision$" 
    46 
    57import turbomail 
     
    1719from email.Header import Header 
    1820 
    19 from uuid import uuid4 as uuid 
     21from uuid import uuid1 as uuid 
    2022 
    2123import logging 
     
    3133        This allows you to define your own message to be delivered.""" 
    3234         
    33         def __init__(self, id=None, sender=None, recipients=[], message=None): 
    34                 self.id = id 
    35                 self.sender = sender 
    36                 self.recipients = recipients 
     35        def __init__(self, sender, recipient, message): 
     36                self.id = str(uuid()) 
     37                self.sender = AddressList(sender) 
     38                self.recipient = AddressList(recipient) 
    3739                self.message = message 
    3840                 
    39                 if not self.id: self.id = uuid() 
    40                  
    4141                super(StubMessage, self).__init__() 
     42         
     43        envelope = proeprty(lambda self: self.sender) 
    4244         
    4345        def __str__(self): 
     
    114116                if not self._id or (self._processed and self._dirty): 
    115117                        self.__dict__['_id'] = str(uuid()) 
     118                         
    116119                        self._processed = False 
    117120                 
     
    122125        def envelope(self): 
    123126                if self.sender and self.senders != self.author: 
    124                         return AddressList(self.senders) 
     127                        return AddressList(self.sender) 
    125128                return AddressList(self.author) 
    126129         
     
    132135        recipients = property(recipients) 
    133136         
    134         def mime(self): 
    135                 """Produce the final MIME message.""" 
    136  
    137                 assert self.author, "You must specify an author." 
    138                 assert self.subject, "You must specify a subject." 
    139                 assert self.to or self.cc or self.bcc, "You must specify at least one recipient." 
    140                 assert self.plain, "You must provide plain text content." 
    141  
    142                 #if not self._dirty and self._processed: 
    143                 #       return self._mime 
    144                  
    145                 self._processed = False 
    146                  
    147                 plain = MIMEText(self._callable(self.plain).encode(self.encoding), 'plain', self.encoding) 
    148                  
    149                 rich = None 
    150                 if self.rich: 
    151                         rich = MIMEText(self._callable(self.rich).encode(self.encoding), 'html', self.encoding) 
    152                  
    153                 def generate_mime(): 
    154                         if not rich: return plain 
    155                          
     137        def mimeDocument(self, plain, rich=None): 
     138                if not rich: 
     139                        message = plain 
     140                 
     141                else: 
    156142                        message = MIMEMultipart('alternative') 
    157143                        message.attach(plain) 
    158                          
     144                 
    159145                        if not self.embedded: 
    160146                                message.attach(rich) 
    161                          
     147                 
    162148                        else: 
    163149                                embedded = MIMEMultipart('related') 
     
    165151                                for attachment in self.embedded: embedded.attach(attachment) 
    166152                                message.attach(embedded) 
    167                          
    168                         return message 
    169                  
    170                 message = generate_mime() 
    171153                 
    172154                if self.attachments: 
     
    175157                        for attachment in self.attachments: attachments.attach(attachment) 
    176158                        message = attachments 
     159                 
     160                return message 
     161         
     162        def mime(self): 
     163                """Produce the final MIME message.""" 
     164 
     165                assert self.author, "You must specify an author." 
     166                assert self.subject, "You must specify a subject." 
     167                assert self.to or self.cc or self.bcc, "You must specify at least one recipient." 
     168                assert self.plain, "You must provide plain text content." 
     169 
     170                if not self._dirty and self._processed and not turbomail.config.get("mail.debug", False): 
     171                        return self._mime 
     172                 
     173                self._processed = False 
     174                 
     175                plain = MIMEText(self._callable(self.plain).encode(self.encoding), 'plain', self.encoding) 
     176                 
     177                rich = None 
     178                if self.rich: 
     179                        rich = MIMEText(self._callable(self.rich).encode(self.encoding), 'html', self.encoding) 
     180                 
     181                message = self.generate_mime_document(plain, rich) 
    177182                 
    178183                if hasattr(self, "process_mime_message"): 
     
    196201                                        ('X-Mailer', "%s <%s>" % (release.name, release.url)), 
    197202                                        ('X-TurboMail-Version', release.version), 
    198                                         ('X-TurboMail-Message-GUID', self.id), 
    199203                                ]) 
     204                         
     205                        if turbomail.config.get("mail.debug", False): 
     206                                headers.append(('X-TurboMail-Message-GUID', self.id)) 
    200207                         
    201208                        if turbomail.provider: 
  • branches/3.0/turbomail/providers/debug.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import logging 
  • branches/3.0/turbomail/providers/smtp.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""TurboMail extension API.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import logging 
  • branches/3.0/turbomail/release.py

    • Property svn:keywords set to Revision
    r64 r66  
    33"""Release information about TurboMail.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77name = "TurboMail" 
  • branches/3.0/turbomail/util.py

    • Property svn:keywords set to Revision
    r63 r66  
    33"""MIME-encoded electronic mail message classes.""" 
    44 
    5 __version__ = "$Revision: 1 $" 
     5__version__ = "$Revision$" 
    66 
    77import re