Changeset 23:adc5b22efd7e in mailjam
- Timestamp:
- May 22, 2012, 7:31:12 PM (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
MANIFEST
r17 r23 2 2 README 3 3 setup.py 4 bin/mailjam-cli 4 5 bin/mailjam-mta 5 6 bin/mailjam-server 6 7 mailjam/__init__.py 8 mailjam/cli.py 7 9 mailjam/config.py 8 10 mailjam/daemon.py -
bin/mailjam-mta
r21 r23 3 3 # Run the Mailjam MTA client 4 4 5 import argparse , sys5 import argparse 6 6 from mailjam.mta import MTAClient 7 7 -
mailjam/config.py
r20 r23 89 89 return self.config[section] 90 90 91 91 92 class MTAClientConfig(DaemonConfig): 92 93 @property … … 97 98 def sections(self): 98 99 return ['server', 'archive'] 100 101 102 class CLIClientConfig(DaemonConfig): 103 @property 104 def default_filename(self): 105 return 'mailjam-cli.conf' 106 107 @property 108 def sections(self): 109 return ['server', 'archive', 'history'] 99 110 100 111 -
mailjam/daemon.py
r20 r23 163 163 def _listMethods(self): 164 164 public_methods = [] 165 public_methods += ['lists.'+i for i in dir(MailingListXMLRPC) if '_' not in i] 166 public_methods += ['members.'+i for i in dir(MemberXMLRPC) if '_' not in i] 165 public_methods += ['lists.'+i for i in dir(MailingListXMLRPC) \ 166 if '_' not in i] 167 public_methods += ['members.'+i for i in dir(MemberXMLRPC) \ 168 if '_' not in i] 167 169 return public_methods 168 170 … … 177 179 self.mailjam.load() 178 180 def add(self, info={}): 179 self.mailjam.add_mailing_list(info) 181 try: 182 self.mailjam.add_mailing_list(info) 183 except IndexError, e: 184 return str(e) 185 return 'Added mailing list ' + info['address'] 180 186 def addresses(self): 181 return self.mailjam.mailings_addresses 187 return self.mailjam.mailings_addresses 182 188 183 189 … … 187 193 self.mailjam.load() 188 194 def add(self, member_addr=None, list_addr=None): 189 self.mailjam.add_mailing_member(member_addr, list_addr) 195 try: 196 self.mailjam.add_mailing_member(member_addr, list_addr) 197 except IndexError, e: 198 return str(e) 199 return 'Added member ' + member_addr + ' to ' + list_addr 190 200 def list(self, mailing): 191 201 if mailing in self.mailjam.mailings_addresses: -
mailjam/models.py
r16 r23 33 33 def _validate_address(self, address): 34 34 if not validate_email_address(address): 35 raise ValueError( address,' is not a valid email address')35 raise ValueError(str(address) + ' is not a valid email address') 36 36 return address 37 37 … … 63 63 def _validate_member_object(self, member=None): 64 64 if not isinstance(member, Member): 65 raise TypeError( member,' is not a valid Member instance')65 raise TypeError(str(member) + ' is not a valid Member instance') 66 66 return member 67 67 … … 72 72 def _validate_member_by_address(self, address=None): 73 73 if not validate_email_address(address): 74 raise ValueError( address,' is not a valid email address')74 raise ValueError(str(address) + ' is not a valid email address') 75 75 return address in self.members_addresses() 76 76 -
setup.py
r16 r23 23 23 description='Mailing lists management software', 24 24 long_description=open('README').read(), 25 scripts=['bin/mailjam-server', 'bin/mailjam-mta' ],25 scripts=['bin/mailjam-server', 'bin/mailjam-mta', 'bin/mailjam-cli'], 26 26 #data_files=[(proper_etc_path()+'mailjam', ['conf/mailjam.conf', 27 27 # 'conf/mailjam-mta.conf']),
Note:
See TracChangeset
for help on using the changeset viewer.