mostly cleanup, minor adds, pseudo code in gtkui.py
[hermes] / package / src / org / maemo / hermes / engine / syncjob.py
1 #!/usr/bin/env python
2
3 class SyncJob():
4
5     def __init__(self, services, original_contacts, progress_callback):
6         self._services = services
7         self._original_contacts = original_contacts
8     
9         
10     def run(self):
11         self._pre_process_contacts()
12         self._process_friends()
13         self._process_contacts()
14     
15     
16     def create_contact_for_friend(self, friend):
17         """Creates a contact for the friend:
18            FIXME: if we do it NOW, then that contact can be re-used and mapped to other unmatched friends
19            FIXME: should this really take place here ..."""
20         
21         pass
22     
23     
24     def register_match(self, contact, friend):
25         """Makes sure that when save is clicked,""" 
26     
27         
28     def get_unmatched_friends(self):
29         pass
30     
31     
32     def get_updated_contacts(self):
33         pass
34     
35     
36     def get_matched_contacts(self):
37         pass    
38     
39     
40     def _pre_process_contacts(self):
41         for contact in self._original_contacts:
42             for service in self._services:
43                 service.pre_process_contact(contact)
44     
45     
46     def _process_friends(self):
47         for service in self._services:
48             service.process_friends()
49     
50     
51     def _process_contacts(self):
52         for contact in self._original_contacts:
53             for service in self._services:
54                 service.process_contact(contact)