pidgin: b8425458: Import a patch (with changes) from Debia...
ari at debian.org
ari at debian.org
Wed May 21 19:22:11 EDT 2008
-----------------------------------------------------------------
Revision: b84254588720f70c8708930c227b3fb525525419
Ancestor: ba6112dabbb907fd5e93c30e0f5228e557949d69
Author: ari at debian.org
Date: 2008-05-21T21:05:09
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b84254588720f70c8708930c227b3fb525525419
Modified files:
libpurple/purple-remote libpurple/purple-url-handler
ChangeLog:
Import a patch (with changes) from Debian:
* 20_purple-remote_friendly.patch:
- Make error messages friendlier when python-dbus is not installed
or if someone calls purple-remote/purple-url-handler with --help or -h
(Closes: #413204)
-------------- next part --------------
============================================================
--- libpurple/purple-remote 44f74c8c50a61615a084bc7448a55877077e2b46
+++ libpurple/purple-remote ed0d125fb0a2e3cea6d6e2f91e21235668fbf65e
@@ -35,7 +35,7 @@ class CheckedAttribute:
raise "Error: " + self.attr + " " + str(args) + " returned " + str(result)
return result
-def show_help():
+def show_help(requested=False):
print """This program uses D-Bus to communicate with purple.
Usage:
@@ -66,6 +66,10 @@ Examples of commands:
PurpleAccountsFindConnected?name=&protocol=prpl-jabber
PurpleAccountsFindConnected(,prpl-jabber)
""" % sys.argv[0]
+ if (requested):
+ sys.exit(0)
+ else:
+ sys.exit(1)
cpurple = CheckedObject(purple)
@@ -213,10 +217,11 @@ def execute(uri):
raise "Don't know how to handle type \"%s\"" % type
return purple.__getattr__(command)(*methodparams)
show_help()
- raise "Unknown command: %s" % command
if len(sys.argv) == 1:
show_help()
+elif (sys.argv[1] == "--help" or sys.argv[1] == "-h"):
+ show_help(True)
elif (obj == None):
print "No existing libpurple instance detected."
sys.exit(1);
============================================================
--- libpurple/purple-url-handler f62cadcf725e685d050bb9afa7f5abb923c3bcb8
+++ libpurple/purple-url-handler b12c31e71e8e57952f79ed972a986d21399c631c
@@ -295,11 +295,15 @@ def main(argv=sys.argv):
def main(argv=sys.argv):
- if len(argv) != 2:
+ if len(argv) != 2 or argv[1] == "--help" or argv[1] == "-h":
print "Usage: %s URI" % argv[0]
print "Example: %s \"xmpp:romeo at montague.net?message\"" % argv[0]
- return
+ if len(argv) != 2:
+ sys.exit(1)
+ else:
+ return 0
+
uri = argv[1]
type = uri.split(":")[0]
More information about the Commits
mailing list