* Fixed/removed some warnings
authorepage <eopage@byu.net>
Sat, 9 Aug 2008 13:10:49 +0000 (13:10 +0000)
committerepage <eopage@byu.net>
Sat, 9 Aug 2008 13:10:49 +0000 (13:10 +0000)
* Added evolution as a recommended dependency
* Added more foundational code for actually using the new addressbook system

git-svn-id: file:///svnroot/gc-dialer/trunk@127 c39d3808-3fe2-4d86-a59f-b7f623ee9f21

src/gc_dialer.py
support/DEBIAN/control
support/pylint.rc

index 142a8dd..77a4962 100755 (executable)
@@ -138,7 +138,7 @@ def make_idler(func):
        """
        a = []
 
        """
        a = []
 
-       def callable(*args, **kwds):
+       def decorated_func(*args, **kwds):
                if not a:
                        a.append(func(*args, **kwds))
                try:
                if not a:
                        a.append(func(*args, **kwds))
                try:
@@ -147,11 +147,11 @@ def make_idler(func):
                except StopIteration:
                        return False
        
                except StopIteration:
                        return False
        
-       callable.__name__ = func.__name__
-       callable.__doc__ = func.__doc__
-       callable.__dict__.update(func.__dict__)
+       decorated_func.__name__ = func.__name__
+       decorated_func.__doc__ = func.__doc__
+       decorated_func.__dict__.update(func.__dict__)
 
 
-       return callable
+       return decorated_func
 
 
 class DummyAddressBook(object):
 
 
 class DummyAddressBook(object):
@@ -208,12 +208,12 @@ class SettingsWindow(object):
                return button_handler
 
        def run(self, contactDetails):
                return button_handler
 
        def run(self, contactDetails):
-               self._typemodel.clear()
+               self._booksList.clear()
 
                for phoneType, phoneNumber in contactDetails:
 
                for phoneType, phoneNumber in contactDetails:
-                       self._typemodel.append((phoneNumber, "%s - %s" % (make_pretty(phoneNumber), phoneType)))
+                       self._booksList.append((phoneNumber, "%s - %s" % (make_pretty(phoneNumber), phoneType)))
 
 
-               self._dialog.run()
+               userResponse = self._dialog.run()
 
                if userResponse == gtk.RESPONSE_OK:
                        pass
 
                if userResponse == gtk.RESPONSE_OK:
                        pass
@@ -300,6 +300,7 @@ class Dialpad(object):
                self._clipboard = gtk.clipboard_get()
 
                self._deviceIsOnline = True
                self._clipboard = gtk.clipboard_get()
 
                self._deviceIsOnline = True
+               self.callbacklist = None
                self._callbackNeedsSetup = True
 
                self._recenttime = 0.0
                self._callbackNeedsSetup = True
 
                self._recenttime = 0.0
@@ -428,6 +429,14 @@ class Dialpad(object):
 
                self._gcBackend = GCDialer()
 
 
                self._gcBackend = GCDialer()
 
+               self._addressBookFactories = [
+                       DummyAddressBook(),
+                       EvolutionAddressBook(),
+                       self._gcBackend,
+               ]
+               self._addressBook = None
+               self.open_addressbook(*self.get_addressbooks().next()[0:2])
+
                self._phoneTypeSelector = PhoneTypeSelector(self._widgetTree, self._gcBackend)
 
                if not self._gcBackend.is_authed():
                self._phoneTypeSelector = PhoneTypeSelector(self._widgetTree, self._gcBackend)
 
                if not self._gcBackend.is_authed():
@@ -585,6 +594,18 @@ class Dialpad(object):
                error_dialog.connect("response", close, self)
                error_dialog.run()
 
                error_dialog.connect("response", close, self)
                error_dialog.run()
 
+       def get_addressbooks(self):
+               """
+               @returns Iterable of (Address Book Factory, Book Id, Book Name)
+               """
+               for factory in self._addressBookFactories:
+                       for bookFactory, bookId, bookName in factory.get_addressbooks():
+                               yield bookFactory, bookId, bookName
+       
+       def open_addressbook(self, bookFactory, bookId):
+               self._addressBook = bookFactory.open_addressbook(bookId)
+               self._contactstime = 0
+
        def set_number(self, number):
                """
                Set the callback phonenumber
        def set_number(self, number):
                """
                Set the callback phonenumber
index 84434ad..24b5eed 100644 (file)
@@ -3,7 +3,7 @@ Package: Dialer
 Section: user/Communication
 Priority: Optional
 Depends: python2.5, python2.5-gtk2
 Section: user/Communication
 Priority: Optional
 Depends: python2.5, python2.5-gtk2
-Recommends: python2.5-hildon
+Recommends: python2.5-hildon python-evolution
 Version: 0.0.0
 Architecture: all
 Description: Python frontend to the private Google service Grandcentral
 Version: 0.0.0
 Architecture: all
 Description: Python frontend to the private Google service Grandcentral
index 5103d11..b9a1464 100644 (file)
@@ -53,9 +53,7 @@ load-plugins=
 #enable-msg=
 
 # Disable the message(s) with the given id(s).
 #enable-msg=
 
 # Disable the message(s) with the given id(s).
-#Unused Arg, Missing Docstring
-disable-msg=W0613,C0111
-
+disable-msg=W0403,W0612,W0613,C0103,C0111,C0301
 
 [REPORTS]
 
 
 [REPORTS]