Changeset 10:d5329a2a05b7 in mailjam for postman/mta.py


Ignore:
Timestamp:
May 20, 2012, 9:39:51 AM (12 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Fully added support for the configuration file. Now all the code uses
postman.conf to read the configuration parameters from it

Added a tests/postman.conf configuration file with specific configurtion
to use while testing (mostly tmp paths)

Updated the run_tests script to delete the temporary directory where
data is saved while running tests

Updated the tests modules/files so they use the tests config file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postman/mta.py

    r2 r10  
    88class Sendmail():
    99   
    10     def __init__(self, mailing_list=None):
     10    def __init__(self, mailing_list=None, configfile=None):
    1111        if not isinstance(mailing_list, MailingList):
    1212            raise ValueError(mailing_list, ' is not a valid mailing list')
     
    1616        self.raw_email = None
    1717        self.queue = []
    18         self.archive = self.mailing_list.config.get('archive',
    19                                                     config.archive_path)
     18        self.archive_config = config.get_config_parameters('archive',
     19                                                           configfile)
    2020       
    2121    def get_raw_email(self):
     
    3131            # check, would be nice here
    3232            self.get_raw_email
    33         filename = os.path.join(self.archive,
     33        filename = os.path.join(self.archive_config['path'],
    3434                                datetime.today().strftime('%Y%d%m%H%M%S%f'))
    3535        tmpfile = file(filename, 'w')
Note: See TracChangeset for help on using the changeset viewer.