~ubuntu-branches/ubuntu/lucid/gwibber/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches/dont_spawn_multiple_accounts_dialogs.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2010-04-27 16:47:17 UTC
  • Revision ID: james.westby@ubuntu.com-20100427164717-u9sh6rtaospk7k4d
Tags: 2.30.0.1-0ubuntu2
* debian/patches/handle_facebook_keyring.patch
  - Handle prompting the user to authorize gwibber to use facebook in cases 
    where the account was synced and there is no local key stored in the 
    keyring (LP: #571224)
* debian/patches/dont_spawn_multiple_accounts_dialogs.patch
  - Don't fire gwibber-accounts for each failure, only spawn it 
    once (LP: #564741)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'gwibber/microblog/util/exceptions.py'
 
2
--- old/gwibber/microblog/util/exceptions.py    2010-04-14 15:29:20 +0000
 
3
+++ new/gwibber/microblog/util/exceptions.py    2010-05-03 04:09:35 +0000
 
4
@@ -1,5 +1,6 @@
 
5
 import log
 
6
 import os, subprocess
 
7
+import xdg, time
 
8
 
 
9
 class GwibberError(Exception):
 
10
     """Base class for exceptions in gwibber."""
 
11
@@ -17,8 +18,15 @@
 
12
     def __init__(self, type="UNKNOWN", protocol="UNKNOWN", username="UNKNOWN", message="UNKNOWN"):
 
13
         if type == "keyring":
 
14
             log.logger.error("Failed to find credentials in the keyring")
 
15
+            accounts_error = os.path.join(xdg.BaseDirectory.xdg_cache_home, "gwibber", ".accounts_error")
 
16
+            if os.path.exists(accounts_error) and os.path.getmtime(accounts_error) > time.time()-600:
 
17
+                log.logger.info("gwibber-accounts was raised less than 600 seconds")
 
18
+                return
 
19
+            else:
 
20
+                open(accounts_error, 'w').close() 
 
21
         else:
 
22
             log.logger.error("%s failure: %s:%s - %s", type, protocol, username, message)
 
23
+
 
24
         display_message = "There was an %s failure from %s for account %s, error was %s" % (type, protocol, username, message)
 
25
         title = "Gwibber"
 
26
         level = "info"
 
27