/cpw/tomkiewicz/masterpassword: 95e4bd9d5b9c: Merge with main
Tomasz Wasilczyk
tomkiewicz at cpw.pidgin.im
Sun May 12 06:47:21 EDT 2013
Changeset: 95e4bd9d5b9c7b2d97930ce3f10ad46c13103360
Author: Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date: 2013-05-12 12:47 +0200
Branch: soc.2008.masterpassword
URL: https://hg.pidgin.im/cpw/tomkiewicz/masterpassword/rev/95e4bd9d5b9c
Description:
Merge with main
diffstat:
COPYRIGHT | 1 +
ChangeLog | 3 +
configure.ac | 10 +-
finch/gntblist.c | 2 +-
finch/gntplugin.c | 2 +-
finch/gntprefs.c | 2 +-
libpurple/dbus-analyze-functions.py | 83 ++++++++++----------
libpurple/dbus-analyze-signals.py | 14 +-
libpurple/dbus-analyze-types.py | 28 ++----
libpurple/plugins/dbus-buddyicons-example.py | 3 +-
libpurple/plugins/idle.c | 4 +-
libpurple/plugins/perl/common/Request.xs | 6 +-
libpurple/plugins/startup.py | 13 +-
libpurple/protocols/mxit/protocol.c | 28 ++++++-
libpurple/request.c | 104 ++++++++++++--------------
libpurple/request.h | 54 +++++++++----
pidgin/gtkblist.c | 2 +-
pidgin/gtkdebug.c | 1 -
pidgin/gtkprefs.c | 1 -
pidgin/gtkrequest.c | 33 ++-----
20 files changed, 209 insertions(+), 185 deletions(-)
diffs (truncated from 860 to 300 lines):
diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -217,6 +217,7 @@ Christian Grothoff
Vladislav GuberiniÄ
Gideon N. Guillen
Aman Gupta
+Ashish Gupta
Christian Hammond
Erick Hamness
Fred Hampton
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,9 @@ version 3.0.0 (??/??/????):
* The Offline Message Emulation plugin now adds a note that the message
was an offline message. (Flavius Anton) (#2497)
+ General:
+ * Add support for Python3 in build scripts. (Ashish Gupta) (#15624)
+
Windows-Specific Changes:
* Updates to dependencies:
* NSS 3.14.3 and NSPR 4.9.5
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1783,13 +1783,13 @@ dnl Check for Python headers (currently
dnl (Thanks to XChat)
if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
AC_MSG_CHECKING(for Python compile flags)
- PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
- PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
+ PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
+ PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.exec_prefix)'`
changequote(<<, >>)dnl
- PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
- PY_MAJOR=`$PYTHON -c 'import sys ; print sys.version[0:2]'`
+ PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
+ PY_MAJOR=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:2])'`
changequote([, ])dnl
- if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h -a "$PY_MAJOR" = "2."; then
+ if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
AC_MSG_RESULT()
AC_CHECK_LIB(pthread, pthread_create, )
AC_CHECK_LIB(util, openpty, )
diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -1149,7 +1149,7 @@ chat_components_edit(PurpleBlistNode *se
const char *str = g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier);
if (!str || sscanf(str, "%d", &val) != 1)
val = pce->min;
- field = purple_request_field_int_new(pce->identifier, pce->label, val);
+ field = purple_request_field_int_new(pce->identifier, pce->label, val, INT_MIN, INT_MAX);
} else {
field = purple_request_field_string_new(pce->identifier, pce->label,
g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE);
diff --git a/finch/gntplugin.c b/finch/gntplugin.c
--- a/finch/gntplugin.c
+++ b/finch/gntplugin.c
@@ -510,7 +510,7 @@ process_pref_frame(PurplePluginPrefFrame
field = purple_request_field_bool_new(name, label, purple_prefs_get_bool(name));
break;
case PURPLE_PREF_INT:
- field = purple_request_field_int_new(name, label, purple_prefs_get_int(name));
+ field = purple_request_field_int_new(name, label, purple_prefs_get_int(name), INT_MIN, INT_MAX);
break;
case PURPLE_PREF_STRING:
field = purple_request_field_string_new(name, label, purple_prefs_get_string(name),
diff --git a/finch/gntprefs.c b/finch/gntprefs.c
--- a/finch/gntprefs.c
+++ b/finch/gntprefs.c
@@ -124,7 +124,7 @@ get_pref_field(Prefs *prefs)
break;
case PURPLE_PREF_INT:
field = purple_request_field_int_new(prefs->pref, _(prefs->label),
- purple_prefs_get_int(prefs->pref));
+ purple_prefs_get_int(prefs->pref), INT_MIN, INT_MAX);
break;
case PURPLE_PREF_STRING:
field = purple_request_field_string_new(prefs->pref, _(prefs->label),
diff --git a/libpurple/dbus-analyze-functions.py b/libpurple/dbus-analyze-functions.py
--- a/libpurple/dbus-analyze-functions.py
+++ b/libpurple/dbus-analyze-functions.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import re
import string
import sys
@@ -240,38 +241,38 @@ class ClientBinding (Binding):
paramslist = ", ".join(self.paramshdr)
if (paramslist == "") :
paramslist = "void"
- print "%s %s(%s)" % (self.functiontype, self.function.name,
- paramslist),
+ print("%s %s(%s)" % (self.functiontype, self.function.name,
+ paramslist), end=' ')
if self.headersonly:
- print ";"
+ print(";")
return
- print "{"
+ print("{")
for decl in self.decls:
- print decl
+ print(decl)
- print 'dbus_g_proxy_call(purple_proxy, "%s", NULL,' % ctopascal(self.function.name)
+ print('dbus_g_proxy_call(purple_proxy, "%s", NULL,' % ctopascal(self.function.name))
for type_name in self.inputparams:
- print "\t%s, %s, " % type_name,
- print "G_TYPE_INVALID,"
+ print("\t%s, %s, " % type_name, end=' ')
+ print("G_TYPE_INVALID,")
for type_name in self.outputparams:
- print "\t%s, &%s, " % type_name,
- print "G_TYPE_INVALID);"
+ print("\t%s, &%s, " % type_name, end=' ')
+ print("G_TYPE_INVALID);")
for code in self.returncode:
- print code
+ print(code)
- print "}\n"
+ print("}\n")
def definepurplestructure(self, type):
if (self.headersonly) and (type[0] not in self.knowntypes):
- print "struct _%s;" % type[0]
- print "typedef struct _%s %s;" % (type[0], type[0])
+ print("struct _%s;" % type[0])
+ print("typedef struct _%s %s;" % (type[0], type[0]))
self.knowntypes.append(type[0])
def inputsimple(self, type, name, us):
@@ -357,39 +358,39 @@ class ServerBinding (Binding):
self.argfunc = "dbus_message_get_args"
def flush(self):
- print "static DBusMessage*"
- print "%s_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {" % \
- self.function.name
+ print("static DBusMessage*")
+ print("%s_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {" % \
+ self.function.name)
- print "\tDBusMessage *reply_DBUS;"
+ print("\tDBusMessage *reply_DBUS;")
for decl in self.cdecls:
- print decl
+ print(decl)
- print "\t%s(message_DBUS, error_DBUS," % self.argfunc,
+ print("\t%s(message_DBUS, error_DBUS," % self.argfunc,end=' ')
for param in self.cparams:
- print "DBUS_TYPE_%s, &%s," % param,
- print "DBUS_TYPE_INVALID);"
+ print("DBUS_TYPE_%s, &%s," % param, end=' ')
+ print("DBUS_TYPE_INVALID);")
- print "\tCHECK_ERROR(error_DBUS);"
+ print("\tCHECK_ERROR(error_DBUS);")
for code in self.ccode:
- print code
+ print(code)
- print "\treply_DBUS = dbus_message_new_method_return (message_DBUS);"
+ print("\treply_DBUS = dbus_message_new_method_return (message_DBUS);")
- print "\tdbus_message_append_args(reply_DBUS,",
+ print("\tdbus_message_append_args(reply_DBUS,", end=' ')
for param in self.cparamsout:
if type(param) is str:
- print "%s," % param,
+ print("%s," % param, end=' ')
else:
- print "DBUS_TYPE_%s, &%s," % param,
- print "DBUS_TYPE_INVALID);"
+ print("DBUS_TYPE_%s, &%s," % param, end=' ')
+ print("DBUS_TYPE_INVALID);")
for code in self.ccodeout:
- print code
+ print(code)
- print "\treturn reply_DBUS;\n}\n"
+ print("\treturn reply_DBUS;\n}\n")
def addstring(self, *items):
@@ -440,7 +441,7 @@ class ServerBinding (Binding):
self.cdecls.append("\t%s *%s;" % (type[0], name))
self.cparams.append(("INT32", name + "_ID"))
self.ccode.append("\tPURPLE_DBUS_ID_TO_POINTER(%s, %s_ID, %s, error_DBUS);" % \
- (name, name, type[0]))
+ (name, name, type[0]))
self.addintype("i", name)
def inputpointer(self, type, name):
@@ -543,7 +544,7 @@ class BindingSet:
def process(self):
- print "/* Generated by %s. Do not edit! */" % sys.argv[0]
+ print("/* Generated by %s. Do not edit! */" % sys.argv[0])
for line in self.inputiter:
words = line.split()
@@ -558,7 +559,7 @@ class BindingSet:
# empty line has been encountered
myline = line.strip()
while (myline.count("(") > myline.count(")")) or self.typeregexp.match(myline):
- newline = self.inputiter.next().strip()
+ newline = next(self.inputiter).strip()
if len(newline) == 0:
break
myline += " " + newline
@@ -601,15 +602,15 @@ class ServerBindingSet (BindingSet):
self.functions.append((binding.function.name, binding.dparams))
def flush(self):
- print "static PurpleDBusBinding bindings_DBUS[] = { "
+ print("static PurpleDBusBinding bindings_DBUS[] = { ")
for function, params in self.functions:
- print '{"%s", "%s", %s_DBUS},' % \
- (ctopascal(function), params, function)
+ print('{"%s", "%s", %s_DBUS},' % \
+ (ctopascal(function), params, function))
- print "{NULL, NULL, NULL}"
- print "};"
+ print("{NULL, NULL, NULL}")
+ print("};")
- print "#define PURPLE_DBUS_REGISTER_BINDINGS(handle) purple_dbus_register_bindings(handle, bindings_DBUS)"
+ print("#define PURPLE_DBUS_REGISTER_BINDINGS(handle) purple_dbus_register_bindings(handle, bindings_DBUS)")
class ClientBindingSet (BindingSet):
def __init__(self, inputfile, fprefix, headersonly):
@@ -647,7 +648,7 @@ else:
if "client" in options:
bindings = ClientBindingSet(sys.stdin, fprefix,
- options.has_key("headers"))
+ "headers" in options)
else:
bindings = ServerBindingSet(sys.stdin, fprefix)
bindings.process()
diff --git a/libpurple/dbus-analyze-signals.py b/libpurple/dbus-analyze-signals.py
--- a/libpurple/dbus-analyze-signals.py
+++ b/libpurple/dbus-analyze-signals.py
@@ -5,7 +5,7 @@
# <signal name="Changed">
# <arg name="new_value" type="b"/>
# </signal>
-
+from __future__ import print_function
import re
import sys
@@ -23,8 +23,8 @@ excluded = [\
registerregex = re.compile("purple_signal_register[^;]+\"([\w\-]+)\"[^;]+(purple_marshal_\w+)[^;]+;")
nameregex = re.compile('[-_][a-z]')
-print "/* Generated by %s. Do not edit! */" % sys.argv[0]
-print "const char *dbus_signals = "
+print("/* Generated by %s. Do not edit! */" % sys.argv[0])
+print("const char *dbus_signals = ")
for match in registerregex.finditer(sys.stdin.read()):
signal = match.group(1)
marshal = match.group(2)
@@ -32,7 +32,7 @@ for match in registerregex.finditer(sys.
continue
signal = nameregex.sub(lambda x:x.group()[1].upper(), '-'+signal)
- print "\" <signal name='%s'>\\n\""%signal
+ print("\" <signal name='%s'>\\n\"" % signal)
args = marshal.split('_')
# ['purple', 'marshal', <return type>, '', args...]
@@ -52,9 +52,9 @@ for match in registerregex.finditer(sys.
type = 't'
elif arg == "BOOLEAN":
type = 'b'
- print "\" <arg type='%s'/>\\n\""%type
+ print("\" <arg type='%s'/>\\n\"" % type)
- print "\" </signal>\\n\""
+ print("\" </signal>\\n\"")
More information about the Commits
mailing list