~much-devs/muchmuch/trunk

« back to all changes in this revision

Viewing changes to lib/MuchMuch/mailroom.py

  • Committer: Martin Owens
  • Date: 2011-10-01 07:17:32 UTC
  • Revision ID: doctormo@gmail.com-20111001071732-9k6lde1vry8ve3en
Add in account creation testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
            raise KeyError("Can't find email account: %s" % account_id)
56
56
        return obj.address
57
57
 
58
 
    @dbus_method(SOA, in_signature='s', out_signature='b')
59
 
    def CreateAccount(self, email):
 
58
    @dbus_method(SOA, in_signature='ss', out_signature='b')
 
59
    def CreateAccount(self, type_id, email):
60
60
        """Create a new email account"""
 
61
        acc_id = self.accounts.create_account(type_id, email)
 
62
        if acc_id:
 
63
            self.AccountCreated(acc_id)
 
64
            return True
61
65
        return False
62
66
 
 
67
 
63
68
    @dbus_method(SOA, in_signature='s', out_signature='b')
64
69
    def DeleteMailSlot(self, account_id):
65
70
        """Delete an Email Account"""
112
117
# ======= Signals ========= #
113
118
 
114
119
    @dbus_signal(SOA, signature='s')
115
 
    def MailAccountCreated(self, account_id):
 
120
    def AccountCreated(self, account_id):
116
121
        """Signal to record account creation."""
117
122
 
118
123
    @dbus_signal(SOA, signature='s')
119
 
    def MailAccountDeleted(self, account_id):
 
124
    def AccountDeleted(self, account_id):
120
125
        """Signal to record account deletion."""
121
126
 
122
127
    @dbus_signal(SOA, signature='s')