diff options
| author | Johan Dahlin <johan@src.gnome.org> | 2006-04-11 15:14:36 +0000 |
|---|---|---|
| committer | Johan Dahlin <johan@src.gnome.org> | 2006-04-11 15:14:36 +0000 |
| commit | c10ecb8121f62361f744fd3d6034c9339890f6f8 (patch) | |
| tree | 77cae05805368e46a7a4b34dff8df104c4d630cb /gobject | |
| parent | dd6f0893eaea89726576fc960257334d00d4544e (diff) | |
| download | pygobject-c10ecb8121f62361f744fd3d6034c9339890f6f8.tar.gz pygobject-c10ecb8121f62361f744fd3d6034c9339890f6f8.tar.xz pygobject-c10ecb8121f62361f744fd3d6034c9339890f6f8.zip | |
Turn gobject into a package; move _gobject to gobject._gobject and
add gobject/__init__.py. Update macros and testsuite.
Diffstat (limited to 'gobject')
| -rw-r--r-- | gobject/.cvsignore | 1 | ||||
| -rw-r--r-- | gobject/Makefile.am | 16 | ||||
| -rw-r--r-- | gobject/__init__.py | 30 | ||||
| -rw-r--r-- | gobject/gobjectmodule.c | 4 | ||||
| -rw-r--r-- | gobject/pygobject.h | 4 |
5 files changed, 45 insertions, 10 deletions
diff --git a/gobject/.cvsignore b/gobject/.cvsignore index 6e5ca7e..eaa2776 100644 --- a/gobject/.cvsignore +++ b/gobject/.cvsignore @@ -4,3 +4,4 @@ Makefile.in .libs *.lo *.la +*.pyc diff --git a/gobject/Makefile.am b/gobject/Makefile.am index 2416fd5..d8e17c3 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -6,17 +6,21 @@ pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) pkginclude_HEADERS = pygobject.h pkgpyexecdir = $(pyexecdir)/gtk-2.0 -pkgpyexec_LTLIBRARIES = gobject.la +pkgpyexec_LTLIBRARIES = _gobject.la common_ldflags = -module -avoid-version if PLATFORM_WIN32 common_ldflags += -no-undefined endif -gobject_la_CFLAGS = $(GLIB_CFLAGS) -gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initgobject -gobject_la_LIBADD = $(GLIB_LIBS) -gobject_la_SOURCES = \ +# gobject python scripts +pygobjectdir = $(pkgpythondir)/gtk +pygobject_PYTHON = __init__.py + +_gobject_la_CFLAGS = $(GLIB_CFLAGS) +_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gobject +_gobject_la_LIBADD = $(GLIB_LIBS) +_gobject_la_SOURCES = \ gobjectmodule.c \ pygboxed.c \ pygenum.c \ @@ -33,5 +37,5 @@ gobject_la_SOURCES = \ pygtype.c if PLATFORM_WIN32 -gobject_la_CFLAGS += -DPLATFORM_WIN32 +_gobject_la_CFLAGS += -DPLATFORM_WIN32 endif diff --git a/gobject/__init__.py b/gobject/__init__.py new file mode 100644 index 0000000..c31c777 --- /dev/null +++ b/gobject/__init__.py @@ -0,0 +1,30 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# pygobject - Python bindings for the GObject library +# Copyright (C) 2006 Johan Dahlin +# +# gobject/__init__.py: initialisation file for gobject module +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +# this can go when things are a little further along +try: + import ltihooks + ltihooks # pyflakes + del ltihooks +except ImportError: + pass + +from _gobject import * diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 30d0e5c..9f4faaf 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -2966,7 +2966,7 @@ struct _PyGObject_Functions pygobject_api_functions = { Py_DECREF(o); DL_EXPORT(void) -initgobject(void) +init_gobject(void) { PyObject *m, *d, *o, *tuple; PyObject *descr; @@ -2974,7 +2974,7 @@ initgobject(void) PyGParamSpec_Type.ob_type = &PyType_Type; - m = Py_InitModule("gobject", pygobject_functions); + m = Py_InitModule("gobject._gobject", pygobject_functions); d = PyModule_GetDict(m); g_type_init(); diff --git a/gobject/pygobject.h b/gobject/pygobject.h index 55c72b1..2115b34 100644 --- a/gobject/pygobject.h +++ b/gobject/pygobject.h @@ -263,7 +263,7 @@ struct _PyGObject_Functions *_PyGObject_API; } G_STMT_END #define init_pygobject() G_STMT_START { \ - PyObject *gobject = PyImport_ImportModule("gobject"); \ + PyObject *gobject = PyImport_ImportModule("gobject._gobject"); \ if (gobject != NULL) { \ PyObject *mdict = PyModule_GetDict(gobject); \ PyObject *cobject = PyDict_GetItemString(mdict, "_PyGObject_API"); \ @@ -276,7 +276,7 @@ struct _PyGObject_Functions *_PyGObject_API; } \ } else { \ PyErr_SetString(PyExc_ImportError, \ - "could not import gobject"); \ + "could not import gobject._gobjet"); \ return; \ } \ } G_STMT_END |
