diff options
author | monsta <[email protected]> | 2016-12-13 11:27:19 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-12-13 11:27:19 +0300 |
commit | b4ddcc1d1f7635d19db4b015a54b45dca63e2c88 (patch) | |
tree | 97697bcc3131c21603cfda03a65fa3d22ef7b801 /python | |
parent | bfa1740cce3269373d055b5fb9f5f6867d63d0cb (diff) | |
download | libmateweather-b4ddcc1d1f7635d19db4b015a54b45dca63e2c88.tar.bz2 libmateweather-b4ddcc1d1f7635d19db4b015a54b45dca63e2c88.tar.xz |
drop Python bindings and --enable-python build option
it requires PyGTK so won't even build with GTK+3
Diffstat (limited to 'python')
-rw-r--r-- | python/Makefile.am | 37 | ||||
-rw-r--r-- | python/bad__init__.py | 11 | ||||
-rw-r--r-- | python/demo.py | 7 | ||||
-rw-r--r-- | python/mateweather.defs | 326 | ||||
-rw-r--r-- | python/mateweather.override | 104 | ||||
-rw-r--r-- | python/mateweathermodule.c | 44 |
6 files changed, 0 insertions, 529 deletions
diff --git a/python/Makefile.am b/python/Makefile.am deleted file mode 100644 index e31af06..0000000 --- a/python/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -if BUILD_PYTHON -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(PYTHON_INCLUDES) \ - $(PYGOBJECT_CFLAGS) \ - $(GTK_CFLAGS) - -pyunstabledir = $(pyexecdir)/mateweather/I_KNOW_THIS_IS_UNSTABLE -pyunstable_LTLIBRARIES = mateweather.la -mateweather_la_LDFLAGS = -module -avoid-version -export-symbols-regex initmateweather -mateweather_la_LIBADD = ../libmateweather/libmateweather.la -mateweather_la_SOURCES = mateweathermodule.c -nodist_mateweather_la_SOURCES = mateweather.c -mateweather.c: mateweather.defs mateweather.override - -.defs.c: - $(AM_V_GEN)(cd $(srcdir)\ - && pygobject-codegen-2.0 \ - --register $(PYGTK_DEFS) \ - --override $*.override \ - --prefix py$* $*.defs) > gen-$*.c \ - && cp gen-$*.c $*.c \ - && rm -f gen-$*.c - -install-exec-hook: - $(MKDIR_P) "$(DESTDIR)$(pyunstabledir)" - $(INSTALL_DATA) $(srcdir)/bad__init__.py "$(DESTDIR)$(pyexecdir)/mateweather/__init__.py" - touch $(DESTDIR)$(pyunstabledir)/__init__.py - chmod a+x $(DESTDIR)$(pyunstabledir)/__init__.py - -endif - -EXTRA_DIST = mateweather.defs mateweather.override bad__init__.py demo.py - -CLEANFILES = mateweather.c - --include $(top_srcdir)/git.mk diff --git a/python/bad__init__.py b/python/bad__init__.py deleted file mode 100644 index 11a6970..0000000 --- a/python/bad__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# The correct idiom is -# from mateweather.I_KNOW_THIS_IS_UNSTABLE import mateweather - -def location_new_world(use_regions): - raise ImportError("libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform") - -def location_entry_new(top): - raise ImportError("libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform") - -def timezone_menu_new(top): - raise ImportError("libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform") diff --git a/python/demo.py b/python/demo.py deleted file mode 100644 index 4ecb0f1..0000000 --- a/python/demo.py +++ /dev/null @@ -1,7 +0,0 @@ -from mateweather.I_KNOW_THIS_IS_UNSTABLE import mateweather - -for loc in mateweather.location_new_world(False).get_children(): - print loc.get_name() - for zone in loc.get_timezones(): - if zone.get_name() is not None: - print " %s" % zone.get_name() diff --git a/python/mateweather.defs b/python/mateweather.defs deleted file mode 100644 index bfbf24a..0000000 --- a/python/mateweather.defs +++ /dev/null @@ -1,326 +0,0 @@ -;; -*- scheme -*- -; boxed definitions ... - -(define-boxed Location - (in-module "MateWeather") - (c-name "MateWeatherLocation") - (gtype-id "MATEWEATHER_TYPE_LOCATION") -) - -(define-boxed Timezone - (in-module "MateWeather") - (c-name "MateWeatherTimezone") - (gtype-id "MATEWEATHER_TYPE_TIMEZONE") -) - -; interface definitions ... - -; object definitions ... - -(define-object LocationEntry - (in-module "MateWeather") - (parent "GtkEntry") - (c-name "MateWeatherLocationEntry") - (gtype-id "MATEWEATHER_TYPE_LOCATION_ENTRY") -) - -(define-object TimezoneMenu - (in-module "MateWeather") - (parent "GtkComboBox") - (c-name "MateWeatherTimezoneMenu") - (gtype-id "MATEWEATHER_TYPE_TIMEZONE_MENU") -) - -; pointer definitions ... - -;; Enumerations and Flags ... - -(define-enum LocationLevel - (in-module "MateWeather") - (c-name "MateWeatherLocationLevel") - (gtype-id "MATEWEATHER_TYPE_LOCATION_LEVEL") - (values - '("world" "MATEWEATHER_LOCATION_WORLD") - '("region" "MATEWEATHER_LOCATION_REGION") - '("country" "MATEWEATHER_LOCATION_COUNTRY") - '("adm1" "MATEWEATHER_LOCATION_ADM1") - '("adm2" "MATEWEATHER_LOCATION_ADM2") - '("city" "MATEWEATHER_LOCATION_CITY") - '("weather-station" "MATEWEATHER_LOCATION_WEATHER_STATION") - ) -) - - -;; From mateweather-enum-types.h - -(define-function g_weather_location_level_get_type - (c-name "g_weather_location_level_get_type") - (return-type "GType") -) - - - -;; From mateweather-location.h - -(define-function location_get_type - (c-name "mateweather_location_get_type") - (return-type "GType") -) - -(define-function location_new_world - (c-name "mateweather_location_new_world") - (return-type "MateWeatherLocation*") - (parameters - '("gboolean" "use_regions") - ) -) - -(define-method ref - (of-object "MateWeatherLocation") - (c-name "mateweather_location_ref") - (return-type "MateWeatherLocation*") -) - -(define-method unref - (of-object "MateWeatherLocation") - (c-name "mateweather_location_unref") - (return-type "none") -) - -(define-method get_name - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_name") - (return-type "const-char*") -) - -(define-method get_sort_name - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_sort_name") - (return-type "const-char*") -) - -(define-method get_level - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_level") - (return-type "MateWeatherLocationLevel") -) - -(define-method get_parent - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_parent") - (return-type "MateWeatherLocation*") -) - -(define-method get_children - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_children") - (return-type "MateWeatherLocation**") -) - -(define-method free_children - (of-object "MateWeatherLocation") - (c-name "mateweather_location_free_children") - (return-type "none") - (parameters - '("MateWeatherLocation**" "children") - ) -) - -(define-method has_coords - (of-object "MateWeatherLocation") - (c-name "mateweather_location_has_coords") - (return-type "gboolean") -) - -(define-method get_coords - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_coords") - (return-type "none") - (parameters - '("double*" "latitude") - '("double*" "longitude") - ) -) - -(define-method get_distance - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_distance") - (return-type "double") - (parameters - '("MateWeatherLocation*" "loc2") - ) -) - -(define-method get_country - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_country") - (return-type "const-char*") -) - -(define-method get_timezone - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_timezone") - (return-type "MateWeatherTimezone*") -) - -(define-method get_timezones - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_timezones") - (return-type "MateWeatherTimezone**") -) - -(define-method free_timezones - (of-object "MateWeatherLocation") - (c-name "mateweather_location_free_timezones") - (return-type "none") - (parameters - '("MateWeatherTimezone**" "zones") - ) -) - -(define-method get_code - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_code") - (return-type "const-char*") -) - -(define-method get_city_name - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_city_name") - (return-type "char*") -) - -(define-method get_weather - (of-object "MateWeatherLocation") - (c-name "mateweather_location_get_weather") - (return-type "WeatherInfo*") -) - - - -;; From mateweather-timezone.h - -(define-function timezone_get_type - (c-name "mateweather_timezone_get_type") - (return-type "GType") -) - -(define-method get_name - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_get_name") - (return-type "const-char*") -) - -(define-method get_tzid - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_get_tzid") - (return-type "const-char*") -) - -(define-method get_offset - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_get_offset") - (return-type "int") -) - -(define-method has_dst - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_has_dst") - (return-type "gboolean") -) - -(define-method get_dst_offset - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_get_dst_offset") - (return-type "int") -) - -(define-method ref - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_ref") - (return-type "MateWeatherTimezone*") -) - -(define-method unref - (of-object "MateWeatherTimezone") - (c-name "mateweather_timezone_unref") - (return-type "none") -) - - - -;; From location-entry.h - -(define-function location_entry_get_type - (c-name "mateweather_location_entry_get_type") - (return-type "GType") -) - -(define-function location_entry_new - (c-name "mateweather_location_entry_new") - (is-constructor-of "MateWeatherLocationEntry") - (return-type "GtkWidget*") - (properties - '("top") - ) -) - -(define-method set_location - (of-object "MateWeatherLocationEntry") - (c-name "mateweather_location_entry_set_location") - (return-type "none") - (parameters - '("MateWeatherLocation*" "loc") - ) -) - -(define-method get_location - (of-object "MateWeatherLocationEntry") - (c-name "mateweather_location_entry_get_location") - (return-type "MateWeatherLocation*") -) - -(define-method set_city - (of-object "MateWeatherLocationEntry") - (c-name "mateweather_location_entry_set_city") - (return-type "none") - (parameters - '("const-char*" "city_name") - '("const-char*" "code") - ) -) - - - -;; From timezone-menu.h - -(define-function timezone_menu_get_type - (c-name "mateweather_timezone_menu_get_type") - (return-type "GType") -) - -(define-function timezone_menu_new - (c-name "mateweather_timezone_menu_new") - (is-constructor-of "MateWeatherTimezoneMenu") - (return-type "GtkWidget*") - (properties - '("top") - ) -) - -(define-method set_tzid - (of-object "MateWeatherTimezoneMenu") - (c-name "mateweather_timezone_menu_set_tzid") - (return-type "none") - (parameters - '("const-char*" "tzid") - ) -) - -(define-method get_tzid - (of-object "MateWeatherTimezoneMenu") - (c-name "mateweather_timezone_menu_get_tzid") - (return-type "const-char*") -) - - diff --git a/python/mateweather.override b/python/mateweather.override deleted file mode 100644 index 16ce1e0..0000000 --- a/python/mateweather.override +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- - * - * mateweather.override: overrides for mateweather - */ -%% -headers -#define NO_IMPORT_PYGOBJECT -#include "pygobject.h" - -#define MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE -#include <libmateweather/mateweather-location.h> -#include <libmateweather/mateweather-timezone.h> -#include <libmateweather/location-entry.h> -#include <libmateweather/timezone-menu.h> -#include <libmateweather/mateweather-enum-types.h> - -%% -modulename mateweather -%% -import gtk.Entry as PyGtkEntry_Type -import gtk.ComboBox as PyGtkComboBox_Type -%% -ignore - mateweather_location_get_weather - mateweather_location_free_children - mateweather_location_free_timezones -%% -ignore-glob - *_get_type - *_ref - *_unref -%% -override mateweather_location_get_children -static PyObject * -_wrap_mateweather_location_get_children (PyGObject *self, PyObject *args) -{ - MateWeatherLocation *loc, **children; - int i; - PyObject *pychildren, *pychild; - - loc = pyg_boxed_get (self, MateWeatherLocation); - children = mateweather_location_get_children (loc); - for (i = 0; children[i]; i++) - ; - - pychildren = PyList_New (i); - for (i = 0; children[i]; i++) { - pychild = pyg_boxed_new (MATEWEATHER_TYPE_LOCATION, children[i], TRUE, TRUE); - PyList_SetItem (pychildren, i, pychild); - } - - mateweather_location_free_children (loc, children); - return pychildren; -} -%% -override mateweather_location_get_timezones -static PyObject * -_wrap_mateweather_location_get_timezones (PyGObject *self, PyObject *args) -{ - MateWeatherLocation *loc; - MateWeatherTimezone **zones; - int i; - PyObject *pyzones, *pyzone; - - loc = pyg_boxed_get (self, MateWeatherLocation); - zones = mateweather_location_get_timezones (loc); - for (i = 0; zones[i]; i++) - ; - - pyzones = PyList_New (i); - for (i = 0; zones[i]; i++) { - pyzone = pyg_boxed_new (MATEWEATHER_TYPE_TIMEZONE, zones[i], TRUE, TRUE); - PyList_SetItem (pyzones, i, pyzone); - } - - mateweather_location_free_timezones (loc, zones); - return pyzones; -} -%% -override mateweather_location_get_coords -static PyObject * -_wrap_mateweather_location_get_coords (PyGObject *self, PyObject *args) -{ - MateWeatherLocation *loc; - double latitude, longitude; - PyObject *ret; - - loc = pyg_boxed_get (self, MateWeatherLocation); - if (!mateweather_location_has_coords (loc)) { - Py_INCREF (Py_None); - return Py_None; - } - - mateweather_location_get_coords (loc, &latitude, &longitude); - ret = PyTuple_New (2); - PyTuple_SetItem (ret, 0, PyFloat_FromDouble (latitude)); - PyTuple_SetItem (ret, 1, PyFloat_FromDouble (longitude)); - return ret; -} -%% -new-constructor MATEWEATHER_TYPE_LOCATION_ENTRY -%% -new-constructor MATEWEATHER_TYPE_TIMEZONE_MENU -%% diff --git a/python/mateweathermodule.c b/python/mateweathermodule.c deleted file mode 100644 index 67ee89e..0000000 --- a/python/mateweathermodule.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- - * - * mateweathermodule.c: module wrapping mateweather. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * <http://www.gnu.org/licenses/>. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* include this first, before NO_IMPORT_PYGOBJECT is defined */ -#include <pygobject.h> - -void pymateweather_register_classes (PyObject *d); -void pymateweather_add_constants(PyObject *module, const gchar *strip_prefix); -void _pymateweather_register_boxed_types(void); - -extern PyMethodDef pymateweather_functions[]; - -DL_EXPORT(void) -initmateweather(void) -{ - PyObject *m, *d; - - init_pygobject (); - - m = Py_InitModule ("mateweather", pymateweather_functions); - d = PyModule_GetDict (m); - pymateweather_register_classes (d); - pymateweather_add_constants(m, "MATEWEATHER_"); -} |