diff -up gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/gowalla/__init__.py.gowalla gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/gowalla/__init__.py --- gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/gowalla/__init__.py.gowalla 2011-03-25 13:37:54.077113013 -0400 +++ gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/gowalla/__init__.py 2011-03-25 13:18:40.175113003 -0400 @@ -0,0 +1,43 @@ +# +# Gowalla support for Gwibber +# +# Derived from Foursquare support (foursquare.py) +# That code is (C) 2010 Ken VanDine +# and is available under GPLv2 only. +# +# Copyright 2011, Tom "spot" Callaway +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later +# as published by the Free Software Foundation. +# +# 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 program. If not, see . + +import gtk +from gtk import Builder +from gwibber.microblog.util import resources + +class AccountWidget(gtk.VBox): + """AccountWidget: A widget that provides a user interface for configuring Gowalla accounts in Gwibber + """ + + def __init__(self, account=None, dialog=None): + """Creates the account pane for configuring Gowalla accounts""" + 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-gowalla.ui")) + self.ui.connect_signals(self) + self.vbox_settings = self.ui.get_object("vbox_settings") + self.pack_start(self.vbox_settings, False, False) + self.show_all() + if dialog.ui: + dialog.ui.get_object("vbox_create").show() + + diff -up gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/__init__.py.gowalla gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/__init__.py diff -up gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py.gowalla gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py --- gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py.gowalla 2011-03-25 13:37:40.775113004 -0400 +++ gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py 2011-03-25 13:32:04.759113008 -0400 @@ -0,0 +1,134 @@ +# +# Gowalla support for Gwibber +# +# Derived from Foursquare support (foursquare/__init__.py) +# +# Copyright 2011, Tom "spot" Callaway +# +# Permission to use, copy, modify, and distribute this software and its +# documentation for any purpose and without fee is hereby granted, +# provided that the above copyright notice appear in all copies and that +# both that copyright notice and this permission notice appear in +# supporting documentation. +# +# THE AUTHOR PROVIDES THIS SOFTWARE ''AS IS'' AND ANY EXPRESSED OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from gwibber.microblog import network, util +from gwibber.microblog.util import log, resources +import json, htmllib, re +from gettext import lgettext as _ +log.logger.name = "Gowalla" + +PROTOCOL_INFO = { + "name": "Gowalla", + "version": "1.0", + + "config": [ + "private:password", + "receive_enabled", + "username", + "color", + ], + + "authtype": "none", + "color": "#f7911f", + + "features": [ + "receive", + ], + + "default_streams": [ + "receive", + ], +} + +URL_PREFIX = "https://api.gowalla.com/" + +class Client: + def __init__(self, acct): + self.account = acct + + def _message(self, data): + + m = {}; + m["mid"] = str(data["user"]["first_name"]) + str(data["user"]["last_name"]) + m["service"] = "gowalla" + m["account"] = self.account["id"] + m["time"] = util.parsetime(data["created_at"]) + + messagetext = "" + text = "" + if data.has_key("spot"): + if data.has_key("message"): + messagetext += data["message"] + "

" + text += data["message"] + "\n" + m["url"] = "http://gowalla.com%s" % data["spot"]["url"] + img = "
" % data["spot"]["image_url"] + messagetext += img + "Checked in at " + data["spot"]["name"] + "" + text += "Checked in at " + data["spot"]["name"] + else: + if data.has_key("message"): + messagetext += data["message"] + "

