First pass of new structure. test.py is the only entrypoint which works as of this...
[hermes] / package / src / org / maemo / hermes / engine / service.py
1 class Service:
2     """The notional `Service' for a provider. This is responsible for communicating
3        with the backend service and enhancing contacts.
4        
5        Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
6        Released under the Artistic Licence."""
7
8
9     # -----------------------------------------------------------------------
10     def get_friends(self):
11         """Return a list of friends from this service, or 'None' if manual mapping
12            is not supported."""
13          
14         return None
15
16     
17     # -----------------------------------------------------------------------
18     def process_contact(self, contact, overwrite = False, friend = None):
19         """Called for each contact in the address book. Any friends linked to
20            from the contact should have their matching updated. The backend should 
21            enrich the contact with any meta-data it can; and return 'True' if any
22            information was updated. If 'friend' is provided, the information should
23            be retrieved from friend. This will be one of the entries from 
24            'get_friends' when manual mapping is being done."""
25            
26         pass
27     
28     
29     # -----------------------------------------------------------------------
30     def finalise(self, updated, overwrite = False):
31         """Once all contacts have been processed, allows for any tidy-up/additional
32            enrichment. If any contacts are updated at this stage, 'updated' should
33            be added to."""
34            
35         pass