summaryrefslogtreecommitdiff
path: root/gio
diff options
context:
space:
mode:
Diffstat (limited to 'gio')
-rw-r--r--gio/Makefile.am1
-rw-r--r--gio/Makefile.in157
-rw-r--r--gio/gappinfo.override5
-rw-r--r--gio/gfile.override13
-rw-r--r--gio/gio.override7
-rw-r--r--gio/giomodule.c153
-rw-r--r--gio/pygio-utils.c42
7 files changed, 230 insertions, 148 deletions
diff --git a/gio/Makefile.am b/gio/Makefile.am
index a34fd19..6b3eb57 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -109,6 +109,7 @@ endif
if BUILD_GIO
all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+check-local: $(pkgpyexec_LTLIBRARIES:.la=.so)
clean-local:
rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
.la.so:
diff --git a/gio/Makefile.in b/gio/Makefile.in
index f0cd632..041c085 100644
--- a/gio/Makefile.in
+++ b/gio/Makefile.in
@@ -85,17 +85,20 @@ _gio_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
am__gio_la_OBJECTS = _gio_la-giomodule.lo _gio_la-pygio-utils.lo
nodist__gio_la_OBJECTS = _gio_la-gio.lo
_gio_la_OBJECTS = $(am__gio_la_OBJECTS) $(nodist__gio_la_OBJECTS)
-_gio_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(_gio_la_CFLAGS) $(CFLAGS) \
- $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+_gio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gio_la_CFLAGS) \
+ $(CFLAGS) $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@
@BUILD_GIO_TRUE@am__gio_la_rpath = -rpath $(pkgpyexecdir)
unix_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_unix_la_OBJECTS = unix_la-unixmodule.lo
nodist_unix_la_OBJECTS = unix_la-unix.lo
unix_la_OBJECTS = $(am_unix_la_OBJECTS) $(nodist_unix_la_OBJECTS)
-unix_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(unix_la_CFLAGS) $(CFLAGS) \
- $(unix_la_LDFLAGS) $(LDFLAGS) -o $@
+unix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(unix_la_CFLAGS) \
+ $(CFLAGS) $(unix_la_LDFLAGS) $(LDFLAGS) -o $@
@BUILD_GIOUNIX_TRUE@am_unix_la_rpath = -rpath $(pkgpyexecdir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -103,13 +106,26 @@ am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(_gio_la_SOURCES) $(nodist__gio_la_SOURCES) \
$(unix_la_SOURCES) $(nodist_unix_la_SOURCES)
DIST_SOURCES = $(_gio_la_SOURCES) $(unix_la_SOURCES)
@@ -121,6 +137,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
@@ -151,6 +168,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@
GIOUNIX_LIBS = @GIOUNIX_LIBS@
GIO_CFLAGS = @GIO_CFLAGS@
GIO_LIBS = @GIO_LIBS@
+GI_CFLAGS = @GI_CFLAGS@
+GI_DATADIR = @GI_DATADIR@
+GI_LIBS = @GI_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
@@ -162,6 +182,8 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBFFI_PC = @LIBFFI_PC@
@@ -171,7 +193,9 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
@@ -184,10 +208,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PLATFORM = @PLATFORM@
+PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@
+PYCAIRO_LIBS = @PYCAIRO_LIBS@
PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@
PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@
PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@
@@ -210,6 +239,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -242,7 +272,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -343,7 +372,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .defs .la .lo .o .obj .so
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -352,9 +381,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gio/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gio/Makefile'; \
$(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu gio/Makefile
+ $(AUTOMAKE) --foreign gio/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -368,9 +397,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-pkgpyexecLTLIBRARIES: $(pkgpyexec_LTLIBRARIES)
@@ -436,9 +465,9 @@ clean-pyexecLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
_gio.la: $(_gio_la_OBJECTS) $(_gio_la_DEPENDENCIES)
- $(_gio_la_LINK) $(am__gio_la_rpath) $(_gio_la_OBJECTS) $(_gio_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(_gio_la_LINK) $(am__gio_la_rpath) $(_gio_la_OBJECTS) $(_gio_la_LIBADD) $(LIBS)
unix.la: $(unix_la_OBJECTS) $(unix_la_DEPENDENCIES)
- $(unix_la_LINK) $(am_unix_la_rpath) $(unix_la_OBJECTS) $(unix_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(unix_la_LINK) $(am_unix_la_rpath) $(unix_la_OBJECTS) $(unix_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -453,60 +482,68 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix_la-unixmodule.Plo@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
_gio_la-giomodule.lo: giomodule.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-giomodule.lo -MD -MP -MF $(DEPDIR)/_gio_la-giomodule.Tpo -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-giomodule.Tpo $(DEPDIR)/_gio_la-giomodule.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-giomodule.lo -MD -MP -MF $(DEPDIR)/_gio_la-giomodule.Tpo -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-giomodule.Tpo $(DEPDIR)/_gio_la-giomodule.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='giomodule.c' object='_gio_la-giomodule.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c
_gio_la-pygio-utils.lo: pygio-utils.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-pygio-utils.lo -MD -MP -MF $(DEPDIR)/_gio_la-pygio-utils.Tpo -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-pygio-utils.Tpo $(DEPDIR)/_gio_la-pygio-utils.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-pygio-utils.lo -MD -MP -MF $(DEPDIR)/_gio_la-pygio-utils.Tpo -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-pygio-utils.Tpo $(DEPDIR)/_gio_la-pygio-utils.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygio-utils.c' object='_gio_la-pygio-utils.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c
_gio_la-gio.lo: gio.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-gio.lo -MD -MP -MF $(DEPDIR)/_gio_la-gio.Tpo -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-gio.Tpo $(DEPDIR)/_gio_la-gio.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-gio.lo -MD -MP -MF $(DEPDIR)/_gio_la-gio.Tpo -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-gio.Tpo $(DEPDIR)/_gio_la-gio.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gio.c' object='_gio_la-gio.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c
unix_la-unixmodule.lo: unixmodule.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unixmodule.lo -MD -MP -MF $(DEPDIR)/unix_la-unixmodule.Tpo -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unix_la-unixmodule.Tpo $(DEPDIR)/unix_la-unixmodule.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unixmodule.lo -MD -MP -MF $(DEPDIR)/unix_la-unixmodule.Tpo -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unix_la-unixmodule.Tpo $(DEPDIR)/unix_la-unixmodule.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unixmodule.c' object='unix_la-unixmodule.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c
unix_la-unix.lo: unix.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unix.lo -MD -MP -MF $(DEPDIR)/unix_la-unix.Tpo -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unix_la-unix.Tpo $(DEPDIR)/unix_la-unix.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unix.lo -MD -MP -MF $(DEPDIR)/unix_la-unix.Tpo -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unix_la-unix.Tpo $(DEPDIR)/unix_la-unix.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unix.c' object='unix_la-unix.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c
mostlyclean-libtool:
-rm -f *.lo
@@ -654,7 +691,9 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
+@BUILD_GIO_FALSE@check-local:
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
@@ -762,23 +801,24 @@ ps-am:
uninstall-am: uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \
uninstall-pyexecLTLIBRARIES uninstall-pygioPYTHON
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-local clean-pkgpyexecLTLIBRARIES \
- clean-pyexecLTLIBRARIES ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-defsDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgpyexecLTLIBRARIES \
- install-ps install-ps-am install-pyexecLTLIBRARIES \
- install-pygioPYTHON install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+ clean-generic clean-libtool clean-local \
+ clean-pkgpyexecLTLIBRARIES clean-pyexecLTLIBRARIES ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-defsDATA install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pkgpyexecLTLIBRARIES install-ps \
+ install-ps-am install-pyexecLTLIBRARIES install-pygioPYTHON \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \
uninstall-pyexecLTLIBRARIES uninstall-pygioPYTHON
gio.c: $(GIO_DEFS) $(GIO_OVERRIDES)
@@ -797,6 +837,7 @@ unix.c: $(GIOUNIX_DEFS) unix.override
&& rm -f $(*D)/gen-$(*F).c
@BUILD_GIO_TRUE@all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+@BUILD_GIO_TRUE@check-local: $(pkgpyexec_LTLIBRARIES:.la=.so)
@BUILD_GIO_TRUE@clean-local:
@BUILD_GIO_TRUE@ rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
@BUILD_GIO_TRUE@.la.so:
diff --git a/gio/gappinfo.override b/gio/gappinfo.override
index 414769b..7f09ce8 100644
--- a/gio/gappinfo.override
+++ b/gio/gappinfo.override
@@ -106,6 +106,11 @@ _wrap_g_app_info_launch_uris(PyGObject *self, PyObject *args, PyObject *kwargs)
ret = g_app_info_launch_uris(G_APP_INFO(self->obj),
file_list, ctx, &error);
+ /* in python 3 the C strings are not internal to the Unicode string object
+ * so we now strdup when adding element to the list and must free them here
+ */
+ g_list_foreach (file_list,
+ (GFunc) g_free, NULL);
g_list_free(file_list);
if (pyg_error_check(&error))
diff --git a/gio/gfile.override b/gio/gfile.override
index 71e2d98..1301963 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -840,7 +840,7 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs)
static char *kwlist[] = { "attribute", "type", "value_p",
"flags", "cancellable", NULL };
GFileQueryInfoFlags flags = G_FILE_QUERY_INFO_NONE;
- int ret;
+ int ret = 0;
GCancellable *cancellable = NULL;
GError *error = NULL;
char *attribute;
@@ -883,7 +883,7 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs)
&error);
}
break;
-
+
case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING:
{
char* s;
@@ -902,7 +902,6 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs)
&error);
}
break;
-
case G_FILE_ATTRIBUTE_TYPE_STRINGV:
{
@@ -1155,7 +1154,7 @@ _wrap_g_file_append_to_async(PyGObject *self, PyObject *args, PyObject *kwargs)
"O|OiOO:File.append_to_async",
kwlist,
&notify->callback,
- &flags, &io_priority,
+ &py_flags, &io_priority,
&pycancellable,
&notify->data))
goto error;
@@ -1203,7 +1202,7 @@ _wrap_g_file_create_async(PyGObject *self, PyObject *args, PyObject *kwargs)
"O|OiOO:File.create_async",
kwlist,
&notify->callback,
- &flags, &io_priority,
+ &py_flags, &io_priority,
&pycancellable,
&notify->data))
goto error;
@@ -1253,7 +1252,7 @@ _wrap_g_file_create_readwrite_async(PyGObject *self,
"O|OiOO:File.create_readwrite_async",
kwlist,
&notify->callback,
- &flags, &io_priority,
+ &py_flags, &io_priority,
&pycancellable,
&notify->data))
goto error;
@@ -1405,7 +1404,7 @@ _wrap_g_file_replace_async(PyGObject *self, PyObject *args, PyObject *kwargs)
kwlist,
&notify->callback,
&etag, &py_backup,
- &flags, &io_priority,
+ &py_flags, &io_priority,
&pycancellable,
&notify->data))
goto error;
diff --git a/gio/gio.override b/gio/gio.override
index 6d001b9..7fdcb1c 100644
--- a/gio/gio.override
+++ b/gio/gio.override
@@ -141,7 +141,7 @@ pygio_notify_allocate_buffer(PyGIONotify *notify, gsize buffer_size)
if (buffer_size > 0) {
notify->buffer = g_slice_alloc(buffer_size);
if (!notify->buffer) {
- PyErr_Format(PyExc_MemoryError, "failed to allocate %d bytes", buffer_size);
+ PyErr_Format(PyExc_MemoryError, "failed to allocate %" G_GSIZE_FORMAT " bytes", buffer_size);
return FALSE;
}
@@ -330,7 +330,12 @@ _wrap_g_content_type_guess(PyGObject *self, PyObject *args, PyObject *kwargs)
{
char *kwlist[] = {"filename", "data", "want_uncertain", NULL};
char *filename = NULL, *data = NULL, *type;
+#ifdef PY_SSIZE_T_CLEAN
+ Py_ssize_t data_size = 0;
+#else
int data_size = 0;
+#endif
+
gboolean result_uncertain, want_uncertain = FALSE;
PyObject *ret;
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 409aeef..a9ddd38 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -25,6 +25,7 @@
#include <Python.h>
#include <pyglib.h>
#include <pygobject.h>
+#include <pyglib-python-compat.h>
#include <gio/gio.h>
@@ -39,167 +40,169 @@ void pygio_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef pygio_functions[];
-DL_EXPORT(void)
-init_gio(void)
+PYGLIB_INIT_FUNCTION(_gio, "gio._gio", pygio_functions)
{
- PyObject *m, *d;
+ PyObject *d;
PyObject *tuple;
PyObject *e;
+
/* perform any initialisation required by the library here */
- m = Py_InitModule("gio._gio", pygio_functions);
- d = PyModule_GetDict(m);
+ d = PyModule_GetDict(module);
g_type_init();
pyglib_init();
- init_pygobject_check(2, 15, 2);
+ if (pygobject_init(2, 15, 2) == NULL)
+ return -1;
pygio_register_classes(d);
- pygio_add_constants(m, "G_IO_");
+ pygio_add_constants(module, "G_IO_");
- PyModule_AddStringConstant(m, "ERROR", g_quark_to_string(G_IO_ERROR));
+ PyModule_AddStringConstant(module, "ERROR", g_quark_to_string(G_IO_ERROR));
e = pyglib_register_exception_for_domain("gio.Error", G_IO_ERROR);
PyDict_SetItemString(d, "Error", e);
Py_DECREF(e);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_TYPE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_TYPE",
G_FILE_ATTRIBUTE_STANDARD_TYPE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_HIDDEN",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_HIDDEN",
G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_BACKUP",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_BACKUP",
G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_SYMLINK",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_SYMLINK",
G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL",
G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_NAME",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_NAME",
G_FILE_ATTRIBUTE_STANDARD_NAME);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME",
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_EDIT_NAME",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_EDIT_NAME",
G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_COPY_NAME",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_COPY_NAME",
G_FILE_ATTRIBUTE_STANDARD_COPY_NAME);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_DESCRIPTION",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_DESCRIPTION",
G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_ICON",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_ICON",
G_FILE_ATTRIBUTE_STANDARD_ICON);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE",
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE",
G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SIZE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SIZE",
G_FILE_ATTRIBUTE_STANDARD_SIZE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET",
G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_TARGET_URI",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_TARGET_URI",
G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SORT_ORDER",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SORT_ORDER",
G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ETAG_VALUE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ETAG_VALUE",
G_FILE_ATTRIBUTE_ETAG_VALUE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ID_FILE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ID_FILE",
G_FILE_ATTRIBUTE_ID_FILE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ID_FILESYSTEM",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ID_FILESYSTEM",
G_FILE_ATTRIBUTE_ID_FILESYSTEM);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_READ",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_READ",
G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_WRITE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_WRITE",
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE",
G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_DELETE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_DELETE",
G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_TRASH",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_TRASH",
G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_RENAME",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_RENAME",
G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT",
G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT",
G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT",
G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE",
G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI",
G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_MODIFIED",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_MODIFIED",
G_FILE_ATTRIBUTE_TIME_MODIFIED);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_MODIFIED_USEC",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_MODIFIED_USEC",
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_ACCESS",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_ACCESS",
G_FILE_ATTRIBUTE_TIME_ACCESS);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_ACCESS_USEC",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_ACCESS_USEC",
G_FILE_ATTRIBUTE_TIME_ACCESS_USEC);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CHANGED",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CHANGED",
G_FILE_ATTRIBUTE_TIME_CHANGED);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CHANGED_USEC",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CHANGED_USEC",
G_FILE_ATTRIBUTE_TIME_CHANGED_USEC);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CREATED",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CREATED",
G_FILE_ATTRIBUTE_TIME_CREATED);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CREATED_USEC",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CREATED_USEC",
G_FILE_ATTRIBUTE_TIME_CREATED_USEC);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_DEVICE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_DEVICE",
G_FILE_ATTRIBUTE_UNIX_DEVICE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_INODE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_INODE",
G_FILE_ATTRIBUTE_UNIX_INODE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_MODE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_MODE",
G_FILE_ATTRIBUTE_UNIX_MODE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_NLINK",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_NLINK",
G_FILE_ATTRIBUTE_UNIX_NLINK);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_UID",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_UID",
G_FILE_ATTRIBUTE_UNIX_UID);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_GID",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_GID",
G_FILE_ATTRIBUTE_UNIX_GID);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_RDEV",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_RDEV",
G_FILE_ATTRIBUTE_UNIX_RDEV);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_BLOCK_SIZE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_BLOCK_SIZE",
G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_BLOCKS",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_BLOCKS",
G_FILE_ATTRIBUTE_UNIX_BLOCKS);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT",
G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_DOS_IS_ARCHIVE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_DOS_IS_ARCHIVE",
G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_DOS_IS_SYSTEM",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_DOS_IS_SYSTEM",
G_FILE_ATTRIBUTE_DOS_IS_SYSTEM);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_USER",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_USER",
G_FILE_ATTRIBUTE_OWNER_USER);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_USER_REAL",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_USER_REAL",
G_FILE_ATTRIBUTE_OWNER_USER_REAL);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_GROUP",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_GROUP",
G_FILE_ATTRIBUTE_OWNER_GROUP);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_THUMBNAIL_PATH",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_THUMBNAIL_PATH",
G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_THUMBNAILING_FAILED",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_THUMBNAILING_FAILED",
G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_SIZE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_SIZE",
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_FREE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_FREE",
G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_TYPE",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_TYPE",
G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_READONLY",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_READONLY",
G_FILE_ATTRIBUTE_FILESYSTEM_READONLY);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW",
G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_GVFS_BACKEND",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_GVFS_BACKEND",
G_FILE_ATTRIBUTE_GVFS_BACKEND);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_SELINUX_CONTEXT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_SELINUX_CONTEXT",
G_FILE_ATTRIBUTE_SELINUX_CONTEXT);
- PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TRASH_ITEM_COUNT",
+ PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TRASH_ITEM_COUNT",
G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT);
-
- PyModule_AddStringConstant(m, "ERROR", g_quark_to_string(G_IO_ERROR));
+
+ PyModule_AddStringConstant(module, "ERROR", g_quark_to_string(G_IO_ERROR));
/* pygio version */
tuple = Py_BuildValue ("(iii)",
PYGIO_MAJOR_VERSION,
PYGIO_MINOR_VERSION,
PYGIO_MICRO_VERSION);
- PyDict_SetItemString(d, "pygio_version", tuple);
+ PyDict_SetItemString(d, "pygio_version", tuple);
Py_DECREF(tuple);
+
+ return 0;
}
diff --git a/gio/pygio-utils.c b/gio/pygio-utils.c
index be41453..f89c4b9 100644
--- a/gio/pygio-utils.c
+++ b/gio/pygio-utils.c
@@ -22,6 +22,7 @@
*/
#include "pygio-utils.h"
+#include <pyglib-python-compat.h>
/**
* pygio_check_cancellable:
@@ -115,14 +116,28 @@ pygio_pylist_to_uri_glist(PyObject *pyfile_list)
len = PySequence_Size(pyfile_list);
for (i = 0; i < len; i++) {
- item = PySequence_GetItem(pyfile_list, i);
- if (!PyString_Check(item)) {
+ item = PySequence_GetItem(pyfile_list, i);
+ if (!PYGLIB_PyUnicode_Check(item)) {
PyErr_SetString(PyExc_TypeError,
"files must be strings");
g_list_free(file_list);
return NULL;
}
- file_list = g_list_prepend(file_list, PyString_AsString(item));
+
+#if PY_VERSION_HEX < 0x03000000
+ file_list = g_list_prepend(file_list, g_strdup(PyString_AsString(item)));
+#else
+ {
+ PyObject *utf8_bytes_obj = PyUnicode_AsUTF8String (item);
+ if (!utf8_bytes_obj) {
+ g_list_free(file_list);
+ return NULL;
+ }
+ file_list = g_list_prepend(file_list, g_strdup(PyBytes_AsString(utf8_bytes_obj)));
+ Py_DECREF (utf8_bytes_obj);
+ }
+#endif
+
}
file_list = g_list_reverse(file_list);
@@ -144,9 +159,9 @@ strv_to_pylist (char **strv)
len = strv ? g_strv_length (strv) : 0;
list = PyList_New (len);
- for (i = 0; i < len; i++)
- PyList_SetItem (list, i, PyString_FromString (strv[i]));
-
+ for (i = 0; i < len; i++) {
+ PyList_SetItem (list, i, PYGLIB_PyUnicode_FromString (strv[i]));
+ }
return list;
}
@@ -191,7 +206,7 @@ pylist_to_strv (PyObject *list,
return FALSE;
}
- if (!PyString_Check (item))
+ if (!PYGLIB_PyUnicode_Check (item))
{
Py_DECREF (item);
g_strfreev (ret);
@@ -199,7 +214,20 @@ pylist_to_strv (PyObject *list,
return FALSE;
}
+#if PY_VERSION_HEX < 0x03000000
ret[i] = g_strdup (PyString_AsString (item));
+#else
+ {
+ PyObject *utf8_bytes_obj = PyUnicode_AsUTF8String (item);
+ if (!utf8_bytes_obj) {
+ Py_DECREF (item);
+ g_strfreev (ret);
+ return FALSE;
+ }
+ ret[i] = g_strdup (PyBytes_AsString(utf8_bytes_obj));
+ Py_DECREF (utf8_bytes_obj);
+ }
+#endif
Py_DECREF (item);
}