bigboard r7434 - in trunk/bigboard: . stocks/twitter



Author: marinaz
Date: Mon Oct 27 22:31:04 2008
New Revision: 7434
URL: http://svn.gnome.org/viewvc/bigboard?rev=7434&view=rev

Log:
Use EnsureAccountType() when getting particular account types from the Online Accounts system.


Modified:
   trunk/bigboard/google.py
   trunk/bigboard/google_stock.py
   trunk/bigboard/stocks/twitter/TwitterStock.py

Modified: trunk/bigboard/google.py
==============================================================================
--- trunk/bigboard/google.py	(original)
+++ trunk/bigboard/google.py	Mon Oct 27 22:31:04 2008
@@ -578,6 +578,13 @@
     except dbus.DBusException, e:
         _logger.error("onlineaccounts DBus service not available, can't refresh googles")   
         return
+
+    try: 
+        __onlineaccounts_proxy.EnsureAccountType("google", "Google", "Gmail or Google Apps for Your Domain email")
+    except dbus.DBusException, e:
+        _logger.error(e.message)
+        return
+
     gaccount_paths = __onlineaccounts_proxy.GetEnabledAccountsWithTypes(['google'])
     new_googles = {}
     for g_path in gaccount_paths:

Modified: trunk/bigboard/google_stock.py
==============================================================================
--- trunk/bigboard/google_stock.py	(original)
+++ trunk/bigboard/google_stock.py	Mon Oct 27 22:31:04 2008
@@ -43,6 +43,12 @@
             _logger.error("onlineaccounts DBus service not available, can't get google accounts")
             return
 
+        try: 
+            self.__onlineaccounts_proxy.EnsureAccountType("google", "Google", "Gmail or Google Apps for Your Domain email")
+        except dbus.DBusException, e:
+            _logger.error(e.message)
+            return
+
         all_google_account_paths = self.__onlineaccounts_proxy.GetEnabledAccountsWithTypes(["google"])
         for a_path in all_google_account_paths:
             self.__on_account_added(a_path)

Modified: trunk/bigboard/stocks/twitter/TwitterStock.py
==============================================================================
--- trunk/bigboard/stocks/twitter/TwitterStock.py	(original)
+++ trunk/bigboard/stocks/twitter/TwitterStock.py	Mon Oct 27 22:31:04 2008
@@ -110,6 +110,12 @@
         except dbus.DBusException, e:
             _logger.error("onlineaccounts DBus service not available, can't get twitter accounts")
             return
+        
+        try: 
+            self.__onlineaccounts_proxy.EnsureAccountType(TYPE_TWITTER, "Twitter", "Twitter username")
+        except dbus.DBusException, e:
+            _logger.error(e.message)
+            return
 
         all_twitter_account_paths = self.__onlineaccounts_proxy.GetEnabledAccountsWithTypes([TYPE_TWITTER])
         for a_path in all_twitter_account_paths:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]