" + text += data["message"] + "\n" + else: + text= "Checked in off the grid" + messagetext= "
Checked in off the grid" + + m["text"] = text + m["content"] = messagetext + "
" + m["html"] = messagetext + "
" + + m["sender"] = {} + m["sender"]["image"] = data["user"]["image_url"] + m["sender"]["url"] = "http://gowalla.com%s" % data["user"]["url"] + fullname = "" + if data["user"].has_key("first_name"): + fullname += data["user"]["first_name"] + " " + if data["user"].has_key("last_name"): + fullname += data["user"]["last_name"] + + m["sender"]["name"] = fullname + m["sender"]["nick"] = fullname + + m["source"] = "Gowalla" + + return m + + def _check_error(self, data): + if isinstance(data, dict) and "activity" in data: + return True + else: + log.logger.error("Gowalla error %s", data) + return False + + def _get(self, path, parse="message", post=False, single=False, **args): + url = "/".join((URL_PREFIX, path)) + + data = network.Download(url, util.compact(args) or None, post, + self.account["username"], self.account["password"]).get_json() + + resources.dump(self.account["service"], self.account["id"], data) + + if not self._check_error(data): + return [] + + checkins = data["activity"] + if single: return [getattr(self, "_%s" % parse)(checkins)] + if parse: return [getattr(self, "_%s" % parse)(m) for m in checkins] + else: return [] + + def __call__(self, opname, **args): + return getattr(self, opname)(**args) + + def receive(self): + return self._get("users/%s/activity/friends" % self.account["username"]) + diff -up gwibber-2.91.92/gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui.gowalla gwibber-2.91.92/gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui --- gwibber-2.91.92/gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui.gowalla 2011-03-25 13:37:59.317113004 -0400 +++ gwibber-2.91.92/gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui 2011-03-25 13:21:50.015113004 -0400 @@ -0,0 +1,201 @@ + + + + + + True + 6 + + + True + 3 + 3 + 12 + 6 + + + True + True + False + + + + 1 + 3 + 2 + 3 + + + + + + True + True + + + + 1 + 3 + + + + + + True + 0 + Login I_D: + True + username + + + GTK_FILL + + + + + + True + 0 + Pass_word: + True + right + password + + + 2 + 3 + GTK_FILL + + + + + + True + + + True + 0 + 3 + <span size="small"><b>Example:</b> username@email.com</span> + True + + + False + 0 + + + + + 1 + 2 + 1 + 2 + + + + + + + + + + + False + False + 0 + + + + + True + + + False + 1 + + + + + True + 6 + + + True + 0 + Account Settings: + + + + + + 0 + + + + + True + 3 + 12 + 6 + + + _Receive Messages + True + True + False + Include this account when downloading messages + True + True + True + + + 3 + GTK_FILL + + + + + + 1 + + + + + True + True + + + True + Color used to help distinguish accounts + 0 + Account Color: + + + 0 + + + + + True + True + True + Color used to help distinguish accounts + #000000000000 + + + False + 1 + + + + + 2 + + + + + 2 + + + + diff -up gwibber-2.91.92/MANIFEST.gowalla gwibber-2.91.92/MANIFEST --- gwibber-2.91.92/MANIFEST.gowalla 2011-03-25 13:32:58.698113010 -0400 +++ gwibber-2.91.92/MANIFEST 2011-03-25 13:34:28.606113047 -0400 @@ -83,6 +83,14 @@ gwibber/microblog/plugins/friendfeed/__i gwibber/microblog/plugins/friendfeed/gtk/__init__.py gwibber/microblog/plugins/friendfeed/gtk/friendfeed/__init__.py gwibber/microblog/plugins/friendfeed/ui/gwibber-accounts-friendfeed.ui +gwibber/microblog/plugins/gowalla/__init__.py +gwibber/microblog/plugins/gowalla/gtk/__init__.py +gwibber/microblog/plugins/gowalla/gtk/gowalla/__init__.py +gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui +gwibber/microblog/plugins/gowalla/ui/icons/16x16/gowalla.png +gwibber/microblog/plugins/gowalla/ui/icons/22x22/gowalla.png +gwibber/microblog/plugins/gowalla/ui/icons/32x32/gowalla.png +gwibber/microblog/plugins/gowalla/ui/icons/scalable/gowalla.png gwibber/microblog/plugins/identica/__init__.py gwibber/microblog/plugins/identica/gtk/__init__.py gwibber/microblog/plugins/identica/gtk/identica/__init__.py diff -up gwibber-2.91.92/po/POTFILES.in.gowalla gwibber-2.91.92/po/POTFILES.in --- gwibber-2.91.92/po/POTFILES.in.gowalla 2011-03-25 13:34:39.204112988 -0400 +++ gwibber-2.91.92/po/POTFILES.in 2011-03-25 13:35:10.815112928 -0400 @@ -34,6 +34,7 @@ gwibber/util.py [type: gettext/glade] gwibber/microblog/plugins/twitter/ui/gwibber-accounts-twitter.ui [type: gettext/glade] gwibber/microblog/plugins/qaiku/ui/gwibber-accounts-qaiku.ui [type: gettext/glade] gwibber/microblog/plugins/foursquare/ui/gwibber-accounts-foursquare.ui +[type: gettext/glade] gwibber/microblog/plugins/gowalla/ui/gwibber-accounts-gowalla.ui ui/templates/base.mako ui/templates/targetbar.mako bin/gwibber-poster diff -up gwibber-2.91.92/setup.py.gowalla gwibber-2.91.92/setup.py --- gwibber-2.91.92/setup.py.gowalla 2011-03-25 13:35:19.692113025 -0400 +++ gwibber-2.91.92/setup.py 2011-03-25 13:36:38.870113063 -0400 @@ -61,6 +61,14 @@ setup(name="gwibber", ('share/gwibber/plugins/foursquare/ui/icons/22x22', glob("gwibber/microblog/plugins/foursquare/ui/icons/22x22/*.*")), ('share/gwibber/plugins/foursquare/ui/icons/32x32', glob("gwibber/microblog/plugins/foursquare/ui/icons/32x32/*.*")), ('share/gwibber/plugins/foursquare/ui/icons/scalable', glob("gwibber/microblog/plugins/foursquare/ui/icons/scalable/*.*")), + ('share/gwibber/plugins/gowalla', glob("gwibber/microblog/plugins/gowalla/*.*")), + ('share/gwibber/plugins/gowalla/gtk', glob("gwibber/microblog/plugins/gowalla/gtk/*.*")), + ('share/gwibber/plugins/gowalla/gtk/gowalla', glob("gwibber/microblog/plugins/gowalla/gtk/gowalla/*.*")), + ('share/gwibber/plugins/gowalla/ui', glob("gwibber/microblog/plugins/gowalla/ui/*.*")), + ('share/gwibber/plugins/gowalla/ui/icons/16x16', glob("gwibber/microblog/plugins/gowalla/ui/icons/16x16/*.*")), + ('share/gwibber/plugins/gowalla/ui/icons/22x22', glob("gwibber/microblog/plugins/gowalla/ui/icons/22x22/*.*")), + ('share/gwibber/plugins/gowalla/ui/icons/32x32', glob("gwibber/microblog/plugins/gowalla/ui/icons/32x32/*.*")), + ('share/gwibber/plugins/gowalla/ui/icons/scalable', glob("gwibber/microblog/plugins/gowalla/ui/icons/scalable/*.*")), ('share/gwibber/plugins/buzz', glob("gwibber/microblog/plugins/buzz/*.*")), ('share/gwibber/plugins/buzz/gtk', glob("gwibber/microblog/plugins/buzz/gtk/*.*")), ('share/gwibber/plugins/buzz/gtk/buzz', glob("gwibber/microblog/plugins/buzz/gtk/buzz/*.*")), --- gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/__init__.py.gowalla 2011-03-25 14:53:06.734113004 -0400 +++ gwibber-2.91.92/gwibber/microblog/plugins/gowalla/gtk/__init__.py 2011-03-25 14:53:19.607112967 -0400 @@ -0,0 +1 @@ +