pygobject: update to 3.4.0.
This commit is contained in:
parent
b8734717c1
commit
897609b541
|
@ -1,60 +0,0 @@
|
|||
From 9de58e168190388d671ed82c30cf17d193f2f64c Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martinpitt@gnome.org>
|
||||
Date: Fri, 1 Jun 2012 14:44:11 +0200
|
||||
Subject: [PATCH] Escape identifiers which are Python keywords
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=676746
|
||||
---
|
||||
gi/pygi-info.c | 38 +++++++++++++++++++++++++++++++++++++-
|
||||
tests/test_gi.py | 17 +++++++++++++++++
|
||||
2 files changed, 54 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
|
||||
index d850052..beaecc0 100644
|
||||
--- gi/pygi-info.c
|
||||
+++ gi/pygi-info.c
|
||||
@@ -95,7 +95,43 @@ PYGLIB_DEFINE_TYPE("gi.BaseInfo", PyGIBaseInfo_Type, PyGIBaseInfo);
|
||||
static PyObject *
|
||||
_wrap_g_base_info_get_name (PyGIBaseInfo *self)
|
||||
{
|
||||
- return PYGLIB_PyUnicode_FromString (g_base_info_get_name (self->info));
|
||||
+ /* It may be better to use keyword.iskeyword(); keep in sync with
|
||||
+ * python -c 'import keyword; print keyword.kwlist' */
|
||||
+#if PY_VERSION_HEX < 0x03000000
|
||||
+ /* Python 2.x */
|
||||
+ static const gchar* keywords[] = {"and", "as", "assert", "break", "class",
|
||||
+ "continue", "def", "del", "elif", "else", "except", "exec", "finally",
|
||||
+ "for", "from", "global", "if", "import", "in", "is", "lambda", "not",
|
||||
+ "or", "pass", "print", "raise", "return", "try", "while", "with",
|
||||
+ "yield", NULL};
|
||||
+#elif PY_VERSION_HEX < 0x04000000
|
||||
+ /* Python 3.x; note that we explicitly keep "print"; it is not a keyword
|
||||
+ * any more, but still raises a SyntaxError */
|
||||
+ static const gchar* keywords[] = {"False", "None", "True", "and", "as",
|
||||
+ "assert", "break", "class", "continue", "def", "del", "elif", "else",
|
||||
+ "except", "finally", "for", "from", "global", "if", "import", "in",
|
||||
+ "is", "lambda", "nonlocal", "not", "or", "pass", "raise", "return",
|
||||
+ "try", "while", "with", "yield",
|
||||
+ "print", NULL};
|
||||
+#else
|
||||
+ #error Need keyword list for this major Python version
|
||||
+#endif
|
||||
+
|
||||
+ const gchar *name, **i;
|
||||
+
|
||||
+ name = g_base_info_get_name (self->info);
|
||||
+
|
||||
+ /* escape keywords */
|
||||
+ for (i = keywords; *i != NULL; ++i) {
|
||||
+ if (strcmp (name, *i) == 0) {
|
||||
+ gchar *escaped = g_strconcat (name, "_", NULL);
|
||||
+ PyObject *obj = PYGLIB_PyUnicode_FromString (escaped);
|
||||
+ g_free (escaped);
|
||||
+ return obj;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return PYGLIB_PyUnicode_FromString (name);
|
||||
}
|
||||
|
||||
static PyObject *
|
|
@ -1,7 +1,8 @@
|
|||
# Template file for 'pygobject-devel'.
|
||||
#
|
||||
noarch=yes
|
||||
depends="libffi-devel glib-devel libgirepository-devel pycairo-devel pygobject>=$version"
|
||||
depends="libffi-devel glib-devel libgirepository-devel
|
||||
pycairo-devel pygobject>=${version}"
|
||||
short_desc="${sourcepkg} development files"
|
||||
long_desc="${long_desc}
|
||||
|
||||
|
|
|
@ -6,5 +6,4 @@ libglib-2.0.so.0
|
|||
libpthread.so.0
|
||||
libc.so.6
|
||||
libgirepository-1.0.so.1
|
||||
libgmodule-2.0.so.0
|
||||
libcairo.so.2
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
# Template file for 'pygobject'
|
||||
pkgname=pygobject
|
||||
version=3.2.2
|
||||
revision=2
|
||||
version=3.4.0
|
||||
revision=1
|
||||
build_style=gnu-configure
|
||||
pycompile_module="gi"
|
||||
subpackages="$pkgname-devel"
|
||||
depends="python pycairo"
|
||||
makedepends="pkg-config glib-devel cairo-devel libffi-devel python-devel pycairo-devel gobject-introspection"
|
||||
makedepends="pkg-config glib-devel cairo-devel libffi-devel python-devel
|
||||
pycairo-devel gobject-introspection"
|
||||
short_desc="Python bindings for GObject"
|
||||
homepage="http://www.pygtk.org/"
|
||||
license="LGPL-2.1"
|
||||
distfiles="${GNOME_SITE}/$pkgname/3.2/$pkgname-$version.tar.xz"
|
||||
distfiles="${GNOME_SITE}/$pkgname/3.4/$pkgname-$version.tar.xz"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
checksum=4653790baaff0176fd814b88cfb5378c45906a120b25d01be2554f423b726eb0
|
||||
checksum=bc7f17b23aaa6b0a85f5f090f7ffa616b596bcab9f481f46fdb9d0d2d55b16bb
|
||||
long_desc="
|
||||
Pygobject is a set of Python bindings for the GLib's GObject library."
|
||||
|
|
Loading…
Reference in New Issue