Changeset 23:adc5b22efd7e in mailjam for mailjam/models.py


Ignore:
Timestamp:
May 22, 2012, 7:31:12 PM (12 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Added the first version of the CLI client, which implements a shell-like
interface where users can interact with a mailjam server.

This first versions adds no "big" features, but contains the basis to build
a complete shell interface (including history saving support, completion,
help for commands, etc)

Added a custom configuration file (conf/mailjam-cli.conf) for the CLI
client.

Added a new mailjam.config class (CLIClientConfig) that is used by the CLI
client to load its configuration file.

Updated the package information (setup.py, MANIFEST) to include the CLI
client data.

Modified the behaviour of the XMLRPC methods registered in the *XMLRPC classes
within the daemon module. Now instead of raising exceptions directly, they
catch such exceptions, returning only a string representation of the error
to the XMLRPC client. If there is no error, a nice "ok" message is returned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mailjam/models.py

    r16 r23  
    3333    def _validate_address(self, address):
    3434        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')
    3636        return address
    3737
     
    6363    def _validate_member_object(self, member=None):
    6464        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')
    6666        return member
    6767
     
    7272    def _validate_member_by_address(self, address=None):
    7373        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')
    7575        return address in self.members_addresses()
    7676
Note: See TracChangeset for help on using the changeset viewer.