From a34cabf2570bd4a190896f42de49201b421260da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 18 Mar 2020 18:30:26 -0400 Subject: python: Remove python bindings, use GI instead --- python/__init__.py | 0 python/pygupnp-igd-filters.defs | 22 -------- python/pygupnp-igd-module.c | 31 ------------ python/pygupnp-igd.defs | 108 ---------------------------------------- python/pygupnp-igd.override | 12 ----- python/rebuild-defs.sh | 26 ---------- 6 files changed, 199 deletions(-) delete mode 100644 python/__init__.py delete mode 100644 python/pygupnp-igd-filters.defs delete mode 100644 python/pygupnp-igd-module.c delete mode 100644 python/pygupnp-igd.defs delete mode 100644 python/pygupnp-igd.override delete mode 100755 python/rebuild-defs.sh diff --git a/python/__init__.py b/python/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/python/pygupnp-igd-filters.defs b/python/pygupnp-igd-filters.defs deleted file mode 100644 index 14efe02..0000000 --- a/python/pygupnp-igd-filters.defs +++ /dev/null @@ -1,22 +0,0 @@ -(define-object Simple - (in-module "GUPnPIgd") - (parent "GObject") - (c-name "GUPnPSimpleIgd") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD") -) - -(define-object SimpleThread - (in-module "GUPnPSimpleIgd") - (parent "GUPnPSimpleIgd") - (c-name "GUPnPSimpleIgdThread") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD_THREAD") -) - -(define-enum Error - (in-module "GUPnPSimpleIgd") - (c-name "GUPnPSimpleIgdError") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD_ERROR") - (values - '("s" "GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS") - ) -) diff --git a/python/pygupnp-igd-module.c b/python/pygupnp-igd-module.c deleted file mode 100644 index 11373ee..0000000 --- a/python/pygupnp-igd-module.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -void igd_register_classes (PyObject *d); -void igd_add_constants(PyObject *module, const gchar *strip_prefix); - -DL_EXPORT(void) initigd(void); -extern PyMethodDef igd_functions[]; - -DL_EXPORT(void) -initigd(void) -{ - PyObject *m, *d; - - init_pygobject (); - - m = Py_InitModule ("igd", igd_functions); - d = PyModule_GetDict (m); - - //PyModule_AddIntConstant (m, "CODEC_ID_ANY", FS_CODEC_ID_ANY); - //PyModule_AddIntConstant (m, "CODEC_ID_ANY", FS_CODEC_ID_ANY); - - igd_register_classes (d); - igd_add_constants(m, "GUPNP_"); - - if (PyErr_Occurred ()) { - PyErr_Print(); - Py_FatalError ("can't initialise module gupnp.igd"); - } -} diff --git a/python/pygupnp-igd.defs b/python/pygupnp-igd.defs deleted file mode 100644 index 8f758dc..0000000 --- a/python/pygupnp-igd.defs +++ /dev/null @@ -1,108 +0,0 @@ -(define-object Simple - (in-module "GUPnPIgd") - (parent "GObject") - (c-name "GUPnPSimpleIgd") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD") -) - -(define-object SimpleThread - (in-module "GUPnPSimpleIgd") - (parent "GUPnPSimpleIgd") - (c-name "GUPnPSimpleIgdThread") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD_THREAD") -) - -(define-enum Error - (in-module "GUPnPSimpleIgd") - (c-name "GUPnPSimpleIgdError") - (gtype-id "GUPNP_TYPE_SIMPLE_IGD_ERROR") - (values - '("s" "GUPNP_SIMPLE_IGD_ERROR_EXTERNAL_ADDRESS") - ) -) -;; -*- scheme -*- -; object definitions ... -;; Enumerations and flags ... - - -;; From gupnp-simple-igd.h - -(define-function error_quark - (c-name "gupnp_simple_igd_error_quark") - (return-type "GQuark") -) - -(define-function get_type - (c-name "gupnp_simple_igd_get_type") - (return-type "GType") -) - -(define-function new - (c-name "gupnp_simple_igd_new") - (is-constructor-of "GupnpSimpleIgd") - (return-type "GUPnPSimpleIgd*") -) - -(define-method add_port - (of-object "GUPnPSimpleIgd") - (c-name "gupnp_simple_igd_add_port") - (return-type "none") - (parameters - '("const-gchar*" "protocol") - '("guint16" "external_port") - '("const-gchar*" "local_ip") - '("guint16" "local_port") - '("guint32" "lease_duration") - '("const-gchar*" "description") - ) -) - -(define-method remove_port - (of-object "GUPnPSimpleIgd") - (c-name "gupnp_simple_igd_remove_port") - (return-type "none") - (parameters - '("const-gchar*" "protocol") - '("guint" "external_port") - ) -) - -(define-method delete_all_mappings - (of-object "GUPnPSimpleIgd") - (c-name "gupnp_simple_igd_delete_all_mappings") - (return-type "gboolean") -) - - -;; -*- scheme -*- -; object definitions ... -;; Enumerations and flags ... - - -;; From gupnp-simple-igd-thread.h - -(define-function thread_get_type - (c-name "gupnp_simple_igd_thread_get_type") - (return-type "GType") -) - -(define-function thread_new - (c-name "gupnp_simple_igd_thread_new") - (is-constructor-of "GupnpSimpleIgdThread") - (return-type "GUPnPSimpleIgdThread*") -) - - -;; -*- scheme -*- -; object definitions ... -;; Enumerations and flags ... - - -;; From gupnp-enum-types.h - -(define-function error_get_type - (c-name "gupnp_simple_igd_error_get_type") - (return-type "GType") -) - - diff --git a/python/pygupnp-igd.override b/python/pygupnp-igd.override deleted file mode 100644 index b939604..0000000 --- a/python/pygupnp-igd.override +++ /dev/null @@ -1,12 +0,0 @@ -%% -headers -#include -#include -#include -#include -#include - -%% -modulename gupnpigd -%% -import gobject.GObject as PyGObject_Type diff --git a/python/rebuild-defs.sh b/python/rebuild-defs.sh deleted file mode 100755 index 357c4cf..0000000 --- a/python/rebuild-defs.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -HEADERS=" \ - gupnp-simple-igd.h \ - gupnp-simple-igd-thread.h \ - gupnp-enum-types.h" - -srcdir=../libgupnp-igd/ - -output=pygupnp-igd.defs -filter=pygupnp-igd-filters.defs -modulename=gupnp_simple_igd - -cat $filter>$output - -H2DEF="$(pkg-config --variable=codegendir pygobject-2.0)/h2def.py" -[ -z "${H2DEF}" ] && H2DEF="$(pkg-config --variable=codegendir pygtk-2.0)/h2def.py" -[ -z "${H2DEF}" -a -f /usr/share/pygtk/2.0/codegen/h2def.py ] && H2DEF=/usr/share/pygtk/2.0/codegen/h2def.py - -for h in $HEADERS; do - python ${H2DEF} --defsfilter=${filter} --modulename=${modulename} ${srcdir}/$h >> $output -done - -sed -e "/of-object \"GUPnpSimpleIgd\"/ a \ - \ (unblock-threads t)" \ - -i ${output} -- cgit v1.2.1