~jhonnyc/cgmail/jonathanc-branch

« back to all changes in this revision

Viewing changes to src/baseaccountmanager.py

  • Committer: Marco Ferragina
  • Date: 2007-05-06 15:51:12 UTC
  • Revision ID: marco.ferragina@gmail.com-20070506155112-874uk2m8blrknyuf
Restructured package source dir. Now is much more organized. Implemented right click menu on account window treeview

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
class CannotSaveError: pass
2
 
 
3
 
class BaseAccountManager:
4
 
        def get_accounts_dicts(self): 
5
 
                """
6
 
                must return a list of accounts dictionaries
7
 
                """
8
 
                raise NotImplementedError()
9
 
        def remove_account(self, id): raise NotImplementedError()
10
 
        
11
 
        
12
 
        def update_account(self, id, dic):
13
 
                """
14
 
                Update account id with the new dic
15
 
                """
16
 
                self.remove_account(id)
17
 
                self.add_account(dic, force_id = id)
18
 
 
19
 
        def add_account(self, dic): 
20
 
                """
21
 
                return the account id
22
 
                """
23
 
                raise NotImplementedError()
24
 
 
25
 
        def store_accounts_dicts(self, dicts): 
26
 
                """
27
 
                Set the accounts dicts to dicts
28
 
                """
29
 
                for account in dicts:
30
 
                        self.add_account(account)
31
 
 
32
 
        def reset(self): 
33
 
                """
34
 
                This method must reset the account manager.
35
 
                After this method account manager store support
36
 
                (xml file, gnome keyring) must be empty
37
 
                """
38
 
                raise NotImplementedError()