use pygtk.require to determine database
svn: r1205
This commit is contained in:
parent
dbe98f4068
commit
f53f056885
23
configure
vendored
23
configure
vendored
@ -1874,8 +1874,6 @@ echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
|
||||
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
|
||||
|
||||
if test "$PYTHON_VERSION" != "2.2"
|
||||
then
|
||||
# Extract the first word of "python2.2", so it can be a program name with args.
|
||||
@ -3637,11 +3635,18 @@ fi
|
||||
GNOMEINC=`pkg-config --cflags gnome-vfs-module-2.0`
|
||||
GNOMELIB=`pkg-config --libs gnome-vfs-module-2.0`
|
||||
|
||||
pygtk_require="try:
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
except ImportError:
|
||||
pass
|
||||
"
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking Python bindings for gtk" >&5
|
||||
echo $ECHO_N "checking Python bindings for gtk... $ECHO_C" >&6
|
||||
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gobject
|
||||
f = open("conftest.out", "w")
|
||||
@ -3652,7 +3657,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -3671,7 +3675,6 @@ echo "${ECHO_T}ok" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking Python bindings for GNOME" >&5
|
||||
echo $ECHO_N "checking Python bindings for GNOME... $ECHO_C" >&6
|
||||
|
||||
cat > conftest.py <<EOF
|
||||
try:
|
||||
import gnome, gnome.ui
|
||||
@ -3683,7 +3686,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
|
||||
$PYTHON conftest.py
|
||||
has_pygnome=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -3700,8 +3702,8 @@ echo "${ECHO_T}ok" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking Python bindings for gconf" >&5
|
||||
echo $ECHO_N "checking Python bindings for gconf... $ECHO_C" >&6
|
||||
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gconf
|
||||
f = open("conftest.out", "w")
|
||||
@ -3712,7 +3714,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
|
||||
$PYTHON conftest.py
|
||||
has_gconf=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -3729,8 +3730,8 @@ echo "${ECHO_T}ok" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking Python bindings for GNOME canvas" >&5
|
||||
echo $ECHO_N "checking Python bindings for GNOME canvas... $ECHO_C" >&6
|
||||
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gnome.canvas
|
||||
f = open("conftest.out", "w")
|
||||
@ -3741,7 +3742,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
|
||||
$PYTHON conftest.py
|
||||
has_canvas=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -3758,8 +3758,8 @@ echo "${ECHO_T}ok" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking Python bindin for glade" >&5
|
||||
echo $ECHO_N "checking Python bindin for glade... $ECHO_C" >&6
|
||||
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gtk.glade
|
||||
f = open("conftest.out", "w")
|
||||
@ -3770,7 +3770,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
|
25
configure.in
25
configure.in
@ -44,10 +44,6 @@ pkgpyexecdir=\${prefix}/share/\${PACKAGE}
|
||||
AC_PATH_PROG(BINSH, sh)
|
||||
AC_PATH_PROG(SWIG, swig)
|
||||
|
||||
changequote(<<, >>)dnl
|
||||
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
|
||||
changequote([, ])dnl
|
||||
|
||||
if test "$PYTHON_VERSION" != "2.2"
|
||||
then
|
||||
AC_PATH_PROG(PYTHON22, python2.2)
|
||||
@ -76,11 +72,18 @@ AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, "YES", "NO")
|
||||
GNOMEINC=`pkg-config --cflags gnome-vfs-module-2.0`
|
||||
GNOMELIB=`pkg-config --libs gnome-vfs-module-2.0`
|
||||
|
||||
pygtk_require="try:
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
except ImportError:
|
||||
pass
|
||||
"
|
||||
|
||||
dnl Check if python bindings for gtk are installed
|
||||
|
||||
AC_MSG_CHECKING(Python bindings for gtk)
|
||||
changequote(,)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gobject
|
||||
f = open("conftest.out", "w")
|
||||
@ -91,7 +94,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
changequote([, ])
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -104,7 +106,6 @@ fi
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(Python bindings for GNOME)
|
||||
changequote(,)
|
||||
cat > conftest.py <<EOF
|
||||
try:
|
||||
import gnome, gnome.ui
|
||||
@ -116,7 +117,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
changequote([, ])
|
||||
$PYTHON conftest.py
|
||||
has_pygnome=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -128,8 +128,8 @@ fi
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(Python bindings for gconf)
|
||||
changequote(,)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gconf
|
||||
f = open("conftest.out", "w")
|
||||
@ -140,7 +140,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
changequote([, ])
|
||||
$PYTHON conftest.py
|
||||
has_gconf=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -152,8 +151,8 @@ fi
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(Python bindings for GNOME canvas)
|
||||
changequote(,)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gnome.canvas
|
||||
f = open("conftest.out", "w")
|
||||
@ -164,7 +163,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
changequote([, ])
|
||||
$PYTHON conftest.py
|
||||
has_canvas=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
@ -176,8 +174,8 @@ fi
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(Python bindin for glade)
|
||||
changequote(,)
|
||||
cat > conftest.py <<EOF
|
||||
$pygtk_require
|
||||
try:
|
||||
import gtk.glade
|
||||
f = open("conftest.out", "w")
|
||||
@ -188,7 +186,6 @@ except ImportError:
|
||||
f.write("NO")
|
||||
f.close()
|
||||
EOF
|
||||
changequote([, ])
|
||||
$PYTHON conftest.py
|
||||
has_pygtk=`cat conftest.out`
|
||||
rm -f conftest.out conftest.py
|
||||
|
Binary file not shown.
@ -43,6 +43,12 @@ from intl import gettext as _
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -37,6 +37,11 @@ from intl import gettext as _
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk.glade
|
||||
|
||||
|
@ -27,6 +27,11 @@ mechanism for the user to edit address information.
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -30,6 +30,11 @@ __version__ = "$Revision$"
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,11 @@ import string
|
||||
# GNOME modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,11 @@ __version__ = "$Revision$"
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
||||
|
@ -38,6 +38,11 @@ from intl import gettext as _
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk.glade
|
||||
|
||||
|
@ -34,6 +34,11 @@ __version__ = "$Revision$"
|
||||
# GNOME modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gtk.gdk
|
||||
|
||||
|
@ -24,6 +24,11 @@
|
||||
# GNOME modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
||||
|
@ -32,6 +32,11 @@ import sys
|
||||
# GTK/GNOME modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -31,6 +31,11 @@ import pickle
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
@ -30,6 +30,11 @@ import pickle
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
@ -24,6 +24,11 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,11 @@ from string import strip
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
||||
|
@ -23,6 +23,11 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
@ -26,6 +26,12 @@
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
|
||||
from intl import gettext as _
|
||||
|
@ -35,6 +35,11 @@ import string
|
||||
# Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
from gnome.ui import *
|
||||
|
||||
|
@ -39,6 +39,12 @@ except:
|
||||
#-------------------------------------------------------------------------
|
||||
import os
|
||||
from string import find,join,strip,replace
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -35,6 +35,11 @@ import Plugins
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gconf
|
||||
import gtk
|
||||
|
@ -32,6 +32,11 @@ import urlparse
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
@ -27,6 +27,11 @@ import string
|
||||
# Check for the python imaging library
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
try:
|
||||
import PIL.Image
|
||||
import StringIO
|
||||
@ -34,10 +39,7 @@ try:
|
||||
no_pil = 0
|
||||
except:
|
||||
import popen2
|
||||
# import GDK
|
||||
# import GTK
|
||||
import gtk
|
||||
# import GdkImlib
|
||||
no_pil = 1
|
||||
|
||||
class ImgManip:
|
||||
|
@ -18,6 +18,11 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
from gobject import TYPE_STRING, TYPE_PYOBJECT
|
||||
import gtk
|
||||
|
||||
|
@ -23,6 +23,10 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -7,6 +7,7 @@ CFLAGS = -fPIC -shared -O @GNOMEINC@ @CFLAGS@ @CPPFLAGS@ -I@includedir@
|
||||
LDFLAGS = @GNOMELIB@ @LDFLAGS@ -L@libdir@ @LIBS@
|
||||
CLEANFILES = ${INTLLIBS}
|
||||
MOSTLYCLEANFILES =
|
||||
INTLLIBS= intl22.so
|
||||
|
||||
# What are the PYTHON scripts for this package that need to be handled?
|
||||
#
|
||||
@ -25,7 +26,6 @@ pkgdata_DATA = ${INTLLIBS} ${GLADEFILES} ${GRAPHICS} gramps.desktop grampslib.so
|
||||
|
||||
EXTRA_DIST = grampslib.i
|
||||
|
||||
|
||||
all: ${INTLLIBS} grampslib.so
|
||||
|
||||
DIST_SOURCES = intl.c
|
||||
@ -36,8 +36,7 @@ dist_pkgdata_DATA = ${pkgdata_DATA}
|
||||
intl22.so: intl.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c
|
||||
|
||||
grampslib.so: grampslib.i
|
||||
$(SWIG) -python grampslib.i
|
||||
grampslib.so: grampslib_wrap.c
|
||||
$(CC) $(CFLAGS) @P22_INCLUDES@ -o $@ grampslib_wrap.c $(LDFLAGS)
|
||||
|
||||
# In principle the following rule slightly violates the automake/autoconf
|
||||
|
@ -76,7 +76,7 @@ GPREF = @GPREF@
|
||||
HAVE_JW = @HAVE_JW@
|
||||
HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLLIBS = intl22.so
|
||||
JW = @JW@
|
||||
LANGUAGES = @LANGUAGES@
|
||||
LIBS = @LIBS@
|
||||
@ -455,8 +455,7 @@ all: ${INTLLIBS} grampslib.so
|
||||
intl22.so: intl.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c
|
||||
|
||||
grampslib.so: grampslib.i
|
||||
$(SWIG) -python grampslib.i
|
||||
grampslib.so: grampslib_wrap.c
|
||||
$(CC) $(CFLAGS) @P22_INCLUDES@ -o $@ grampslib_wrap.c $(LDFLAGS)
|
||||
|
||||
# In principle the following rule slightly violates the automake/autoconf
|
||||
|
@ -25,6 +25,10 @@ import pickle
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
@ -30,6 +30,10 @@ import string
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.gdk
|
||||
|
@ -30,6 +30,10 @@ import string
|
||||
# GNOME
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,10 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,10 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
||||
|
@ -23,6 +23,10 @@
|
||||
# GNOME modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -22,13 +22,27 @@ _PAD = 3
|
||||
_CANVASPAD = 3
|
||||
_PERSON = "p"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gtk.gdk
|
||||
import gnome.canvas
|
||||
import pango
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps Modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import GrampsCfg
|
||||
|
||||
from intl import gettext as _
|
||||
|
||||
class DispBox:
|
||||
@ -140,10 +154,10 @@ class PedigreeView:
|
||||
as the root person of the tree."""
|
||||
|
||||
for i in self.canvas_items:
|
||||
i.destroy()
|
||||
self.i.destroy()
|
||||
for i in self.boxes:
|
||||
i.cleanup()
|
||||
|
||||
|
||||
if person is not self.active_person:
|
||||
del self.presel_descendants[:]
|
||||
self.active_person = person
|
||||
@ -195,7 +209,6 @@ class PedigreeView:
|
||||
xpts = self.build_x_coords(cw/xdiv,_CANVASPAD+h)
|
||||
ypts = self.build_y_coords((ch-h)/32.0, h)
|
||||
|
||||
self.canvas_items = []
|
||||
for family in self.active_person.getFamilyList():
|
||||
if len(family.getChildList()) > 0:
|
||||
button,arrow = self.make_arrow_button(gtk.ARROW_LEFT,
|
||||
|
@ -27,6 +27,10 @@ Handles the place view for GRAMPS.
|
||||
# GTK modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.gdk
|
||||
|
@ -32,6 +32,10 @@ filters, importer, exporters, and document generators.
|
||||
# GTK libraries
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.glade
|
||||
|
@ -18,6 +18,11 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gnome.ui
|
||||
from intl import gettext as _
|
||||
|
@ -18,6 +18,10 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
import Utils
|
||||
|
@ -31,6 +31,10 @@ import string
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
|
@ -36,6 +36,10 @@ import string
|
||||
# GNOME/GTK modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
||||
|
@ -37,6 +37,10 @@ import string
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -29,6 +29,10 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gobject
|
||||
import gtk
|
||||
import gtk.gdk
|
||||
|
@ -19,6 +19,11 @@
|
||||
#
|
||||
|
||||
import const
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
import gnome
|
||||
import gconf
|
||||
|
@ -30,6 +30,10 @@ __version__ = "$Revision$"
|
||||
# GNOME/GTK modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
import gtk
|
||||
|
||||
|
@ -23,6 +23,10 @@
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -31,6 +31,10 @@ import os
|
||||
# GNOME/GTK
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk
|
||||
import grampslib
|
||||
|
||||
|
@ -37,6 +37,10 @@ from re import compile
|
||||
# GTK/GNOME
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
import gtk.glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -57,7 +57,7 @@ if os.environ.has_key('GRAMPSDIR'):
|
||||
else:
|
||||
rootDir = "."
|
||||
|
||||
papersize = "%s/papersize.xml" % rootDir
|
||||
papersize = "file:%s/papersize.xml" % rootDir
|
||||
good_xpm = "%s/good.png" % rootDir
|
||||
bad_xpm = "%s/bad.png" % rootDir
|
||||
caution_xpm = "%s/caution.png" % rootDir
|
||||
|
@ -57,7 +57,7 @@ if os.environ.has_key('GRAMPSDIR'):
|
||||
else:
|
||||
rootDir = "."
|
||||
|
||||
papersize = "%s/papersize.xml" % rootDir
|
||||
papersize = "file:%s/papersize.xml" % rootDir
|
||||
good_xpm = "%s/good.png" % rootDir
|
||||
bad_xpm = "%s/bad.png" % rootDir
|
||||
caution_xpm = "%s/caution.png" % rootDir
|
||||
|
@ -1,5 +1,16 @@
|
||||
#! /usr/bin/python -O
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Cope with versioned pygtk installation.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Load internationalization setup
|
||||
@ -7,6 +18,12 @@
|
||||
#-------------------------------------------------------------------------
|
||||
import os
|
||||
import locale
|
||||
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk.glade
|
||||
import intl
|
||||
|
||||
@ -33,6 +50,11 @@ import sys
|
||||
# GNOME/GTK libraries
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
||||
@ -60,4 +82,3 @@ except:
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
gtk.mainloop()
|
||||
|
||||
|
@ -39,6 +39,11 @@ from intl import gettext as _
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
try:
|
||||
import pygtk; pygtk.require('2.0')
|
||||
except ImportError: # not set up for parallel install
|
||||
pass
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
688
src/grampslib_wrap.c
Normal file
688
src/grampslib_wrap.c
Normal file
@ -0,0 +1,688 @@
|
||||
/*
|
||||
* FILE : grampslib_wrap.c
|
||||
*
|
||||
* This file was automatically generated by :
|
||||
* Simplified Wrapper and Interface Generator (SWIG)
|
||||
* Version 1.1 (Patch 5)
|
||||
*
|
||||
* Portions Copyright (c) 1995-1998
|
||||
* The University of Utah and The Regents of the University of California.
|
||||
* Permission is granted to distribute this file in any manner provided
|
||||
* this notice remains intact.
|
||||
*
|
||||
* Do not make changes to this file--changes will be lost!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define SWIGCODE
|
||||
/* Implementation : PYTHON */
|
||||
|
||||
#define SWIGPYTHON
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
/***********************************************************************
|
||||
* $Header$
|
||||
* swig_lib/python/python.cfg
|
||||
*
|
||||
* This file contains coded needed to add variable linking to the
|
||||
* Python interpreter. C variables are added as a new kind of Python
|
||||
* datatype.
|
||||
*
|
||||
* Also contains supporting code for building python under Windows
|
||||
* and things like that.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 2002/11/26 04:06:23 dallingham
|
||||
* use pygtk.require to determine database
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "Python.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Definitions for Windows/Unix exporting */
|
||||
#if defined(__WIN32__)
|
||||
# if defined(_MSC_VER)
|
||||
# define SWIGEXPORT(a,b) __declspec(dllexport) a b
|
||||
# else
|
||||
# if defined(__BORLANDC__)
|
||||
# define SWIGEXPORT(a,b) a _export b
|
||||
# else
|
||||
# define SWIGEXPORT(a,b) a b
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SWIGEXPORT(a,b) a b
|
||||
#endif
|
||||
|
||||
#ifdef SWIG_GLOBAL
|
||||
#ifdef __cplusplus
|
||||
#define SWIGSTATIC extern "C"
|
||||
#else
|
||||
#define SWIGSTATIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGSTATIC
|
||||
#define SWIGSTATIC static
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
PyObject *(*get_attr)(void);
|
||||
int (*set_attr)(PyObject *);
|
||||
} swig_globalvar;
|
||||
|
||||
typedef struct swig_varlinkobject {
|
||||
PyObject_HEAD
|
||||
swig_globalvar **vars;
|
||||
int nvars;
|
||||
int maxvars;
|
||||
} swig_varlinkobject;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
swig_varlink_repr()
|
||||
|
||||
Function for python repr method
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
swig_varlink_repr(swig_varlinkobject *v)
|
||||
{
|
||||
v = v;
|
||||
return PyString_FromString("<Global variables>");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
swig_varlink_print()
|
||||
|
||||
Print out all of the global variable names
|
||||
--------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags)
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
flags = flags;
|
||||
fprintf(fp,"Global variables { ");
|
||||
while (v->vars[i]) {
|
||||
fprintf(fp,"%s", v->vars[i]->name);
|
||||
i++;
|
||||
if (v->vars[i]) fprintf(fp,", ");
|
||||
}
|
||||
fprintf(fp," }\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------
|
||||
swig_varlink_getattr
|
||||
|
||||
This function gets the value of a variable and returns it as a
|
||||
PyObject. In our case, we'll be looking at the datatype and
|
||||
converting into a number or string
|
||||
-------------------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
swig_varlink_getattr(swig_varlinkobject *v, char *n)
|
||||
{
|
||||
int i = 0;
|
||||
char temp[128];
|
||||
|
||||
while (v->vars[i]) {
|
||||
if (strcmp(v->vars[i]->name,n) == 0) {
|
||||
return (*v->vars[i]->get_attr)();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
sprintf(temp,"C global variable %s not found.", n);
|
||||
PyErr_SetString(PyExc_NameError,temp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------
|
||||
swig_varlink_setattr()
|
||||
|
||||
This function sets the value of a variable.
|
||||
------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
|
||||
{
|
||||
char temp[128];
|
||||
int i = 0;
|
||||
while (v->vars[i]) {
|
||||
if (strcmp(v->vars[i]->name,n) == 0) {
|
||||
return (*v->vars[i]->set_attr)(p);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
sprintf(temp,"C global variable %s not found.", n);
|
||||
PyErr_SetString(PyExc_NameError,temp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
statichere PyTypeObject varlinktype = {
|
||||
/* PyObject_HEAD_INIT(&PyType_Type) Note : This doesn't work on some machines */
|
||||
PyObject_HEAD_INIT(0)
|
||||
0,
|
||||
"varlink", /* Type name */
|
||||
sizeof(swig_varlinkobject), /* Basic size */
|
||||
0, /* Itemsize */
|
||||
0, /* Deallocator */
|
||||
(printfunc) swig_varlink_print, /* Print */
|
||||
(getattrfunc) swig_varlink_getattr, /* get attr */
|
||||
(setattrfunc) swig_varlink_setattr, /* Set attr */
|
||||
0, /* tp_compare */
|
||||
(reprfunc) swig_varlink_repr, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_mapping*/
|
||||
0, /* tp_hash */
|
||||
};
|
||||
|
||||
/* Create a variable linking object for use later */
|
||||
|
||||
SWIGSTATIC PyObject *
|
||||
SWIG_newvarlink(void)
|
||||
{
|
||||
swig_varlinkobject *result = 0;
|
||||
result = PyMem_NEW(swig_varlinkobject,1);
|
||||
varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */
|
||||
result->ob_type = &varlinktype;
|
||||
/* _Py_NewReference(result); Does not seem to be necessary */
|
||||
result->nvars = 0;
|
||||
result->maxvars = 64;
|
||||
result->vars = (swig_globalvar **) malloc(64*sizeof(swig_globalvar *));
|
||||
result->vars[0] = 0;
|
||||
result->ob_refcnt = 0;
|
||||
Py_XINCREF((PyObject *) result);
|
||||
return ((PyObject*) result);
|
||||
}
|
||||
|
||||
SWIGSTATIC void
|
||||
SWIG_addvarlink(PyObject *p, char *name,
|
||||
PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p))
|
||||
{
|
||||
swig_varlinkobject *v;
|
||||
v= (swig_varlinkobject *) p;
|
||||
|
||||
if (v->nvars >= v->maxvars -1) {
|
||||
v->maxvars = 2*v->maxvars;
|
||||
v->vars = (swig_globalvar **) realloc(v->vars,v->maxvars*sizeof(swig_globalvar *));
|
||||
if (v->vars == NULL) {
|
||||
fprintf(stderr,"SWIG : Fatal error in initializing Python module.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
v->vars[v->nvars] = (swig_globalvar *) malloc(sizeof(swig_globalvar));
|
||||
v->vars[v->nvars]->name = (char *) malloc(strlen(name)+1);
|
||||
strcpy(v->vars[v->nvars]->name,name);
|
||||
v->vars[v->nvars]->get_attr = get_attr;
|
||||
v->vars[v->nvars]->set_attr = set_attr;
|
||||
v->nvars++;
|
||||
v->vars[v->nvars] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* $Header$
|
||||
*
|
||||
* swigptr.swg
|
||||
*
|
||||
* This file contains supporting code for the SWIG run-time type checking
|
||||
* mechanism. The following functions are available :
|
||||
*
|
||||
* SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *));
|
||||
*
|
||||
* Registers a new type-mapping with the type-checker. origtype is the
|
||||
* original datatype and newtype is an equivalent type. cast is optional
|
||||
* pointer to a function to cast pointer values between types (this
|
||||
* is typically used to cast pointers from derived classes to base classes in C++)
|
||||
*
|
||||
* SWIG_MakePtr(char *buffer, void *ptr, char *typestring);
|
||||
*
|
||||
* Makes a pointer string from a pointer and typestring. The result is returned
|
||||
* in buffer which is assumed to hold enough space for the result.
|
||||
*
|
||||
* char * SWIG_GetPtr(char *buffer, void **ptr, char *type)
|
||||
*
|
||||
* Gets a pointer value from a string. If there is a type-mismatch, returns
|
||||
* a character string to the received type. On success, returns NULL.
|
||||
*
|
||||
*
|
||||
* You can remap these functions by making a file called "swigptr.swg" in
|
||||
* your the same directory as the interface file you are wrapping.
|
||||
*
|
||||
* These functions are normally declared static, but this file can be
|
||||
* can be used in a multi-module environment by redefining the symbol
|
||||
* SWIGSTATIC.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef SWIG_GLOBAL
|
||||
#ifdef __cplusplus
|
||||
#define SWIGSTATIC extern "C"
|
||||
#else
|
||||
#define SWIGSTATIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGSTATIC
|
||||
#define SWIGSTATIC static
|
||||
#endif
|
||||
|
||||
|
||||
/* SWIG pointer structure */
|
||||
|
||||
typedef struct SwigPtrType {
|
||||
char *name; /* Datatype name */
|
||||
int len; /* Length (used for optimization) */
|
||||
void *(*cast)(void *); /* Pointer casting function */
|
||||
struct SwigPtrType *next; /* Linked list pointer */
|
||||
} SwigPtrType;
|
||||
|
||||
/* Pointer cache structure */
|
||||
|
||||
typedef struct {
|
||||
int stat; /* Status (valid) bit */
|
||||
SwigPtrType *tp; /* Pointer to type structure */
|
||||
char name[256]; /* Given datatype name */
|
||||
char mapped[256]; /* Equivalent name */
|
||||
} SwigCacheType;
|
||||
|
||||
/* Some variables */
|
||||
|
||||
static int SwigPtrMax = 64; /* Max entries that can be currently held */
|
||||
/* This value may be adjusted dynamically */
|
||||
static int SwigPtrN = 0; /* Current number of entries */
|
||||
static int SwigPtrSort = 0; /* Status flag indicating sort */
|
||||
static int SwigStart[256]; /* Starting positions of types */
|
||||
|
||||
/* Pointer table */
|
||||
static SwigPtrType *SwigPtrTable = 0; /* Table containing pointer equivalences */
|
||||
|
||||
/* Cached values */
|
||||
|
||||
#define SWIG_CACHESIZE 8
|
||||
#define SWIG_CACHEMASK 0x7
|
||||
static SwigCacheType SwigCache[SWIG_CACHESIZE];
|
||||
static int SwigCacheIndex = 0;
|
||||
static int SwigLastCache = 0;
|
||||
|
||||
/* Sort comparison function */
|
||||
static int swigsort(const void *data1, const void *data2) {
|
||||
SwigPtrType *d1 = (SwigPtrType *) data1;
|
||||
SwigPtrType *d2 = (SwigPtrType *) data2;
|
||||
return strcmp(d1->name,d2->name);
|
||||
}
|
||||
|
||||
/* Binary Search function */
|
||||
static int swigcmp(const void *key, const void *data) {
|
||||
char *k = (char *) key;
|
||||
SwigPtrType *d = (SwigPtrType *) data;
|
||||
return strncmp(k,d->name,d->len);
|
||||
}
|
||||
|
||||
/* Register a new datatype with the type-checker */
|
||||
|
||||
SWIGSTATIC
|
||||
void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) {
|
||||
|
||||
int i;
|
||||
SwigPtrType *t = 0,*t1;
|
||||
|
||||
/* Allocate the pointer table if necessary */
|
||||
|
||||
if (!SwigPtrTable) {
|
||||
SwigPtrTable = (SwigPtrType *) malloc(SwigPtrMax*sizeof(SwigPtrType));
|
||||
SwigPtrN = 0;
|
||||
}
|
||||
/* Grow the table */
|
||||
if (SwigPtrN >= SwigPtrMax) {
|
||||
SwigPtrMax = 2*SwigPtrMax;
|
||||
SwigPtrTable = (SwigPtrType *) realloc((char *) SwigPtrTable,SwigPtrMax*sizeof(SwigPtrType));
|
||||
}
|
||||
for (i = 0; i < SwigPtrN; i++)
|
||||
if (strcmp(SwigPtrTable[i].name,origtype) == 0) {
|
||||
t = &SwigPtrTable[i];
|
||||
break;
|
||||
}
|
||||
if (!t) {
|
||||
t = &SwigPtrTable[SwigPtrN];
|
||||
t->name = origtype;
|
||||
t->len = strlen(t->name);
|
||||
t->cast = 0;
|
||||
t->next = 0;
|
||||
SwigPtrN++;
|
||||
}
|
||||
|
||||
/* Check for existing entry */
|
||||
|
||||
while (t->next) {
|
||||
if ((strcmp(t->name,newtype) == 0)) {
|
||||
if (cast) t->cast = cast;
|
||||
return;
|
||||
}
|
||||
t = t->next;
|
||||
}
|
||||
|
||||
/* Now place entry (in sorted order) */
|
||||
|
||||
t1 = (SwigPtrType *) malloc(sizeof(SwigPtrType));
|
||||
t1->name = newtype;
|
||||
t1->len = strlen(t1->name);
|
||||
t1->cast = cast;
|
||||
t1->next = 0;
|
||||
t->next = t1;
|
||||
SwigPtrSort = 0;
|
||||
}
|
||||
|
||||
/* Make a pointer value string */
|
||||
|
||||
SWIGSTATIC
|
||||
void SWIG_MakePtr(char *_c, const void *_ptr, char *type) {
|
||||
static char _hex[16] =
|
||||
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
unsigned long _p, _s;
|
||||
char _result[20], *_r; /* Note : a 64-bit hex number = 16 digits */
|
||||
_r = _result;
|
||||
_p = (unsigned long) _ptr;
|
||||
if (_p > 0) {
|
||||
while (_p > 0) {
|
||||
_s = _p & 0xf;
|
||||
*(_r++) = _hex[_s];
|
||||
_p = _p >> 4;
|
||||
}
|
||||
*_r = '_';
|
||||
while (_r >= _result)
|
||||
*(_c++) = *(_r--);
|
||||
} else {
|
||||
strcpy (_c, "NULL");
|
||||
}
|
||||
if (_ptr)
|
||||
strcpy (_c, type);
|
||||
}
|
||||
|
||||
/* Define for backwards compatibility */
|
||||
|
||||
#define _swig_make_hex SWIG_MakePtr
|
||||
|
||||
/* Function for getting a pointer value */
|
||||
|
||||
SWIGSTATIC
|
||||
char *SWIG_GetPtr(char *_c, void **ptr, char *_t)
|
||||
{
|
||||
unsigned long _p;
|
||||
char temp_type[256];
|
||||
char *name;
|
||||
int i, len;
|
||||
SwigPtrType *sp,*tp;
|
||||
SwigCacheType *cache;
|
||||
int start, end;
|
||||
_p = 0;
|
||||
|
||||
/* Pointer values must start with leading underscore */
|
||||
if (*_c == '_') {
|
||||
_c++;
|
||||
/* Extract hex value from pointer */
|
||||
while (*_c) {
|
||||
if ((*_c >= '0') && (*_c <= '9'))
|
||||
_p = (_p << 4) + (*_c - '0');
|
||||
else if ((*_c >= 'a') && (*_c <= 'f'))
|
||||
_p = (_p << 4) + ((*_c - 'a') + 10);
|
||||
else
|
||||
break;
|
||||
_c++;
|
||||
}
|
||||
|
||||
if (_t) {
|
||||
if (strcmp(_t,_c)) {
|
||||
if (!SwigPtrSort) {
|
||||
qsort((void *) SwigPtrTable, SwigPtrN, sizeof(SwigPtrType), swigsort);
|
||||
for (i = 0; i < 256; i++) {
|
||||
SwigStart[i] = SwigPtrN;
|
||||
}
|
||||
for (i = SwigPtrN-1; i >= 0; i--) {
|
||||
SwigStart[(int) (SwigPtrTable[i].name[1])] = i;
|
||||
}
|
||||
for (i = 255; i >= 1; i--) {
|
||||
if (SwigStart[i-1] > SwigStart[i])
|
||||
SwigStart[i-1] = SwigStart[i];
|
||||
}
|
||||
SwigPtrSort = 1;
|
||||
for (i = 0; i < SWIG_CACHESIZE; i++)
|
||||
SwigCache[i].stat = 0;
|
||||
}
|
||||
|
||||
/* First check cache for matches. Uses last cache value as starting point */
|
||||
cache = &SwigCache[SwigLastCache];
|
||||
for (i = 0; i < SWIG_CACHESIZE; i++) {
|
||||
if (cache->stat) {
|
||||
if (strcmp(_t,cache->name) == 0) {
|
||||
if (strcmp(_c,cache->mapped) == 0) {
|
||||
cache->stat++;
|
||||
*ptr = (void *) _p;
|
||||
if (cache->tp->cast) *ptr = (*(cache->tp->cast))(*ptr);
|
||||
return (char *) 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
SwigLastCache = (SwigLastCache+1) & SWIG_CACHEMASK;
|
||||
if (!SwigLastCache) cache = SwigCache;
|
||||
else cache++;
|
||||
}
|
||||
/* We have a type mismatch. Will have to look through our type
|
||||
mapping table to figure out whether or not we can accept this datatype */
|
||||
|
||||
start = SwigStart[(int) _t[1]];
|
||||
end = SwigStart[(int) _t[1]+1];
|
||||
sp = &SwigPtrTable[start];
|
||||
while (start < end) {
|
||||
if (swigcmp(_t,sp) == 0) break;
|
||||
sp++;
|
||||
start++;
|
||||
}
|
||||
if (start >= end) sp = 0;
|
||||
/* Try to find a match for this */
|
||||
if (sp) {
|
||||
while (swigcmp(_t,sp) == 0) {
|
||||
name = sp->name;
|
||||
len = sp->len;
|
||||
tp = sp->next;
|
||||
/* Try to find entry for our given datatype */
|
||||
while(tp) {
|
||||
if (tp->len >= 255) {
|
||||
return _c;
|
||||
}
|
||||
strcpy(temp_type,tp->name);
|
||||
strncat(temp_type,_t+len,255-tp->len);
|
||||
if (strcmp(_c,temp_type) == 0) {
|
||||
|
||||
strcpy(SwigCache[SwigCacheIndex].mapped,_c);
|
||||
strcpy(SwigCache[SwigCacheIndex].name,_t);
|
||||
SwigCache[SwigCacheIndex].stat = 1;
|
||||
SwigCache[SwigCacheIndex].tp = tp;
|
||||
SwigCacheIndex = SwigCacheIndex & SWIG_CACHEMASK;
|
||||
|
||||
/* Get pointer value */
|
||||
*ptr = (void *) _p;
|
||||
if (tp->cast) *ptr = (*(tp->cast))(*ptr);
|
||||
return (char *) 0;
|
||||
}
|
||||
tp = tp->next;
|
||||
}
|
||||
sp++;
|
||||
/* Hmmm. Didn't find it this time */
|
||||
}
|
||||
}
|
||||
/* Didn't find any sort of match for this data.
|
||||
Get the pointer value and return the received type */
|
||||
*ptr = (void *) _p;
|
||||
return _c;
|
||||
} else {
|
||||
/* Found a match on the first try. Return pointer value */
|
||||
*ptr = (void *) _p;
|
||||
return (char *) 0;
|
||||
}
|
||||
} else {
|
||||
/* No type specified. Good luck */
|
||||
*ptr = (void *) _p;
|
||||
return (char *) 0;
|
||||
}
|
||||
} else {
|
||||
if (strcmp (_c, "NULL") == 0) {
|
||||
*ptr = (void *) 0;
|
||||
return (char *) 0;
|
||||
}
|
||||
*ptr = (void *) 0;
|
||||
return _c;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compatibility mode */
|
||||
|
||||
#define _swig_get_hex SWIG_GetPtr
|
||||
|
||||
#define SWIG_init initgrampslib
|
||||
|
||||
#define SWIG_name "grampslib"
|
||||
|
||||
#include <libgnomevfs/gnome-vfs-application-registry.h>
|
||||
extern const char *gnome_vfs_mime_get_icon(const char *);
|
||||
extern const char *gnome_vfs_mime_type_from_name(const char *);
|
||||
extern const char *gnome_vfs_mime_get_description(const char *);
|
||||
extern const char *gnome_vfs_mime_get_value(const char *,const char *);
|
||||
|
||||
const char* default_application_name(const char* type) {
|
||||
GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type);
|
||||
return a->name;
|
||||
}
|
||||
|
||||
const char* default_application_command(const char* type) {
|
||||
GnomeVFSMimeApplication *a = gnome_vfs_mime_get_default_application(type);
|
||||
return a->command;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_gnome_vfs_mime_get_icon(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"s:gnome_vfs_mime_get_icon",&_arg0))
|
||||
return NULL;
|
||||
_result = (char *)gnome_vfs_mime_get_icon(_arg0);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_gnome_vfs_mime_type_from_name(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"s:gnome_vfs_mime_type_from_name",&_arg0))
|
||||
return NULL;
|
||||
_result = (char *)gnome_vfs_mime_type_from_name(_arg0);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_gnome_vfs_mime_get_description(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"s:gnome_vfs_mime_get_description",&_arg0))
|
||||
return NULL;
|
||||
_result = (char *)gnome_vfs_mime_get_description(_arg0);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_gnome_vfs_mime_get_value(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
char * _arg1;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"ss:gnome_vfs_mime_get_value",&_arg0,&_arg1))
|
||||
return NULL;
|
||||
_result = (char *)gnome_vfs_mime_get_value(_arg0,_arg1);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_default_application_name(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"s:default_application_name",&_arg0))
|
||||
return NULL;
|
||||
_result = (char *)default_application_name(_arg0);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_default_application_command(PyObject *self, PyObject *args) {
|
||||
PyObject * _resultobj;
|
||||
char * _result;
|
||||
char * _arg0;
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTuple(args,"s:default_application_command",&_arg0))
|
||||
return NULL;
|
||||
_result = (char *)default_application_command(_arg0);
|
||||
_resultobj = Py_BuildValue("s", _result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef grampslibMethods[] = {
|
||||
{ "default_application_command", _wrap_default_application_command, 1 },
|
||||
{ "default_application_name", _wrap_default_application_name, 1 },
|
||||
{ "gnome_vfs_mime_get_value", _wrap_gnome_vfs_mime_get_value, 1 },
|
||||
{ "gnome_vfs_mime_get_description", _wrap_gnome_vfs_mime_get_description, 1 },
|
||||
{ "gnome_vfs_mime_type_from_name", _wrap_gnome_vfs_mime_type_from_name, 1 },
|
||||
{ "gnome_vfs_mime_get_icon", _wrap_gnome_vfs_mime_get_icon, 1 },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
static PyObject *SWIG_globals;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT(void,initgrampslib)() {
|
||||
PyObject *m, *d;
|
||||
SWIG_globals = SWIG_newvarlink();
|
||||
m = Py_InitModule("grampslib", grampslibMethods);
|
||||
d = PyModule_GetDict(m);
|
||||
/*
|
||||
* These are the pointer type-equivalency mappings.
|
||||
* (Used by the SWIG pointer type-checker).
|
||||
*/
|
||||
SWIG_RegisterMapping("_signed_long","_long",0);
|
||||
SWIG_RegisterMapping("_long","_unsigned_long",0);
|
||||
SWIG_RegisterMapping("_long","_signed_long",0);
|
||||
SWIG_RegisterMapping("_unsigned_long","_long",0);
|
||||
SWIG_RegisterMapping("_signed_int","_int",0);
|
||||
SWIG_RegisterMapping("_unsigned_short","_short",0);
|
||||
SWIG_RegisterMapping("_signed_short","_short",0);
|
||||
SWIG_RegisterMapping("_unsigned_int","_int",0);
|
||||
SWIG_RegisterMapping("_short","_unsigned_short",0);
|
||||
SWIG_RegisterMapping("_short","_signed_short",0);
|
||||
SWIG_RegisterMapping("_int","_unsigned_int",0);
|
||||
SWIG_RegisterMapping("_int","_signed_int",0);
|
||||
}
|
@ -46,6 +46,9 @@ try:
|
||||
|
||||
def bindtextdomain(s,x):
|
||||
return
|
||||
|
||||
def bind_textdomain_codeset(s,x):
|
||||
return
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
@ -58,3 +61,6 @@ except:
|
||||
|
||||
def bindtextdomain(s,x):
|
||||
return
|
||||
|
||||
def bind_textdomain_codeset(s,x):
|
||||
return
|
||||
|
@ -2,7 +2,6 @@
|
||||
<paper>
|
||||
<page name="Letter" height="27.94" width="21.59"/>
|
||||
<page name="Legal" height="35.56" width="21.59"/>
|
||||
<page name="Banana" height="42.0" width="29.7"/>
|
||||
<page name="A3" height="42.0" width="29.7"/>
|
||||
<page name="A4" height="29.7" width="21.0"/>
|
||||
<page name="A5" height="21.0" width="14.8"/>
|
||||
|
Loading…
Reference in New Issue
Block a user