debian/0000775000000000000000000000000011750553323007174 5ustar debian/patches/0000775000000000000000000000000011750553323010623 5ustar debian/patches/series0000664000000000000000000000004711743605202012035 0ustar logger.patch gtk3.patch lp959757.patch debian/patches/logger.patch0000664000000000000000000000366011743605143013130 0ustar === modified file '__init__.py' --- old/__init__.py 2011-06-10 09:36:20 +0000 +++ new/__init__.py 2012-03-19 18:00:05 +0000 @@ -3,10 +3,14 @@ import re import gnomekeyring from oauth import oauth -from gwibber.microblog.util import log, resources +from gwibber.microblog.util import resources + from gettext import lgettext as _ import sohu.utils -log.logger.name = "Sohu" + +import logging +logger = logging.getLogger("Sohu") +logger.debug("Initializing.") PROTOCOL_INFO = { "name": "Sohu", @@ -107,7 +111,7 @@ m["images"] = images m["type"] = "photo" except: - log.logger.error("%s failure - %s", PROTOCOL_INFO["name"], data) + logger.error("%s failure - %s", PROTOCOL_INFO["name"], data) return {} return m @@ -219,7 +223,7 @@ if isinstance(data, dict) and data.get("errors", 0): if "authenticate" in data["errors"][0]["message"]: logstr = """%s: %s - %s""" % (PROTOCOL_INFO["name"], _("Authentication failed"), error["message"]) - log.logger.error("%s", logstr) + logger.error("%s", logstr) return [{"error": {"type": "auth", "account": self.account, "message": data["errors"][0]["message"]}}] else: for error in data["errors"]: @@ -228,11 +232,11 @@ elif isinstance(data, dict) and data.get("error", 0): if "Incorrect signature" in data["error"]: logstr = """%s: %s - %s""" % (PROTOCOL_INFO["name"], _("Request failed"), data["error"]) - log.logger.error("%s", logstr) + logger.error("%s", logstr) return [{"error": {"type": "auth", "account": self.account, "message": data["error"]}}] elif isinstance(data, str): logstr = """%s: %s - %s""" % (PROTOCOL_INFO["name"], _("Request failed"), data) - log.logger.error("%s", logstr) + logger.error("%s", logstr) return [{"error": {"type": "request", "account": self.account, "message": data}}] if parse == "list": debian/patches/gtk3.patch0000664000000000000000000001463711743605143012527 0ustar === modified file 'gtk/sohu/__init__.py' --- old/gtk/sohu/__init__.py 2011-04-15 06:31:07 +0000 +++ new/gtk/sohu/__init__.py 2012-03-19 19:16:04 +0000 @@ -1,8 +1,9 @@ -import gtk, pango, webkit, gnomekeyring +from gi.repository import Gdk, Gtk, WebKit, Pango +from gi.repository.Gtk import Builder + import urllib, urllib2, json, urlparse, uuid from oauth import oauth -from gtk import Builder from gwibber.microblog.util import resources import gettext from gettext import gettext as _ @@ -11,33 +12,33 @@ gettext.textdomain('gwibber-service-sohu') import sohu.utils -gtk.gdk.threads_init() +Gdk.threads_init() sigmeth = oauth.OAuthSignatureMethod_HMAC_SHA1() -class AccountWidget(gtk.VBox): +class AccountWidget(Gtk.VBox): """AccountWidget: A widget that provides a user interface for configuring sohu accounts in Gwibber """ def __init__(self, account=None, dialog=None): """Creates the account pane for configuring Sohu accounts""" - gtk.VBox.__init__( self, False, 20 ) - self.ui = gtk.Builder() + Gtk.VBox.__init__( self, False, 20 ) + self.ui = Gtk.Builder() self.ui.set_translation_domain ("gwibber") self.ui.add_from_file (resources.get_ui_asset("gwibber-accounts-sohu.ui")) self.ui.connect_signals(self) self.vbox_settings = self.ui.get_object("vbox_settings") - self.pack_start(self.vbox_settings, False, False) + self.pack_start(self.vbox_settings, False, False, 0) self.show_all() self.account = account or {} self.dialog = dialog - has_secret_key = True + self.window = dialog.dialog + has_access_token = False + + has_secret_key = False if self.account.has_key("id"): - try: - value = gnomekeyring.find_items_sync(gnomekeyring.ITEM_GENERIC_SECRET, {"id": str("%s/%s" % (self.account["id"], "secret_token"))})[0].secret - except gnomekeyring.NoMatchError: - has_secret_key = False + has_secret_key = get_from_keyring(self.account['id'], 'secret_token') is not None try: if self.account.has_key("access_token") and self.account.has_key("secret_token") and self.account.has_key("username") and has_secret_key and not self.dialog.condition: @@ -57,8 +58,9 @@ def on_sohu_auth_clicked(self, widget, data=None): self.winsize = self.window.get_size() - web = webkit.WebView() + web = WebKit.WebView() web.get_settings().set_property("enable-plugins", False) + web.get_settings().set_property("enable-developer-extras", False) web.load_html_string(_("

Please wait...

"), "file:///") self.consumer = oauth.OAuthConsumer(*sohu.utils.get_sohu_keys()) @@ -79,15 +81,17 @@ web.set_size_request(550, 400) web.connect("title-changed", self.on_sohu_auth_title_change) - self.scroll = gtk.ScrolledWindow() + self.scroll = Gtk.ScrolledWindow() self.scroll.add(web) + self.scroll.set_size_request(550, 400) self.pack_start(self.scroll, True, True, 0) self.show_all() + self.dialog.infobar.hide() self.ui.get_object("vbox1").hide() self.ui.get_object("vbox_advanced").hide() - self.dialog.infobar.set_message_type(gtk.MESSAGE_INFO) + self.dialog.infobar.set_message_type(Gtk.MessageType.INFO) def on_sohu_auth_title_change(self, web=None, title=None, data=None): saved = False @@ -99,12 +103,12 @@ self.dialog.infobar_content_area.show() self.dialog.infobar.show() - message_label = gtk.Label(_("Verifying")) + message_label = Gtk.Label(_("Verifying")) message_label.set_use_markup(True) - message_label.set_ellipsize(pango.ELLIPSIZE_END) + message_label.set_ellipsize(Pango.EllipsizeMode.END) self.dialog.infobar_content_area.add(message_label) self.dialog.infobar.show_all() - self.scroll.hide() + self.scroll.destroy() url = web.get_main_frame().get_uri() data = urlparse.parse_qs(url.split("?", 1)[1]) @@ -145,16 +149,16 @@ saved = self.dialog.on_edit_account_save() else: print "Failed" - self.dialog.infobar.set_message_type(gtk.MESSAGE_ERROR) + self.dialog.infobar.set_message_type(Gtk.MessageType.ERROR) message_label.set_text(_("Authorization failed. Please try again.")) else: print "Failed" - self.dialog.infobar.set_message_type(gtk.MESSAGE_ERROR) + self.dialog.infobar.set_message_type(Gtk.MessageType.ERROR) message_label.set_text(_("Authorization failed. Please try again.")) if saved: message_label.set_text(_("Successful")) - self.dialog.infobar.set_message_type(gtk.MESSAGE_INFO) + self.dialog.infobar.set_message_type(Gtk.MessageType.INFO) #self.dialog.infobar.hide() self.ui.get_object("hbox_sohu_auth").hide() @@ -168,11 +172,15 @@ self.window.resize(*self.winsize) if title.get_title() == "Failure": - web.hide() - self.dialog.infobar.set_message_type(gtk.MESSAGE_ERROR) - message_label.set_text(_("Authorization failed. Please try again.")) + self.dialog.infobar.set_message_type(Gtk.MessageType.ERROR) + message_label = Gtk.Label (_("Authorization failed. Please try again.")) + message_label.set_use_markup(True) + message_label.set_ellipsize(Pango.EllipsizeMode.END) + self.dialog.infobar_content_area.add(message_label) self.dialog.infobar.show_all() self.ui.get_object("vbox1").show() self.ui.get_object("vbox_advanced").show() + self.scroll.destroy() self.window.resize(*self.winsize) + self.dialog.select_account () === modified file 'setup.py' --- old/setup.py 2011-06-06 19:00:34 +0000 +++ new/setup.py 2012-03-19 19:01:43 +0000 @@ -16,9 +16,9 @@ ('share/gwibber/plugins/sohu/gtk', glob("gtk/*.*")), ('share/gwibber/plugins/sohu/gtk/sohu', glob("gtk/sohu/*.*")), ('share/gwibber/plugins/sohu/ui', glob("ui/*.*")), - ('share/gwibber/plugins/sohu/ui/icons/16x16', glob("ui/icons/16x16/*.*")), - ('share/gwibber/plugins/sohu/ui/icons/22x22', glob("ui/icons/22x22/*.*")), - ('share/gwibber/plugins/sohu/ui/icons/scalable', glob("ui/icons/scalable/*.*")), + ('share/gwibber/ui/icons/hicolor/16x16/apps', glob("ui/icons/16x16/*.*")), + ('share/gwibber/ui/icons/hicolor/22x22/apps', glob("ui/icons/22x22/*.*")), + ('share/gwibber/ui/icons/hicolor/scalable/apps', glob("ui/icons/scalable/*.*")), ('share/gwibber/plugins/sohu/data', glob("data/*.*")), ], cmdclass = { "build" : build_extra.build_extra, debian/patches/lp959757.patch0000664000000000000000000000205511745570037013000 0ustar === modified file '__init__.py' --- old/__init__.py 2012-03-19 18:19:52 +0000 +++ new/__init__.py 2012-04-18 18:38:11 +0000 @@ -1,7 +1,6 @@ from gwibber.microblog import network, util from htmlentitydefs import name2codepoint import re -import gnomekeyring from oauth import oauth from gwibber.microblog.util import resources === modified file 'gtk/sohu/__init__.py' --- old/gtk/sohu/__init__.py 2012-03-19 19:16:33 +0000 +++ new/gtk/sohu/__init__.py 2012-04-24 18:11:53 +0000 @@ -5,6 +5,7 @@ from oauth import oauth from gwibber.microblog.util import resources +from gwibber.microblog.util.keyring import get_from_keyring import gettext from gettext import gettext as _ if hasattr(gettext, 'bind_textdomain_codeset'): @@ -141,7 +142,7 @@ account_data = json.loads(urllib2.urlopen(apireq.to_url()).read()) - self.account["username"] = account_data["screen_name"] + self.account["username"] = account_data["screen_name"].encode("utf-8") self.account["user_id"] = account_data["id"] if isinstance(account_data, dict): debian/compat0000664000000000000000000000000211743605143010372 0ustar 7 debian/rules0000775000000000000000000000020111743605143010245 0ustar #!/usr/bin/make -f # -*- makefile -*- # # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh --with python2 $@ debian/copyright0000664000000000000000000000356111743605143011134 0ustar Format: http://dep.debian.net/deps/dep5/ Upstream-Name: gwibber-service-sohu Source: https://launchpad.net/gwibber-service-sohu Files: * Copyright: Copyright (C) 2011 An Yang License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. Files: debian/* Copyright: 2011 Ken VanDine License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/changelog0000664000000000000000000000327511750553307011057 0ustar gwibber-service-sohu (0.8.1-0ubuntu7) precise-proposed; urgency=low * debian/patches/lp959757.patch - updated to include fix for missing import (LP: #959757) -- Ken VanDine Thu, 26 Apr 2012 17:07:22 -0400 gwibber-service-sohu (0.8.1-0ubuntu6) precise; urgency=low * debian/patches/lp959757.patch - removed last import of gnomekeyring and make sure username is utf-8 (LP: #959757) -- Ken VanDine Fri, 20 Apr 2012 11:14:14 -0400 gwibber-service-sohu (0.8.1-0ubuntu5) precise; urgency=low * debian/patches/gtk3.patch - ported accounts dialog to gtk3 (LP: #959614) -- Ken VanDine Mon, 19 Mar 2012 15:27:20 -0400 gwibber-service-sohu (0.8.1-0ubuntu4) precise; urgency=low * debian/patches/logger.patch - Updated to use the new logger in gwibber-service (LP: #947471) * debian/control - require gwibber-service >= 3.3.92 for the logger changes -- Ken VanDine Mon, 19 Mar 2012 14:02:23 -0400 gwibber-service-sohu (0.8.1-0ubuntu3) precise; urgency=low * Rebuild to drop dependencies on python2.6. -- Matthias Klose Mon, 02 Jan 2012 11:09:06 +0100 gwibber-service-sohu (0.8.1-0ubuntu2) oneiric; urgency=low * debian/copyright - Updated to dep5 format * debian/control - Build depend on python-all-dev >= 2.6.6-3~ * debian/rules - use dh_python2 -- Ken VanDine Mon, 22 Aug 2011 19:36:53 -0400 gwibber-service-sohu (0.8.1-0ubuntu1) oneiric; urgency=low * Inital package (LP: #785395) * New upstream release. -- Ken VanDine Fri, 10 Jun 2011 09:36:20 -0400 debian/sohu0000664000000000000000000000016211743605143010074 0ustar { "SOHU_OAUTH_KEY": "YcRgcVD31M241lWRJuU0", "SOHU_OAUTH_SECRET": "!2(z%LRmy7xTN(x3cm$)2m*domKNT(s00=qN4Vxh" } debian/gwibber-service-sohu.install0000664000000000000000000000006311743605143014616 0ustar debian/sohu /usr/share/gwibber/plugins/sohu/data/ debian/control0000664000000000000000000000120211743605143010572 0ustar Source: gwibber-service-sohu Section: misc Priority: extra Maintainer: Ken VanDine Build-Depends: debhelper (>= 7.0.50~), python-all (>= 2.6.6-3~), python-distutils-extra Standards-Version: 3.9.2 Homepage: https://launchpad.net/gwibber-service-sohu Vcs-Bzr: https://code.launchpad.net/~gwibber-team/gwibber-service-sohu/ubuntu Package: gwibber-service-sohu Architecture: all Depends: ${misc:Depends}, ${python:Depends}, gwibber-service (>= 3.3.92) Description: Sohu plugin for Gwibber Social networking client for Sohu . This package includes the Sohu plugin for the Gwibber desktop service debian/source/0000775000000000000000000000000011750553323010474 5ustar debian/source/format0000664000000000000000000000001411743605143011702 0ustar 3.0 (quilt)