[gwibber/f13/master] update to 2.31.90

Tom Callaway spot at fedoraproject.org
Thu Aug 26 20:49:14 UTC 2010


commit 076c8783e52e1254476940c4a9bea6abd2277d1c
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Thu Aug 26 16:49:12 2010 -0400

    update to 2.31.90

 gwibber-825bzr-threads-gone-wild.patch    |   73 +++++++++++++++++++++++++++++
 gwibber-825bzr-twitter-unicode-hack.patch |   57 ++++++++++++++++++++++
 gwibber.spec                              |   36 ++++++++++++--
 sources                                   |    2 +-
 4 files changed, 161 insertions(+), 7 deletions(-)
---
diff --git a/gwibber-825bzr-threads-gone-wild.patch b/gwibber-825bzr-threads-gone-wild.patch
new file mode 100644
index 0000000..17dbdc2
--- /dev/null
+++ b/gwibber-825bzr-threads-gone-wild.patch
@@ -0,0 +1,73 @@
+diff -up gwibber-825bzr/gwibber/microblog/dispatcher.py.threads-gone-wild gwibber-825bzr/gwibber/microblog/dispatcher.py
+--- gwibber-825bzr/gwibber/microblog/dispatcher.py.threads-gone-wild	2010-08-26 10:36:48.000000000 -0400
++++ gwibber-825bzr/gwibber/microblog/dispatcher.py	2010-08-26 16:22:35.302457000 -0400
+@@ -207,20 +207,19 @@ class OperationCollector:
+         yield o
+ 
+ class MapAsync(threading.Thread):
+-  def __init__(self, func, iterable, cbsuccess, cbfailure, timeout=240):
++  def __init__(self, func, iterable, cbsuccess, cbfailure, pool):
+     threading.Thread.__init__(self)
+     self.iterable = iterable
+     self.callback = cbsuccess
+     self.failure = cbfailure
+-    self.timeout = timeout
+     self.daemon = True
+     self.func = func
++    self.pool = pool
+     self.start()
+ 
+   def run(self):
+     try:
+-      pool = multiprocessing.Pool()
+-      pool.map_async(self.func, self.iterable, callback=self.callback).get(timeout=self.timeout)
++      self.pool.map_async(self.func, self.iterable, callback = self.callback).get(timeout = 240)
+     except Exception as e:
+       self.failure(e, traceback.format_exc())
+ 
+@@ -255,6 +254,7 @@ class Dispatcher(dbus.service.Object):
+ 
+     self.refresh_count = 0
+     self.mainloop = loop
++    self.workerpool = multiprocessing.Pool()
+ 
+     if autorefresh:
+       log.logger.debug("Refresh interval is set to %s", SETTINGS["interval"])
+@@ -300,7 +300,7 @@ class Dispatcher(dbus.service.Object):
+         operation = util.compact([(account, o["operation"], o["args"], None)])
+ 
+     if operation:
+-      MapAsync(perform_operation, operation, self.loading_complete, self.loading_failed)
++      self.perform_async_operation(operation)
+ 
+   @dbus.service.method("com.Gwibber.Service", in_signature="s")
+   def SendMessage(self, message):
+@@ -415,6 +415,10 @@ class Dispatcher(dbus.service.Object):
+   @dbus.service.signal("com.Gwibber.Service")
+   def IndicatorInterestRemoved(self): pass
+ 
++  def perform_async_operation(self, iterable):
++    t = MapAsync(perform_operation, iterable, self.loading_complete, self.loading_failed, self.workerpool)
++    t.join()
++  
+   def loading_complete(self, output):
+     self.refresh_count += 1
+     
+@@ -534,7 +538,7 @@ class Dispatcher(dbus.service.Object):
+     if operations:
+       self.LoadingStarted()
+       log.logger.debug("*** Sending Message ***")
+-      MapAsync(perform_operation, operations, self.loading_complete, self.loading_failed)
++      self.perform_async_operation(operations)
+ 
+   def refresh(self):
+     log.logger.debug("Refresh interval is set to %s", SETTINGS["interval"])
+@@ -548,7 +552,7 @@ class Dispatcher(dbus.service.Object):
+     if operations:
+       log.logger.debug("** Starting Refresh - %s **", mx.DateTime.now())
+       self.LoadingStarted()
+-      MapAsync(perform_operation, operations, self.loading_complete, self.loading_failed)
++      self.perform_async_operation(operations)
+ 
+     gobject.timeout_add(int(60 * 1000 * SETTINGS["interval"]), self.refresh)
+     return False
diff --git a/gwibber-825bzr-twitter-unicode-hack.patch b/gwibber-825bzr-twitter-unicode-hack.patch
new file mode 100644
index 0000000..1010f58
--- /dev/null
+++ b/gwibber-825bzr-twitter-unicode-hack.patch
@@ -0,0 +1,57 @@
+diff -up gwibber-825bzr/gwibber/microblog/twitter.py.gwibber-unicode-hack gwibber-825bzr/gwibber/microblog/twitter.py
+--- gwibber-825bzr/gwibber/microblog/twitter.py.gwibber-unicode-hack	2010-08-26 10:36:48.000000000 -0400
++++ gwibber-825bzr/gwibber/microblog/twitter.py	2010-08-26 10:41:57.940457001 -0400
+@@ -49,6 +49,44 @@ PROTOCOL_INFO = {
+ 
+ URL_PREFIX = "https://twitter.com"
+ 
++import htmlentitydefs
++import unicodedata
++
++def htmlStripEscapes(s):
++    """Replace all html entities (escape sequences) in the string s with their
++    ISO Latin-1 (or bytecode) equivalent.  If no such equivalent can be found
++    then the entity is decomposed into its normal form and the constituent
++    latin characters are retained.  Failing that, the entity is deleted."""
++    i=0
++    while True:
++        i = s.find('&',i)
++        j = s.find(';',i)+1
++        identifier = s[i+1:j-1]
++        if not j==0:
++            replacement = ''
++            if identifier in htmlentitydefs.entitydefs:
++                identifier = htmlentitydefs.entitydefs[identifier]
++                if len(identifier)==1:
++                    replacement = identifier
++                else:
++                    identifier = identifier.strip('&;')
++            if (len(identifier)>1) and (identifier[0] == '#'):
++                identifier = identifier[1:]
++                if identifier[0]=='x':
++                    identifier = int('0'+identifier,16)
++                else:
++                    identifier = int(identifier)
++                if identifier<256:
++                    replacement = chr(identifier)
++                elif identifier<=0xFFFF:
++                    replacement = unicodedata.normalize('NFKD',
++                        unichr(identifier)).encode('latin_1','ignore')
++            s = s[:i] + replacement + s[j:]
++            i += len(replacement)
++        else:
++            break
++    return(s)
++
+ def unescape(s):
+   p = htmllib.HTMLParser(None)
+   p.save_bgn()
+@@ -66,7 +104,7 @@ class Client:
+       m["service"] = "twitter"
+       m["account"] = self.account["id"]
+       m["time"] = util.parsetime(data["created_at"])
+-      m["text"] = unescape(data["text"])
++      m["text"] = unescape(htmlStripEscapes(data["text"]))
+       m["to_me"] = ("@%s" % self.account["username"]) in data["text"]
+ 
+       m["html"] = util.linkify(data["text"],
diff --git a/gwibber.spec b/gwibber.spec
index 8a1fd8e..a92e7ff 100644
--- a/gwibber.spec
+++ b/gwibber.spec
@@ -1,10 +1,11 @@
  %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
-%global basever 2.31.4
+%global basever 2.31.90
+%global bzr_rev 825
 
 Name:           gwibber
 Version:        %{basever}
-Release:        1%{?dist}
+Release:        4%{?dist}
 Epoch:          1
 Summary:        An open source microblogging client for GNOME developed with Python and GTK
 Group:          Applications/Internet
@@ -15,15 +16,15 @@ URL:            https://launchpad.net/gwibber
 # following command to generate the tarball:
 #   bzr export -r %{bzr_rev} gwibber-%{bzr_rev}bzr.tar.gz lp:gwibber
 # Source0:        http://launchpad.net/gwibber/trunk/%{basever}/+download/gwibber-%{version}.tar.gz
-Source0:	gwibber-794bzr.tar.gz
+Source0:	gwibber-%{bzr_rev}bzr.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # Cleanup facebook auth dialog
-Patch0:		gwibber-794bzr-cleanup-fbauth.patch
+Patch0:		gwibber-819bzr-cleanup-fbauth.patch
 
 # Gwibber unicode hack
 # See: https://bugs.launchpad.net/gwibber/+bug/532952
-Patch1:		gwibber-sqlite-725bzr-twitter-unicode-hack.patch
+Patch1:		gwibber-825bzr-twitter-unicode-hack.patch
 
 # Disable libproxy support
 # It doesn't work for some unknown reason.
@@ -35,6 +36,10 @@ Patch3:		gwibber-794bzr-no-Position-printing.patch
 # Quit when minimized to icon and I tell the icon to quit.
 Patch4:		gwibber-794bzr-quit-when-minimized.patch
 
+# Fix for threads-gone-wild
+# https://bugs.launchpad.net/gwibber/+bug/624918
+Patch5:		gwibber-825bzr-threads-gone-wild.patch
+
 Requires:	libsoup, python-pycurl, PyXML
 Requires:	python 
 Requires:	dbus-python >= 0.80.2
@@ -61,12 +66,13 @@ and GTK. It supports Twitter, Jaiku, Identi.ca, Facebook, and Digg.
 
 
 %prep
-%setup -q -n gwibber-794bzr
+%setup -q -n gwibber-%{bzr_rev}bzr
 %patch0 -p1 -b .fbauth
 %patch1 -p1 -b .gwibber-unicode-hack
 %patch2 -p1 -b .no-libproxy
 %patch3 -p1 -b .no-position-printing
 %patch4 -p1 -b .quit
+%patch5 -p1 -b .threads-gone-wild
 
 sed -i -e '/^#! \?\//, 1d' $(find %{name} | grep "\.py$")
 
@@ -110,6 +116,24 @@ rm -rf %{buildroot}
 %{_datadir}/indicators/messages/applications/gwibber
 
 %changelog
+* Thu Aug 26 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.90-4
+- fix "threads gone wild" problem (bz627686), thanks to Bill Nottingham
+
+* Thu Aug 26 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.90-3
+- update to bzr 825
+
+* Tue Aug 24 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.90-2
+- update to bzr 823
+
+* Mon Aug 23 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.90-1
+- update to 2.31.90 (bzr 819)
+
+* Mon Aug 16 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.6-1
+- update to 2.31.6 (bzr 804)
+
+* Wed Aug 11 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.4-2
+- update to bzr797
+
 * Mon Aug  9 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 1:2.31.4-1
 - update to 2.31.4
 - fix issue where client minimized to icon will not quit when told to
diff --git a/sources b/sources
index b11ddb9..2f97c24 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a1587d8456bfe4601f09c5ee493fe8ff  gwibber-794bzr.tar.gz
+793d68bb313a16278d8c86ca15089ea6  gwibber-825bzr.tar.gz


More information about the scm-commits mailing list