From e5d66a3d89168db811dff9a9436f91fe44d74f0f Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 12 Jul 2017 08:37:07 +0900 Subject: [PATCH] Imported Upstream version 2.90.1 Change-Id: I1fc2c61834ea9989bdca62e73c250b1be7c90a37 Signed-off-by: DongHun Kwak --- ChangeLog | 4445 +++++++++--- Makefile.am | 15 +- Makefile.in | 91 +- NEWS | 254 +- PKG-INFO | 6 +- PKG-INFO.in | 2 +- README | 3 +- codegen/Makefile.am | 33 - codegen/Makefile.in | 576 -- codegen/README.defs | 351 - codegen/__init__.py | 16 - codegen/argtypes.py | 1043 --- codegen/code-coverage.py | 44 - codegen/codegen.py | 1722 ----- codegen/createdefs.py | 17 - codegen/definitions.py | 575 -- codegen/defsconvert.py | 132 - codegen/defsgen.py | 737 -- codegen/defsparser.py | 153 - codegen/docextract.py | 448 -- codegen/docextract_to_xml.py | 139 - codegen/docgen.py | 766 -- codegen/h2def.py | 631 -- codegen/mergedefs.py | 26 - codegen/missingdefs.py | 17 - codegen/mkskel.py | 89 - codegen/override.py | 285 - codegen/pygobject-codegen-2.0.in | 11 - codegen/reversewrapper.py | 912 --- codegen/scanvirtuals.py | 54 - codegen/scmexpr.py | 143 - config.h.in | 3 - configure | 319 +- configure.ac | 80 +- docs/Makefile.am | 82 +- docs/Makefile.in | 85 +- docs/html/class-gioappinfo.html | 210 - docs/html/class-gioapplaunchcontext.html | 44 - docs/html/class-gioasyncresult.html | 44 - docs/html/class-giobufferedinputstream.html | 133 - docs/html/class-giobufferedoutputstream.html | 62 - docs/html/class-giocancellable.html | 61 - docs/html/class-giodatainputstream.html | 223 - docs/html/class-giodataoutputstream.html | 118 - docs/html/class-giodrive.html | 117 - docs/html/class-gioemblem.html | 46 - docs/html/class-gioemblemedicon.html | 38 - docs/html/class-giofile.html | 1436 ---- docs/html/class-giofileattributeinfo.html | 11 - docs/html/class-giofileenumerator.html | 126 - docs/html/class-giofileicon.html | 21 - docs/html/class-giofileinfo.html | 42 - docs/html/class-giofileinputstream.html | 65 - docs/html/class-giofilemonitor.html | 21 - docs/html/class-giofileoutputstream.html | 84 - docs/html/class-giofilterinputstream.html | 22 - docs/html/class-giofilteroutputstream.html | 22 - docs/html/class-gioicon.html | 81 - docs/html/class-gioinputstream.html | 242 - docs/html/class-gioloadableicon.html | 51 - docs/html/class-giomemoryinputstream.html | 32 - docs/html/class-giomemoryoutputstream.html | 40 - docs/html/class-giomount.html | 242 - docs/html/class-giomountoperation.html | 123 - docs/html/class-giooutputstream.html | 19 - docs/html/class-gioseekable.html | 55 - docs/html/class-giosimpleasyncresult.html | 87 - docs/html/class-giothemedicon.html | 42 - docs/html/class-giounixinputstream.html | 37 - docs/html/class-giounixoutputstream.html | 37 - docs/html/class-giovolume.html | 176 - docs/html/class-giovolumemonitor.html | 135 - docs/html/class-glibmaincontext.html | 8 +- docs/html/class-glibmainloop.html | 8 +- docs/html/class-gobject.html | 12 +- docs/html/class-gobjectgboxed.html | 8 +- docs/html/class-gobjectginterface.html | 6 +- docs/html/class-gobjectgpointer.html | 6 +- docs/html/gio-class-reference.html | 1 - docs/html/gio-constants.html | 414 -- docs/html/gio-functions.html | 74 - docs/html/giounix-class-reference.html | 1 - docs/html/glib-constants.html | 2 +- docs/html/glib-functions.html | 6 +- docs/html/gobject-constants.html | 4 +- docs/html/gobject-functions.html | 6 +- docs/html/index.html | 4 +- docs/html/index.sgml | 433 -- docs/html/pygobject.devhelp | 417 -- docs/reference/pygio-appinfo.xml | 894 --- docs/reference/pygio-applaunchcontext.xml | 194 - docs/reference/pygio-asyncresult.xml | 117 - docs/reference/pygio-bufferedinputstream.xml | 461 -- docs/reference/pygio-bufferedoutputstream.xml | 275 - docs/reference/pygio-cancellable.xml | 290 - docs/reference/pygio-classes.xml | 47 - docs/reference/pygio-constants.xml | 1540 ---- docs/reference/pygio-datainputstream.xml | 799 --- docs/reference/pygio-dataoutputstream.xml | 504 -- docs/reference/pygio-drive.xml | 546 -- docs/reference/pygio-emblem.xml | 232 - docs/reference/pygio-emblemedicon.xml | 160 - docs/reference/pygio-file.xml | 4534 ------------ docs/reference/pygio-fileattributeinfo.xml | 73 - docs/reference/pygio-fileenumerator.xml | 488 -- docs/reference/pygio-fileicon.xml | 109 - docs/reference/pygio-fileinfo.xml | 346 - docs/reference/pygio-fileinputstream.xml | 214 - docs/reference/pygio-filemonitor.xml | 128 - docs/reference/pygio-fileoutputstream.xml | 257 - docs/reference/pygio-filterinputstream.xml | 152 - docs/reference/pygio-filteroutputstream.xml | 152 - docs/reference/pygio-functions.xml | 395 -- docs/reference/pygio-icon.xml | 217 - docs/reference/pygio-inputstream.xml | 730 -- docs/reference/pygio-loadableicon.xml | 198 - docs/reference/pygio-memoryinputstream.xml | 151 - docs/reference/pygio-memoryoutputstream.xml | 175 - docs/reference/pygio-mount.xml | 962 --- docs/reference/pygio-mountoperation.xml | 726 -- docs/reference/pygio-outputstream.xml | 140 - docs/reference/pygio-seekable.xml | 231 - docs/reference/pygio-simpleasyncresult.xml | 317 - docs/reference/pygio-themedicon.xml | 204 - docs/reference/pygio-unixinputstream.xml | 202 - docs/reference/pygio-unixoutputstream.xml | 202 - docs/reference/pygio-volume.xml | 718 -- docs/reference/pygio-volumemonitor.xml | 844 --- docs/reference/pygiounix-classes.xml | 13 - docs/reference/pygobject-ref.xml | 2 - examples/Makefile.in | 3 - examples/cairo-demo.py | 6 +- gi/Makefile.am | 23 +- gi/Makefile.in | 94 +- gi/__init__.py | 2 +- {glib => gi/_glib}/Makefile.am | 15 +- {glib => gi/_glib}/Makefile.in | 116 +- {glib => gi/_glib}/__init__.py | 3 +- {glib => gi/_glib}/glibmodule.c | 10 +- {glib => gi/_glib}/option.py | 4 +- {glib => gi/_glib}/pygiochannel.c | 38 +- {glib => gi/_glib}/pygiochannel.h | 0 {glib => gi/_glib}/pyglib-private.h | 0 {glib => gi/_glib}/pyglib-python-compat.h | 0 {glib => gi/_glib}/pyglib.c | 18 +- {glib => gi/_glib}/pyglib.h | 0 {glib => gi/_glib}/pygmaincontext.c | 2 +- {glib => gi/_glib}/pygmaincontext.h | 0 {glib => gi/_glib}/pygmainloop.c | 4 +- {glib => gi/_glib}/pygmainloop.h | 0 {glib => gi/_glib}/pygoptioncontext.c | 4 +- {glib => gi/_glib}/pygoptioncontext.h | 0 {glib => gi/_glib}/pygoptiongroup.c | 4 +- {glib => gi/_glib}/pygoptiongroup.h | 0 {glib => gi/_glib}/pygsource.c | 14 +- {glib => gi/_glib}/pygsource.h | 0 {glib => gi/_glib}/pygspawn.c | 14 +- {glib => gi/_glib}/pygspawn.h | 0 {gobject => gi/_gobject}/Makefile.am | 16 +- {gobject => gi/_gobject}/Makefile.in | 83 +- {gobject => gi/_gobject}/__init__.py | 34 +- {gobject => gi/_gobject}/constants.py | 3 +- {gobject => gi/_gobject}/ffi-marshaller.c | 0 {gobject => gi/_gobject}/ffi-marshaller.h | 0 {gobject => gi/_gobject}/gobjectmodule.c | 4 +- {gobject => gi/_gobject}/propertyhelper.py | 30 +- {gobject => gi/_gobject}/pygboxed.c | 0 {gobject => gi/_gobject}/pygboxed.h | 0 {gobject => gi/_gobject}/pygenum.c | 0 {gobject => gi/_gobject}/pygenum.h | 0 {gobject => gi/_gobject}/pygflags.c | 0 {gobject => gi/_gobject}/pygflags.h | 0 {gobject => gi/_gobject}/pyginterface.c | 0 {gobject => gi/_gobject}/pyginterface.h | 0 {gobject => gi/_gobject}/pygobject-private.h | 1 - {gobject => gi/_gobject}/pygobject.c | 52 +- {gobject => gi/_gobject}/pygobject.h | 2 +- {gobject => gi/_gobject}/pygparamspec.c | 0 {gobject => gi/_gobject}/pygparamspec.h | 0 {gobject => gi/_gobject}/pygpointer.c | 0 {gobject => gi/_gobject}/pygpointer.h | 0 {gobject => gi/_gobject}/pygtype.c | 13 +- {gobject => gi/_gobject}/pygtype.h | 0 gi/gimodule.c | 6 +- gi/importer.py | 14 +- gi/module.py | 123 +- gi/overrides/GLib.py | 32 +- gi/overrides/Gdk.py | 8 + gi/overrides/Gtk.py | 159 +- gi/overrides/Makefile.in | 3 - gi/overrides/__init__.py | 6 +- gi/pygi-argument.c | 62 +- gi/pygi-cache.c | 1443 ++++ gi/pygi-cache.h | 174 + gi/pygi-closure.c | 3 + gi/pygi-foreign-cairo.c | 19 +- gi/pygi-foreign-gvariant.c | 9 +- gi/pygi-foreign-gvariant.h | 14 +- gi/pygi-foreign.c | 30 +- gi/pygi-foreign.h | 14 +- gi/pygi-info.c | 8 +- gi/pygi-invoke-state-struct.h | 44 + gi/pygi-invoke.c | 1358 ++-- gi/pygi-invoke.h | 2 +- gi/pygi-marshal-cleanup.c | 517 ++ gi/pygi-marshal-cleanup.h | 97 + gi/pygi-marshal-in.c | 1412 ++++ gi/pygi-marshal-in.h | 186 + gi/pygi-marshal-out.c | 767 ++ gi/pygi-marshal-out.h | 144 + gi/pygi-private.h | 3 +- gi/pygi.h | 61 +- gi/pygobject-external.h | 2 +- gi/repository/Makefile.in | 3 - gi/types.py | 33 +- gio/Makefile.am | 117 - gio/Makefile.in | 848 --- gio/__init__.py | 40 - gio/gappinfo.override | 213 - gio/gapplaunchcontext.override | 99 - gio/gbufferedinputstream.override | 70 - gio/gcancellable.override | 38 - gio/gdatainputstream.override | 250 - gio/gdrive.override | 347 - gio/gfile.override | 2215 ------ gio/gfileattribute.override | 153 - gio/gfileenumerator.override | 184 - gio/gfileinfo.override | 121 - gio/gfileinputstream.override | 68 - gio/gfileiostream.override | 68 - gio/gfileoutputstream.override | 68 - gio/gicon.override | 310 - gio/ginputstream.override | 344 - gio/gio-types.defs | 807 --- gio/gio.defs | 7465 -------------------- gio/gio.override | 409 -- gio/giomodule.c | 208 - gio/giostream.override | 68 - gio/gmemoryinputstream.override | 91 - gio/gmemoryoutputstream.override | 45 - gio/gmount.override | 454 -- gio/goutputstream.override | 292 - gio/gresolver.override | 312 - gio/gsocket.override | 575 -- gio/gvolume.override | 237 - gio/gvolumemonitor.override | 94 - gio/pygio-utils.c | 236 - gio/pygio-utils.h | 49 - gio/unix-types.defs | 55 - gio/unix.defs | 475 -- gio/unix.override | 62 - gio/unixmodule.c | 52 - ...talled.pc.in => pygobject-3.0-uninstalled.pc.in | 1 - pygobject-2.0.pc.in => pygobject-3.0.pc.in | 1 - pygtk.py | 95 - tests/Makefile.am | 24 +- tests/Makefile.in | 118 +- tests/runtests.py | 8 + tests/te_ST@nouppera | 50 + tests/test_everything.py | 9 +- tests/test_gcancellable.py | 15 - tests/test_gdbus.py | 45 +- tests/test_gi.py | 113 +- tests/test_gicon.py | 112 - tests/test_gio.py | 1138 --- tests/test_gobject.py | 31 +- tests/test_gresolver.py | 68 - tests/test_gsocket.py | 126 - tests/test_interface.py | 16 +- tests/test_mainloop.py | 6 +- tests/test_option.py | 3 +- tests/test_overrides.py | 205 +- tests/test_properties.py | 154 +- tests/test_signal.py | 98 +- tests/test_source.py | 23 +- tests/test_subprocess.py | 11 +- tests/test_thread.py | 9 +- tests/test_uris.py | 4 +- tests/testhelpermodule.c | 2 +- tests/testmodule.py | 10 +- 280 files changed, 10248 insertions(+), 56153 deletions(-) delete mode 100644 codegen/Makefile.am delete mode 100644 codegen/Makefile.in delete mode 100644 codegen/README.defs delete mode 100644 codegen/__init__.py delete mode 100644 codegen/argtypes.py delete mode 100755 codegen/code-coverage.py delete mode 100755 codegen/codegen.py delete mode 100755 codegen/createdefs.py delete mode 100644 codegen/definitions.py delete mode 100755 codegen/defsconvert.py delete mode 100755 codegen/defsgen.py delete mode 100644 codegen/defsparser.py delete mode 100644 codegen/docextract.py delete mode 100755 codegen/docextract_to_xml.py delete mode 100755 codegen/docgen.py delete mode 100755 codegen/h2def.py delete mode 100755 codegen/mergedefs.py delete mode 100755 codegen/missingdefs.py delete mode 100755 codegen/mkskel.py delete mode 100644 codegen/override.py delete mode 100644 codegen/pygobject-codegen-2.0.in delete mode 100644 codegen/reversewrapper.py delete mode 100755 codegen/scanvirtuals.py delete mode 100755 codegen/scmexpr.py delete mode 100644 docs/html/class-gioappinfo.html delete mode 100644 docs/html/class-gioapplaunchcontext.html delete mode 100644 docs/html/class-gioasyncresult.html delete mode 100644 docs/html/class-giobufferedinputstream.html delete mode 100644 docs/html/class-giobufferedoutputstream.html delete mode 100644 docs/html/class-giocancellable.html delete mode 100644 docs/html/class-giodatainputstream.html delete mode 100644 docs/html/class-giodataoutputstream.html delete mode 100644 docs/html/class-giodrive.html delete mode 100644 docs/html/class-gioemblem.html delete mode 100644 docs/html/class-gioemblemedicon.html delete mode 100644 docs/html/class-giofile.html delete mode 100644 docs/html/class-giofileattributeinfo.html delete mode 100644 docs/html/class-giofileenumerator.html delete mode 100644 docs/html/class-giofileicon.html delete mode 100644 docs/html/class-giofileinfo.html delete mode 100644 docs/html/class-giofileinputstream.html delete mode 100644 docs/html/class-giofilemonitor.html delete mode 100644 docs/html/class-giofileoutputstream.html delete mode 100644 docs/html/class-giofilterinputstream.html delete mode 100644 docs/html/class-giofilteroutputstream.html delete mode 100644 docs/html/class-gioicon.html delete mode 100644 docs/html/class-gioinputstream.html delete mode 100644 docs/html/class-gioloadableicon.html delete mode 100644 docs/html/class-giomemoryinputstream.html delete mode 100644 docs/html/class-giomemoryoutputstream.html delete mode 100644 docs/html/class-giomount.html delete mode 100644 docs/html/class-giomountoperation.html delete mode 100644 docs/html/class-giooutputstream.html delete mode 100644 docs/html/class-gioseekable.html delete mode 100644 docs/html/class-giosimpleasyncresult.html delete mode 100644 docs/html/class-giothemedicon.html delete mode 100644 docs/html/class-giounixinputstream.html delete mode 100644 docs/html/class-giounixoutputstream.html delete mode 100644 docs/html/class-giovolume.html delete mode 100644 docs/html/class-giovolumemonitor.html delete mode 100644 docs/html/gio-class-reference.html delete mode 100644 docs/html/gio-constants.html delete mode 100644 docs/html/gio-functions.html delete mode 100644 docs/html/giounix-class-reference.html delete mode 100644 docs/reference/pygio-appinfo.xml delete mode 100644 docs/reference/pygio-applaunchcontext.xml delete mode 100644 docs/reference/pygio-asyncresult.xml delete mode 100644 docs/reference/pygio-bufferedinputstream.xml delete mode 100644 docs/reference/pygio-bufferedoutputstream.xml delete mode 100644 docs/reference/pygio-cancellable.xml delete mode 100644 docs/reference/pygio-classes.xml delete mode 100644 docs/reference/pygio-constants.xml delete mode 100644 docs/reference/pygio-datainputstream.xml delete mode 100644 docs/reference/pygio-dataoutputstream.xml delete mode 100644 docs/reference/pygio-drive.xml delete mode 100644 docs/reference/pygio-emblem.xml delete mode 100644 docs/reference/pygio-emblemedicon.xml delete mode 100644 docs/reference/pygio-file.xml delete mode 100644 docs/reference/pygio-fileattributeinfo.xml delete mode 100644 docs/reference/pygio-fileenumerator.xml delete mode 100644 docs/reference/pygio-fileicon.xml delete mode 100644 docs/reference/pygio-fileinfo.xml delete mode 100644 docs/reference/pygio-fileinputstream.xml delete mode 100644 docs/reference/pygio-filemonitor.xml delete mode 100644 docs/reference/pygio-fileoutputstream.xml delete mode 100644 docs/reference/pygio-filterinputstream.xml delete mode 100644 docs/reference/pygio-filteroutputstream.xml delete mode 100644 docs/reference/pygio-functions.xml delete mode 100644 docs/reference/pygio-icon.xml delete mode 100644 docs/reference/pygio-inputstream.xml delete mode 100644 docs/reference/pygio-loadableicon.xml delete mode 100644 docs/reference/pygio-memoryinputstream.xml delete mode 100644 docs/reference/pygio-memoryoutputstream.xml delete mode 100644 docs/reference/pygio-mount.xml delete mode 100644 docs/reference/pygio-mountoperation.xml delete mode 100644 docs/reference/pygio-outputstream.xml delete mode 100644 docs/reference/pygio-seekable.xml delete mode 100644 docs/reference/pygio-simpleasyncresult.xml delete mode 100644 docs/reference/pygio-themedicon.xml delete mode 100644 docs/reference/pygio-unixinputstream.xml delete mode 100644 docs/reference/pygio-unixoutputstream.xml delete mode 100644 docs/reference/pygio-volume.xml delete mode 100644 docs/reference/pygio-volumemonitor.xml delete mode 100644 docs/reference/pygiounix-classes.xml rename {glib => gi/_glib}/Makefile.am (72%) rename {glib => gi/_glib}/Makefile.in (88%) rename {glib => gi/_glib}/__init__.py (97%) rename {glib => gi/_glib}/glibmodule.c (98%) rename {glib => gi/_glib}/option.py (99%) rename {glib => gi/_glib}/pygiochannel.c (92%) rename {glib => gi/_glib}/pygiochannel.h (100%) rename {glib => gi/_glib}/pyglib-private.h (100%) rename {glib => gi/_glib}/pyglib-python-compat.h (100%) rename {glib => gi/_glib}/pyglib.c (96%) rename {glib => gi/_glib}/pyglib.h (100%) rename {glib => gi/_glib}/pygmaincontext.c (97%) rename {glib => gi/_glib}/pygmaincontext.h (100%) rename {glib => gi/_glib}/pygmainloop.c (98%) rename {glib => gi/_glib}/pygmainloop.h (100%) rename {glib => gi/_glib}/pygoptioncontext.c (98%) rename {glib => gi/_glib}/pygoptioncontext.h (100%) rename {glib => gi/_glib}/pygoptiongroup.c (98%) rename {glib => gi/_glib}/pygoptiongroup.h (100%) rename {glib => gi/_glib}/pygsource.c (97%) rename {glib => gi/_glib}/pygsource.h (100%) rename {glib => gi/_glib}/pygspawn.c (95%) rename {glib => gi/_glib}/pygspawn.h (100%) rename {gobject => gi/_gobject}/Makefile.am (84%) rename {gobject => gi/_gobject}/Makefile.in (92%) rename {gobject => gi/_gobject}/__init__.py (82%) rename {gobject => gi/_gobject}/constants.py (97%) rename {gobject => gi/_gobject}/ffi-marshaller.c (100%) rename {gobject => gi/_gobject}/ffi-marshaller.h (100%) rename {gobject => gi/_gobject}/gobjectmodule.c (99%) rename {gobject => gi/_gobject}/propertyhelper.py (90%) rename {gobject => gi/_gobject}/pygboxed.c (100%) rename {gobject => gi/_gobject}/pygboxed.h (100%) rename {gobject => gi/_gobject}/pygenum.c (100%) rename {gobject => gi/_gobject}/pygenum.h (100%) rename {gobject => gi/_gobject}/pygflags.c (100%) rename {gobject => gi/_gobject}/pygflags.h (100%) rename {gobject => gi/_gobject}/pyginterface.c (100%) rename {gobject => gi/_gobject}/pyginterface.h (100%) rename {gobject => gi/_gobject}/pygobject-private.h (99%) rename {gobject => gi/_gobject}/pygobject.c (98%) rename {gobject => gi/_gobject}/pygobject.h (99%) rename {gobject => gi/_gobject}/pygparamspec.c (100%) rename {gobject => gi/_gobject}/pygparamspec.h (100%) rename {gobject => gi/_gobject}/pygpointer.c (100%) rename {gobject => gi/_gobject}/pygpointer.h (100%) rename {gobject => gi/_gobject}/pygtype.c (99%) rename {gobject => gi/_gobject}/pygtype.h (100%) create mode 100644 gi/pygi-cache.c create mode 100644 gi/pygi-cache.h create mode 100644 gi/pygi-invoke-state-struct.h create mode 100644 gi/pygi-marshal-cleanup.c create mode 100644 gi/pygi-marshal-cleanup.h create mode 100644 gi/pygi-marshal-in.c create mode 100644 gi/pygi-marshal-in.h create mode 100644 gi/pygi-marshal-out.c create mode 100644 gi/pygi-marshal-out.h delete mode 100644 gio/Makefile.am delete mode 100644 gio/Makefile.in delete mode 100644 gio/__init__.py delete mode 100644 gio/gappinfo.override delete mode 100644 gio/gapplaunchcontext.override delete mode 100644 gio/gbufferedinputstream.override delete mode 100644 gio/gcancellable.override delete mode 100644 gio/gdatainputstream.override delete mode 100644 gio/gdrive.override delete mode 100644 gio/gfile.override delete mode 100644 gio/gfileattribute.override delete mode 100644 gio/gfileenumerator.override delete mode 100644 gio/gfileinfo.override delete mode 100644 gio/gfileinputstream.override delete mode 100644 gio/gfileiostream.override delete mode 100644 gio/gfileoutputstream.override delete mode 100644 gio/gicon.override delete mode 100644 gio/ginputstream.override delete mode 100644 gio/gio-types.defs delete mode 100644 gio/gio.defs delete mode 100644 gio/gio.override delete mode 100644 gio/giomodule.c delete mode 100644 gio/giostream.override delete mode 100644 gio/gmemoryinputstream.override delete mode 100644 gio/gmemoryoutputstream.override delete mode 100644 gio/gmount.override delete mode 100644 gio/goutputstream.override delete mode 100644 gio/gresolver.override delete mode 100644 gio/gsocket.override delete mode 100644 gio/gvolume.override delete mode 100644 gio/gvolumemonitor.override delete mode 100644 gio/pygio-utils.c delete mode 100644 gio/pygio-utils.h delete mode 100644 gio/unix-types.defs delete mode 100644 gio/unix.defs delete mode 100644 gio/unix.override delete mode 100644 gio/unixmodule.c rename pygobject-2.0-uninstalled.pc.in => pygobject-3.0-uninstalled.pc.in (93%) rename pygobject-2.0.pc.in => pygobject-3.0.pc.in (93%) delete mode 100644 pygtk.py mode change 100644 => 100755 tests/runtests.py create mode 100644 tests/te_ST@nouppera delete mode 100644 tests/test_gcancellable.py delete mode 100644 tests/test_gicon.py delete mode 100644 tests/test_gio.py delete mode 100644 tests/test_gresolver.py delete mode 100644 tests/test_gsocket.py diff --git a/ChangeLog b/ChangeLog index 8a72a87..126c4cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,223 +1,1776 @@ -commit 42970db5949c615078c38a039da4745eeb194ac1 +commit d3f85a61ec4b1a1d04838f73dc8d862258150048 +Author: John (J5) Palmieri +Date: Sun Aug 14 10:13:37 2011 -0400 + + get things ready for release + + NEWS | 194 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 194 insertions(+), 0 deletions(-) + +commit ffd057649380d4249c1c52e1225e3646f3994bc6 +Author: John (J5) Palmieri +Date: Sun Aug 14 05:26:18 2011 -0400 + + pass exta keywords to the Box constructor + + gi/overrides/Gtk.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit cadbd4142bd0045368b5123d4b0a1876bdd5d798 +Author: John (J5) Palmieri +Date: Sat Aug 13 11:03:07 2011 -0400 + + add (Tree|List)Store set method override + + gi/overrides/Gtk.py | 50 +++++++++++++++++++++++ + tests/test_overrides.py | 102 + +++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 149 insertions(+), 3 deletions(-) + +commit 9ee9b22bd95e44bd2eca26e7bf3b0a9a988700c5 +Author: John (J5) Palmieri +Date: Sat Aug 13 09:19:29 2011 -0400 + + add test for object arrays + + tests/test_everything.py | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit c9d9ffd0380878792cbdb13dec4e53be897e5fbc +Author: John (J5) Palmieri +Date: Sat Aug 13 08:46:18 2011 -0400 + + only support C pointer arrays for structs and objects + + * There is no way to know if an array of structs or objects are + pointer arrays + or flat arrays. Since pointer arrays are the most useful and + prevelant + it has been decided to only support those arrays + + gi/pygi-marshal-out.c | 2 +- + tests/test_gi.py | 8 -------- + 2 files changed, 1 insertions(+), 9 deletions(-) + +commit b12379de1790b72d51883bf7b63c892639a892e7 +Author: John (J5) Palmieri +Date: Sat Aug 13 06:31:52 2011 -0400 + + revert Gtk.Window override because it causes issues with subclasses + + gi/overrides/Gtk.py | 9 --------- + 1 files changed, 0 insertions(+), 9 deletions(-) + +commit 3e64a62d6d7f9e9d2820aad54187ef9c34710a1f +Author: Jonathan Matthew +Date: Thu Apr 7 21:05:32 2011 +1000 + + take GIL in _pygi_invoke_closure_free (bug #647016) + + gi/pygi-closure.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit f8de9b8615f5dc30f492781d792aef5fc1e9ab73 +Author: Johan Dahlin +Date: Mon Jun 27 00:41:24 2011 -0300 + + Add a default parameter to GtkTreeModel.filter_new + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gtk.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 583d0b3c6b53712128d7c2d5f075000a2a76ae5f +Author: Johan Dahlin +Date: Mon Jun 27 00:40:12 2011 -0300 + + Add vbox/action_area properties + + Accessing vbox/action_area directly creates segmentation fault, + avoid that by mapping the fields to their getters for PyGTK + API compatibility + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gtk.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 017fdfc1dd06259006719e02ffa48883cee01ffd +Author: Johan Dahlin +Date: Mon Jun 27 00:39:41 2011 -0300 + + Add a couple of constructors + + This is for PyGTK compatibility, so that gtk.HBox(True, 2) etc + works. + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gtk.py | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 40 insertions(+), 0 deletions(-) + +commit af8bc9d5cdba48a7ee728ccb7ea9039df3ecceba +Author: Johan Dahlin +Date: Mon Jun 27 00:38:30 2011 -0300 + + Do not always pass in user_data to callbacks. + + This keeps API compatibility with PyGTK and avoids sending + in user_data if it's None. + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gtk.py | 15 ++++++++++++--- + 1 files changed, 12 insertions(+), 3 deletions(-) + +commit 7914d814350af1a18bdeda64f049c8e9a68d1d18 +Author: Johan Dahlin +Date: Mon Jun 27 00:38:20 2011 -0300 + + Add a default detail value for Widget.render_icon + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gtk.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 5b1c875269b7979caae97e84919a690a34d92f29 +Author: Johan Dahlin +Date: Mon Jun 27 00:36:20 2011 -0300 + + Add an override for Gdk.color_parse() + + Change Gdk.color_parse() to not return a tuple, instead just + return the created color or None if it wasn't possible to parse + the name into a color. + + This keeps compatibility with PyGTK but breaks the current API. + + https://bugzilla.gnome.org/show_bug.cgi?id=653462 + + gi/overrides/Gdk.py | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 187a2932bbf1e724f759ff3ed3392fc7341c6aa8 +Author: Laszlo Pandy +Date: Mon Aug 8 12:06:18 2011 +0200 + + Support function calling with keyword arguments in invoke. + + https://bugzilla.gnome.org/show_bug.cgi?id=625596 + + gi/pygi-cache.c | 39 +++++++++++ + gi/pygi-cache.h | 4 + + gi/pygi-invoke.c | 162 + ++++++++++++++++++++++++++++++++++++++++++++-- + gi/types.py | 12 ++-- + tests/test_everything.py | 2 +- + tests/test_gi.py | 58 ++++++++++++++++ + 6 files changed, 265 insertions(+), 12 deletions(-) + +commit e5df32ffbf37481dbb6a70c4d4e7b7b9778c5549 +Author: John (J5) Palmieri +Date: Sat Aug 13 04:13:28 2011 -0400 + + remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN + + gi/pygi-info.c | 5 ----- + 1 files changed, 0 insertions(+), 5 deletions(-) + +commit 745001178fc72be5626c7211366d694f41162987 +Author: Martin Pitt +Date: Thu Aug 11 15:11:42 2011 +0200 + + Fix gobject vs. gi.repository warning + + Check the warning earlier and fix the operator, so that it actually + works. Also + update the warning to explain how to fix the problem. + + gi/_gobject/__init__.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 25d2d05cba05414cd4551e0e06f6286a9b97a509 +Author: John (J5) Palmieri +Date: Fri Jul 22 15:46:31 2011 -0400 + + make GObject and GLib able to take overrides + + * derive directly from DynamicModule instead of InterfaceModule + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/importer.py | 11 ++--- + gi/module.py | 118 + ++++++++++++++++++++++++++++---------------------------- + 2 files changed, 64 insertions(+), 65 deletions(-) + +commit 698b2284e29c0f699198cf6a22eeb0e399daba6e +Author: John (J5) Palmieri +Date: Fri Jul 22 15:45:09 2011 -0400 + + avoid dependency issue by importing the internal gobject + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/__init__.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7b068ebe59884ebd9aeb4425dc80cdff73a66fb1 +Author: John (J5) Palmieri +Date: Fri Jul 22 14:13:02 2011 -0400 + + fix tests to use the new GLib module + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + tests/test_mainloop.py | 7 +++---- + tests/test_option.py | 3 ++- + tests/test_source.py | 24 +++++++++++------------- + tests/test_subprocess.py | 12 +++++------- + tests/test_thread.py | 10 ++++------ + tests/test_uris.py | 4 ++-- + 6 files changed, 27 insertions(+), 33 deletions(-) + +commit 191ef79315f8a5641699536fde58da18e23ef904 +Author: John (J5) Palmieri +Date: Fri Jul 22 14:11:53 2011 -0400 + + add DynamicGLibModule which works like DynamicGObjectModule + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/importer.py | 7 +++++-- + gi/module.py | 32 +++++++++++++++++++++++++++++--- + 2 files changed, 34 insertions(+), 5 deletions(-) + +commit fbd4a8263260c187211799454c08b1e55e2cb998 +Author: John (J5) Palmieri +Date: Fri Jul 22 12:27:41 2011 -0400 + + refactor, add objects and types to the correct internal module + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/_glib/pygiochannel.c | 38 +++++++++++++++++++------------------- + gi/_glib/pygmaincontext.c | 2 +- + gi/_glib/pygmainloop.c | 4 ++-- + gi/_glib/pygoptioncontext.c | 4 ++-- + gi/_glib/pygoptiongroup.c | 4 ++-- + gi/_glib/pygsource.c | 14 +++++++------- + gi/_glib/pygspawn.c | 14 +++++++------- + 7 files changed, 40 insertions(+), 40 deletions(-) + +commit 7431b49a161df9178c55b814d3adff992ac2d722 +Author: John (J5) Palmieri +Date: Fri Jul 22 12:26:32 2011 -0400 + + rename the pyglib shared library so we don't load the old one + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/Makefile.am | 2 +- + gi/_glib/Makefile.am | 10 +++++----- + gi/_gobject/Makefile.am | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +commit b8700451acd4a19b59b64fc8641fca748d2189e2 +Author: John (J5) Palmieri +Date: Fri Jul 22 11:20:09 2011 -0400 + + refactor tests to only use PyGObject 3 syntax + + * for PyGObject 3 we want to discourage the use of legacy + interfaces + * Using interfaces like from gi.repository import GObject makes + sure that the internal _gobject module is loaded and not + PyGObject 2's gobject module which would cause the application + to not work correctly + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + tests/runtests-windows.py | 4 +- + tests/test_gdbus.py | 12 ++-- + tests/test_gi.py | 4 +- + tests/test_gobject.py | 31 ++++++------ + tests/test_interface.py | 16 +++--- + tests/test_mainloop.py | 3 +- + tests/test_overrides.py | 8 ++-- + tests/test_properties.py | 124 + ++++++++++++++++++++++---------------------- + tests/test_signal.py | 98 ++++++++++++++++++------------------ + tests/test_source.py | 5 +- + tests/test_subprocess.py | 3 +- + tests/test_thread.py | 5 +- + tests/test_unknown.py | 8 ++-- + tests/testhelpermodule.c | 2 +- + tests/testmodule.py | 10 ++-- + 15 files changed, 169 insertions(+), 164 deletions(-) + +commit c980dae21468fe073cc8782608148c346bb90ad7 +Author: John (J5) Palmieri +Date: Fri Jul 22 11:16:00 2011 -0400 + + refactor the internal _glib module to import correct modules + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/_glib/__init__.py | 3 ++- + gi/_glib/glibmodule.c | 10 +++++----- + gi/_glib/option.py | 4 ++-- + gi/_glib/pyglib.c | 18 +++++++++--------- + 4 files changed, 18 insertions(+), 17 deletions(-) + +commit 65ac35cca8d24f4c133991e1c6ac02f49416a9a4 +Author: John (J5) Palmieri +Date: Fri Jul 22 11:10:46 2011 -0400 + + refactor to use the new internal _glib and _gobject modules + + * use relative imports instead of aboslute + * fix the C imports to import the internal _gobject libs + * add a check to see if the PyGObject 2 gobject module + was already imported + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/_gobject/__init__.py | 20 +++++++++++++------- + gi/_gobject/constants.py | 3 +-- + gi/_gobject/gobjectmodule.c | 2 +- + gi/_gobject/propertyhelper.py | 11 +++++------ + gi/_gobject/pygobject.c | 16 ++++++++-------- + gi/_gobject/pygobject.h | 2 +- + 6 files changed, 29 insertions(+), 25 deletions(-) + +commit 59ed1289f76bc287443b3974710ea0da3e2cc8cc +Author: John (J5) Palmieri +Date: Fri Jul 22 11:07:10 2011 -0400 + + refactor gi module to import and use internal _gobject module + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + gi/importer.py | 2 -- + gi/module.py | 31 ++++++++++++++++--------------- + gi/overrides/Gtk.py | 2 +- + gi/overrides/__init__.py | 6 +++--- + gi/pygobject-external.h | 2 +- + gi/types.py | 12 ++++++------ + 6 files changed, 27 insertions(+), 28 deletions(-) + +commit 6b9d738d78c6ac45d49f00402c89356887555069 +Author: John (J5) Palmieri +Date: Fri Jul 22 11:02:49 2011 -0400 + + move the static bits internal to gi and refactor build files + + * the glib module now becomes the gi._glib module + * the gobject module now becomes the gi._gobject module + * we do this so we can install in parallel with PyGObject 2 + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + Makefile.am | 2 +- + configure.ac | 6 +- + gi/Makefile.am | 8 +- + gi/_glib/Makefile.am | 58 + + gi/_glib/__init__.py | 25 + + gi/_glib/glibmodule.c | 969 ++++++++++++++ + gi/_glib/option.py | 358 ++++++ + gi/_glib/pygiochannel.c | 764 +++++++++++ + gi/_glib/pygiochannel.h | 29 + + gi/_glib/pyglib-private.h | 49 + + gi/_glib/pyglib-python-compat.h | 245 ++++ + gi/_glib/pyglib.c | 633 ++++++++++ + gi/_glib/pyglib.h | 83 ++ + gi/_glib/pygmaincontext.c | 126 ++ + gi/_glib/pygmaincontext.h | 40 + + gi/_glib/pygmainloop.c | 360 ++++++ + gi/_glib/pygmainloop.h | 36 + + gi/_glib/pygoptioncontext.c | 337 +++++ + gi/_glib/pygoptioncontext.h | 39 + + gi/_glib/pygoptiongroup.c | 298 +++++ + gi/_glib/pygoptiongroup.h | 42 + + gi/_glib/pygsource.c | 725 +++++++++++ + gi/_glib/pygsource.h | 39 + + gi/_glib/pygspawn.c | 264 ++++ + gi/_glib/pygspawn.h | 32 + + gi/_gobject/Makefile.am | 71 ++ + gi/_gobject/__init__.py | 117 ++ + gi/_gobject/constants.py | 83 ++ + gi/_gobject/ffi-marshaller.c | 194 +++ + gi/_gobject/ffi-marshaller.h | 31 + + gi/_gobject/gobjectmodule.c | 2638 + +++++++++++++++++++++++++++++++++++++++ + gi/_gobject/propertyhelper.py | 312 +++++ + gi/_gobject/pygboxed.c | 234 ++++ + gi/_gobject/pygboxed.h | 27 + + gi/_gobject/pygenum.c | 366 ++++++ + gi/_gobject/pygenum.h | 27 + + gi/_gobject/pygflags.c | 485 +++++++ + gi/_gobject/pygflags.h | 27 + + gi/_gobject/pyginterface.c | 122 ++ + gi/_gobject/pyginterface.h | 40 + + gi/_gobject/pygobject-private.h | 241 ++++ + gi/_gobject/pygobject.c | 2397 + +++++++++++++++++++++++++++++++++++ + gi/_gobject/pygobject.h | 667 ++++++++++ + gi/_gobject/pygparamspec.c | 404 ++++++ + gi/_gobject/pygparamspec.h | 31 + + gi/_gobject/pygpointer.c | 198 +++ + gi/_gobject/pygpointer.h | 27 + + gi/_gobject/pygtype.c | 1844 +++++++++++++++++++++++++++ + gi/_gobject/pygtype.h | 28 + + glib/Makefile.am | 61 - + glib/__init__.py | 25 - + glib/glibmodule.c | 969 -------------- + glib/option.py | 358 ------ + glib/pygiochannel.c | 764 ----------- + glib/pygiochannel.h | 29 - + glib/pyglib-private.h | 49 - + glib/pyglib-python-compat.h | 245 ---- + glib/pyglib.c | 633 ---------- + glib/pyglib.h | 83 -- + glib/pygmaincontext.c | 126 -- + glib/pygmaincontext.h | 40 - + glib/pygmainloop.c | 360 ------ + glib/pygmainloop.h | 36 - + glib/pygoptioncontext.c | 337 ----- + glib/pygoptioncontext.h | 39 - + glib/pygoptiongroup.c | 298 ----- + glib/pygoptiongroup.h | 42 - + glib/pygsource.c | 725 ----------- + glib/pygsource.h | 39 - + glib/pygspawn.c | 264 ---- + glib/pygspawn.h | 32 - + gobject/Makefile.am | 73 -- + gobject/__init__.py | 117 -- + gobject/constants.py | 83 -- + gobject/ffi-marshaller.c | 194 --- + gobject/ffi-marshaller.h | 31 - + gobject/gobjectmodule.c | 2638 + --------------------------------------- + gobject/propertyhelper.py | 312 ----- + gobject/pygboxed.c | 234 ---- + gobject/pygboxed.h | 27 - + gobject/pygenum.c | 366 ------ + gobject/pygenum.h | 27 - + gobject/pygflags.c | 485 ------- + gobject/pygflags.h | 27 - + gobject/pyginterface.c | 122 -- + gobject/pyginterface.h | 40 - + gobject/pygobject-private.h | 241 ---- + gobject/pygobject.c | 2397 + ----------------------------------- + gobject/pygobject.h | 667 ---------- + gobject/pygparamspec.c | 404 ------ + gobject/pygparamspec.h | 31 - + gobject/pygpointer.c | 198 --- + gobject/pygpointer.h | 27 - + gobject/pygtype.c | 1844 --------------------------- + gobject/pygtype.h | 28 - + tests/Makefile.am | 2 +- + 96 files changed, 16172 insertions(+), 16175 deletions(-) + +commit f0d2ddcf7e61c36f79a9adf8ccc53bf3db9349d3 +Author: John (J5) Palmieri +Date: Mon Jul 18 18:46:31 2011 -0400 + + remove pygtk.py + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + Makefile.am | 5 --- + pygtk.py | 95 + ----------------------------------------------------------- + 2 files changed, 0 insertions(+), 100 deletions(-) + +commit 75e9f7d80d9224c05e6063b88479f1baee48c489 +Author: John (J5) Palmieri +Date: Mon Jul 18 18:41:41 2011 -0400 + + introspection is no longer optional + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + Makefile.am | 8 +------- + configure.ac | 43 +++++++++++++++++-------------------------- + gi/pygi.h | 37 ------------------------------------- + gobject/Makefile.am | 5 +---- + tests/Makefile.am | 7 +------ + 5 files changed, 20 insertions(+), 80 deletions(-) + +commit d862168d6a82edd59547d39f5b0ab8279b1e511c +Author: John (J5) Palmieri +Date: Mon Jul 18 18:28:50 2011 -0400 + + up platform version to 3.0 + + https://bugzilla.gnome.org/show_bug.cgi?id=642048 + + Makefile.am | 2 +- + configure.ac | 4 ++-- + pygobject-2.0-uninstalled.pc.in | 18 ------------------ + pygobject-2.0.pc.in | 22 ---------------------- + pygobject-3.0-uninstalled.pc.in | 18 ++++++++++++++++++ + pygobject-3.0.pc.in | 22 ++++++++++++++++++++++ + 6 files changed, 43 insertions(+), 43 deletions(-) + +commit 5189b360ccddbbaee267ce857968fbf1aafdd07a +Author: Martin Pitt +Date: Thu Aug 11 09:53:15 2011 +0200 + + [gi] Handle GVariants from callback return values + + Callbacks still use GIArgument, add missing GVariant support for + return types. + + gi/pygi-argument.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 18a240cc492d2e5ebe2709a0d7155e27c8ff9e63 +Author: Martin Pitt +Date: Wed Aug 10 14:11:10 2011 +0200 + + Handle GVariants for callback arguments + + Callbacks still use GIArgument, add missing GVariant support. This + is the + equivalent of what commit 9d5604220bd56 did for pygi_marshall_*(). + + gi/pygi-argument.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit aa820d6ce2fee83e61e3e9de7c6b7d2452e2847d +Author: Laszlo Pandy +Date: Mon Aug 8 01:58:10 2011 +0200 + + [gi] Fix crash: check return value of + _invoke_state_init_from_callable_cache() before continuing. + + gi/pygi-invoke.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit eaad9f3c71cedfe28ff2d2bb05ea6c64e323715f +Author: Laszlo Pandy +Date: Fri Aug 5 21:03:33 2011 +0200 + + [gi] Pass gtype as first parameter to vfuncs (instead of using + kwargs). + + gi/pygi-invoke.c | 32 ++++++++++++++++++-------------- + gi/types.py | 2 +- + 2 files changed, 19 insertions(+), 15 deletions(-) + +commit 76edfd0d5776f61c92c84fd9fb8dcc246c580e93 +Author: John (J5) Palmieri +Date: Mon Jul 18 18:21:51 2011 -0400 + + remove codegen + + Makefile.am | 2 +- + codegen/Makefile.am | 33 - + codegen/README.defs | 351 -------- + codegen/__init__.py | 16 - + codegen/argtypes.py | 1043 ----------------------- + codegen/code-coverage.py | 44 - + codegen/codegen.py | 1722 + -------------------------------------- + codegen/createdefs.py | 17 - + codegen/definitions.py | 575 ------------- + codegen/defsconvert.py | 132 --- + codegen/defsgen.py | 737 ---------------- + codegen/defsparser.py | 153 ---- + codegen/docextract.py | 461 ---------- + codegen/docextract_to_xml.py | 142 ---- + codegen/docgen.py | 766 ----------------- + codegen/h2def.py | 631 -------------- + codegen/mergedefs.py | 26 - + codegen/missingdefs.py | 17 - + codegen/mkskel.py | 89 -- + codegen/override.py | 285 ------- + codegen/pygobject-codegen-2.0.in | 11 - + codegen/reversewrapper.py | 912 -------------------- + codegen/scanvirtuals.py | 54 -- + codegen/scmexpr.py | 143 ---- + configure.ac | 5 - + pygobject-2.0-uninstalled.pc.in | 1 - + pygobject-2.0.pc.in | 1 - + 27 files changed, 1 insertions(+), 8368 deletions(-) + +commit bf284c7c47c3e52ab4d8700327a170903e9ebad2 +Author: John (J5) Palmieri +Date: Mon Jul 18 11:04:58 2011 -0400 + + remove some left over ifdefs to complete merge of the invoke-rewrite + branch + + gi/pygi-cache.h | 2 -- + gi/pygi-info.c | 2 -- + gi/pygi-private.h | 5 +---- + gi/pygi.h | 2 -- + 4 files changed, 1 insertions(+), 10 deletions(-) + +commit 8c653ec3033fab47c4bb4071b5732a349357141f +Author: John (J5) Palmieri +Date: Mon Jul 18 10:59:45 2011 -0400 + + rename pygi-invoke-ng to pygi-invoke + + gi/Makefile.am | 3 +- + gi/pygi-invoke-ng.c | 464 + --------------------------------------------------- + gi/pygi-invoke.c | 464 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 466 insertions(+), 465 deletions(-) + +commit 62d59fa2c2b31d7a3cac8996d58234d4b13bb19f +Author: John (J5) Palmieri +Date: Mon Jul 18 10:56:36 2011 -0400 + + make invoke-ng the only invoker + + configure.ac | 11 - + gi/Makefile.am | 10 +- + gi/pygi-invoke.c | 1030 + ------------------------------------------------------ + 3 files changed, 1 insertions(+), 1050 deletions(-) + +commit 2937cfe5bb7122dd3783c7919294d6a34a3dfc05 +Merge: 519e556 917ea2d +Author: John (J5) Palmieri +Date: Mon Jul 18 10:45:18 2011 -0400 + + Merge branch 'master' into invoke-rewrite + +commit 519e556dc1e5874e1668bad93043fb9258c7ee79 +Merge: bab7e88 38cca3c +Author: John (J5) Palmieri +Date: Mon Jul 18 10:37:20 2011 -0400 + + Merge branch 'master' into invoke-rewrite + +commit bab7e88251bffcd360186c6dedc26be8eb077084 +Author: John (J5) Palmieri +Date: Mon Jul 18 10:35:10 2011 -0400 + + split the marshalling routines into two source files + + * update copy and paste copyright info to list the correct owner + + gi/Makefile.am | 6 +- + gi/pygi-cache.c | 3 +- + gi/pygi-marshal-in.c | 1412 ++++++++++++++++++++++++++++++++ + gi/pygi-marshal-in.h | 186 +++++ + gi/pygi-marshal-out.c | 767 ++++++++++++++++++ + gi/pygi-marshal-out.h | 144 ++++ + gi/pygi-marshal.c | 2145 + ------------------------------------------------- + gi/pygi-marshal.h | 303 ------- + 8 files changed, 2515 insertions(+), 2451 deletions(-) + +commit 917ea2dfa2d097e563233145003a66b3e4423287 +Author: Martin Pitt +Date: Thu Jul 14 11:21:10 2011 +0200 + + Ship tests/te_ST@nouppera in release tarballs for tests to succeed + + tests/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e024e832ab9c82d3e299cc6e1cb427de44f2d16e +Author: John (J5) Palmieri +Date: Wed Jul 13 15:43:02 2011 -0400 + + [invoke] break out caller_allocates allocating into its own function + + gi/pygi-invoke-ng.c | 78 + ++++++++++++++++++++++++++++++++------------------- + 1 files changed, 49 insertions(+), 29 deletions(-) + +commit fc8b8ce768ac780f7ed9edc63b70dd35194153c0 +Author: John (J5) Palmieri +Date: Wed Jul 13 15:42:26 2011 -0400 + + [invoke] missed a bit when removing constructor_class usage + + gi/pygi-invoke-ng.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c94bcf4ae7e36f90c356c89712b00609f9f849bd +Author: John (J5) Palmieri +Date: Wed Jul 13 15:16:17 2011 -0400 + + [invoke] don't hold on to the constructor class, just add a TODO + + gi/pygi-invoke-ng.c | 11 +++++------ + gi/pygi-invoke-state-struct.h | 1 - + 2 files changed, 5 insertions(+), 7 deletions(-) + +commit c11d3195f324ea41e86e3da7ff99b55425c2faec +Author: Martin Pitt +Date: Wed Jul 13 10:40:25 2011 +0200 + + [gi] Port test_properties from static gio to GI Gio + + As we ripped out the static gio bindings a while ago, this test case + was using + the system installed gio bindings with Python 2, and now fails + completely with + Python 3. Rewrite it to use gi.repository.Gio. + + tests/test_properties.py | 38 +++++++++++++++++++------------------- + 1 files changed, 19 insertions(+), 19 deletions(-) + +commit 8f89ff24fcac627ce15ca93038711fded1a7c5ed +Author: Martin Pitt +Date: Wed Jul 13 08:42:22 2011 +0200 + + [python3] Fix maketrans import + + Python3 moved the maketrans() function from the string module to a + str method. + This unbreaks gi/module.py for Python 3 again. + + gi/module.py | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +commit 20aea4b052126fa0bface3e6e0dccfd77f9505b1 +Author: John (J5) Palmieri +Date: Fri Jul 8 14:39:22 2011 -0400 + + [caching] remove all inline compiler flags + + gi/pygi-cache.c | 96 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 48 insertions(+), 48 deletions(-) + +commit bf7bb79b66ad406063fb443e7452d830c55986ef +Author: John (J5) Palmieri +Date: Fri Jul 8 14:35:20 2011 -0400 + + [caching] refactor function names to be less confusing + + gi/pygi-cache.c | 307 + +++++++++++++++++++++++++++---------------------------- + 1 files changed, 150 insertions(+), 157 deletions(-) + +commit c167a9345b01c070bd5a84b4a4b3a53baf9e217d +Author: John (J5) Palmieri +Date: Fri Jul 8 11:24:09 2011 -0400 + + [overrides] deprecate the use of type keyword MessageDialog + constructor + + * pygtk used type to determine the "type" of message dialog to + display but we + use the proper property name "message_type" since we should not be + overriding a reserved word + * to keep compat with pygtk we check the kwds hash for the key + 'type' and + assign it to message_type while throwing a deprecation warning + * also add a deprication warning when trying to use the depricated + NO_SEPARATOR + flag + + gi/overrides/Gtk.py | 13 ++++++++----- + 1 files changed, 8 insertions(+), 5 deletions(-) + +commit 367e4ededd4a45125157050bcc9e4e685fd4a82d +Author: Martin Pitt +Date: Fri Jul 8 10:15:53 2011 +0200 + + gdbus tests: Fix hang if test case fails + + In the TestGDBusClient.test_native_calls_async() test case, the main + loop was + never quit when the call failed. + + tests/test_gdbus.py | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 11b578400cbf9f7c270b662a5e8953ccd466e5ef +Author: John (J5) Palmieri +Date: Thu Jul 7 19:30:11 2011 -0400 + + use an enum instead of booleans to denote function type + + gi/pygi-cache.c | 85 + +++++++++++++++++++++++++++++--------------------- + gi/pygi-cache.h | 18 ++++++++-- + gi/pygi-invoke-ng.c | 8 ++-- + 3 files changed, 67 insertions(+), 44 deletions(-) + +commit 10e31005baec26f61c0f8fca2b5c0337b0be6c70 +Author: John (J5) Palmieri +Date: Thu Jul 7 15:18:03 2011 -0400 + + rename aux arguments to child arguments to make their purpose clearer + + gi/pygi-cache.c | 64 + +++++++++++++++++++++++++------------------------- + gi/pygi-cache.h | 29 ++++++++++++++++------- + gi/pygi-invoke-ng.c | 10 ++++---- + gi/pygi-marshal.c | 12 ++++---- + 4 files changed, 63 insertions(+), 52 deletions(-) + +commit b4ad91c40f713ebdc278ce40b011e4adf9ddbbd7 +Author: Timo Vanwynsberghe +Date: Thu Jul 7 10:59:08 2011 +0200 + + Fixed the cairo example + + https://bugzilla.gnome.org/show_bug.cgi?id=653844 + + examples/cairo-demo.py | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +commit a606bab1ddc605167f2e9dc7c46c8f929fdce23b +Author: Adam Dingle +Date: Tue Jul 5 14:28:20 2011 -0700 + + Add override binding for Gtk.ListStore.prepend(). + + https://bugzilla.gnome.org/show_bug.cgi?id=654056 + + gi/overrides/Gtk.py | 8 ++++++++ + tests/test_overrides.py | 13 ++++++++++++- + 2 files changed, 20 insertions(+), 1 deletions(-) + +commit fc5c869486c7f6929e285ea7a86623ec41ecd9bd +Author: Martin Pitt +Date: Thu Jul 7 13:39:19 2011 +0200 + + Fix crash in Gtk.TextIter overrides + + With commit 17cd0fb3 Gtk.TextIter.{forward,backward}_search() + returns undefined + pointers when the search was unsuccessful. Actually check the + "success" return + value; if it is False return None, just like PyGTK used to. + + Thanks to Michael Vogt for discovering this and writing the test case! + + Test case: + + -------------- 8< ----------------- + from gi.repository import Gtk + + win = Gtk.Window.new(Gtk.WindowType.TOPLEVEL) + textview = Gtk.TextView() + buffer = textview.get_buffer() + buffer.set_text("hello world") + win.add(textview) + + win.show_all() + + iter = buffer.get_start_iter() + end = buffer.get_end_iter() + ret = iter.forward_search("foo", + Gtk.TextSearchFlags.VISIBLE_ONLY, + end) + print "this is my return value" + print ret + print "now I crash" + print ret[0].get_offset() + + Gtk.main() + -------------- 8< ----------------- + + gi/overrides/Gtk.py | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit 5c04fc5b2ca7e262c052426d5863d69d0c4a24da +Author: John (J5) Palmieri +Date: Tue Jul 5 15:57:23 2011 -0400 + + use gssize instead of int for arg indexes + + gi/pygi-cache.c | 24 ++++++++++++------------ + gi/pygi-cache.h | 6 +++--- + gi/pygi-invoke-ng.c | 6 +++--- + gi/pygi-marshal-cleanup.c | 6 +++--- + 4 files changed, 21 insertions(+), 21 deletions(-) + +commit ecc09749c34cd4eabf47cc722d768b042dc0be9f +Author: John (J5) Palmieri +Date: Tue Jul 5 14:17:30 2011 -0400 + + [cache] remove refrence to default value as it is not implemented yet + + gi/pygi-cache.h | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 433e0fb259047d8c81e5949a31abb5e0feefd27b +Author: Sebastian Pölsterl +Date: Thu May 12 18:53:06 2011 +0200 + + Handle arguments that are flags correctly + + https://bugzilla.gnome.org/show_bug.cgi?id=647581 + + gi/pygi-argument.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 38cca3c14e79fbc383e3fc65a120bee03714b99f +Author: John (J5) Palmieri +Date: Fri Jul 1 05:19:15 2011 -0400 + + correctly initialize the _gi_cairo_functions array to be zero filled + + gi/pygi-foreign-cairo.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9ae43fdbcc547eb1e3c61bf9545da40555b2e2c6 +Author: John (J5) Palmieri +Date: Fri Jul 1 05:19:15 2011 -0400 + + correctly initialize the _gi_cairo_functions array to be zero filled + + gi/pygi-foreign-cairo.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d3ee40b36b1718e6fb4544dbe07e291138ea1eb9 +Author: John (J5) Palmieri +Date: Wed Jun 29 18:14:40 2011 -0400 + + pass in the address of the gerror, not the gerror itself + + gi/pygi-argument.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 49dc98eb9339ea64355cd752ca000c79da56f3a2 +Author: John (J5) Palmieri +Date: Wed Jun 29 18:01:44 2011 -0400 + + [gi] handle marshalling gerrors arguments for signals + + gi/pygi-argument.c | 18 ++++++++++++++++-- + 1 files changed, 16 insertions(+), 2 deletions(-) + +commit db9419fcef628e9ffee10591156007ea9c0bc1f0 +Author: John (J5) Palmieri +Date: Wed Jun 29 12:12:29 2011 -0400 + + [gi-invoke-ng] fix NULL check to check before we access the cache + struct + + gi/pygi-cache.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 9027e1a20fd06df5c26edcec1893ef0814ec938a +Author: John (J5) Palmieri +Date: Tue Jun 28 18:21:55 2011 -0400 + + [gi-tests] add test for PyGObject->PyObject TreeModel storage + + * make sure we can store a custom GObject as a PyObject inside of + a TreeModel + + tests/test_overrides.py | 26 +++++++++++++++----------- + 1 files changed, 15 insertions(+), 11 deletions(-) + +commit b6842e4b2a28733e143d4022864041ca82e91f7a +Author: John (J5) Palmieri +Date: Tue Jun 28 18:13:38 2011 -0400 + + [gtk-overrides] special case TreeModel columns of PYGOBJECT types + + * box the PYGOBJECT in a GValue so we can store PyGObjects in a + TreeModel row + + gi/overrides/Gtk.py | 7 ++++--- + gobject/pygtype.c | 7 ++++--- + 2 files changed, 8 insertions(+), 6 deletions(-) + +commit 7fc9d45860210fd9d333fd3769c6cf93a6a20eb6 +Author: John (J5) Palmieri +Date: Tue Jun 28 17:32:29 2011 -0400 + + [gi-invoke-ng] copy structs when transfer is full for array + + gi/pygi-marshal.c | 21 ++++++++++++++++++--- + 1 files changed, 18 insertions(+), 3 deletions(-) + +commit 8d60c0bc7b327aa757a8727f1146f02cc0b78af8 +Author: John (J5) Palmieri +Date: Tue Jun 28 13:54:48 2011 -0400 + + [gtk-override] print warning if user imports Gtk 2.0 + + * this is needed because people file bugs not realizing they are + importing 2.0 + which is not supported + + gi/overrides/Gtk.py | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit 7c589c0c1de1a786e00685afd5292b6fb1f93ed3 +Author: John (J5) Palmieri +Date: Tue Jun 28 13:08:49 2011 -0400 + + [gtk-overrides] allow the message_type keyword to be used for + MessageDialogs + + * for pygtk compat we use the type keyword for message type but + we prefer + the use of message_type because it is more descriptive and does + not clash + with a python reserved word + * if you passed message_type into a MessageDialog constructor you + would get + an error because we also convert type to message_type when + calling the + parent constructor + * this patch looks to see if message_type was passed in as a + keyword and + assigns it to type while removing message_type from the keywords + dict + to avoid name clashing + + gi/overrides/Gtk.py | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 2aa12267bee91aa696633a0cea2a0accae09250a +Author: Johan Dahlin +Date: Mon Jun 27 10:56:20 2011 -0300 + + Add support for enums in gobject.property + + https://bugzilla.gnome.org/show_bug.cgi?id=653488 + + gobject/propertyhelper.py | 23 ++++++++++++++++------- + tests/test_properties.py | 40 ++++++++++++++++++++++++++++++++++++---- + 2 files changed, 52 insertions(+), 11 deletions(-) + +commit dc62e67b447ef526a6f2d1aa8648ad101d95024b +Author: Johan Dahlin +Date: Mon Jun 27 10:56:20 2011 -0300 + + Add support for enums in gobject.property + + https://bugzilla.gnome.org/show_bug.cgi?id=653488 + + gobject/propertyhelper.py | 23 ++++++++++++++++------- + tests/test_properties.py | 40 ++++++++++++++++++++++++++++++++++++---- + 2 files changed, 52 insertions(+), 11 deletions(-) + +commit 50cfccb5801c1b9a0a42ffe2826cd245f21fd88d +Author: John (J5) Palmieri +Date: Fri Jun 24 14:17:24 2011 -0400 + + [gi-invoke-ng] use g_slice for allocating GValues that are caller + allocated + + gi/pygi-invoke-ng.c | 2 ++ + gi/pygi-marshal-cleanup.c | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +commit eff65cd2ce490296865441c3c78b7846f380459c +Author: John (J5) Palmieri +Date: Fri Jun 24 11:49:05 2011 -0400 + + [gi-invoke-ng] Convert Overflow errors to ValueErrors when marshalling + integers + + gi/pygi-marshal.c | 56 + +++++++++++++++++++++++++++++++++++++++++----------- + 1 files changed, 44 insertions(+), 12 deletions(-) + +commit 05ed688d54e3ff04e961b60d0b5d3ed0b97c771d +Author: John (J5) Palmieri +Date: Wed Jun 22 12:26:39 2011 -0400 + + [gi-invoke-ng] only cache caller allocates for interfaces as some + API are broken + + gi/pygi-cache.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 4fd957a5de364c0588168dee15e1e61d4f12e173 +Author: John (J5) Palmieri +Date: Fri Jun 17 17:07:56 2011 -0400 + + [gi-invoke-ng] handle in pointer array marshalling + + gi/pygi-marshal.c | 28 ++++++++++++++++++++++------ + 1 files changed, 22 insertions(+), 6 deletions(-) + +commit df3911ad2ce83af9bf9679ed1b221847b23ba2de +Author: Alex Eftimie +Date: Fri Jun 10 08:44:04 2011 +0300 + + Adding GPtrArray tests + + tests/test_gi.py | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 42 insertions(+), 1 deletions(-) + +commit e32c2be53175014399d89e1e85c9afc6e53c94be +Author: John (J5) Palmieri +Date: Fri Jun 17 11:32:28 2011 -0400 + + [gi-invoke-ng] fix array element offset calculations + + * use pointer arithmetic to calculate based on element size instead of + relying on the size of GIArgument + * special case GPtrArrays + + gi/pygi-marshal.c | 27 +++++++++------------------ + 1 files changed, 9 insertions(+), 18 deletions(-) + +commit 6e8dc28cb261cafbfed40fc0797a0dd5f91f497b +Author: John (J5) Palmieri +Date: Wed Jun 15 12:46:03 2011 -0400 + + [gi] don't clean up arguments that weren't yet processed during in + arg failure + + gi/pygi-marshal-cleanup.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit af7c93ea98b7f492eef265e58c8b3c878805524f +Author: John (J5) Palmieri +Date: Wed Jun 15 12:06:47 2011 -0400 + + [gi-overrides] use new instead of init when constructing a + GLib.VariantBuilder + + * init is now skipped in the gir + + gi/overrides/GLib.py | 18 ++++++++---------- + tests/test_overrides.py | 6 ++---- + 2 files changed, 10 insertions(+), 14 deletions(-) + +commit c6112307f29f9a850e6e9efa5f55d5d4a363c6b0 +Author: John (J5) Palmieri +Date: Wed Jun 15 11:42:45 2011 -0400 + + [gi-invoke-ng] actual code to import overrides + + gi/pygi-cache.c | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) + +commit 902575d857beffb14e56821ea8a52f705385f6bb +Author: John (J5) Palmieri +Date: Wed Jun 15 11:25:10 2011 -0400 + + [gi-invoke-ng] import pytypes so we get overrides + + gi/pygi-marshal.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 9d5604220bd56ae2708e9b74122c14208e0a30b4 +Author: John (J5) Palmieri +Date: Tue Jun 14 16:13:37 2011 -0400 + + [gi-invoke-ng] handle gvariants now that they are not foreign + + gi/pygi-marshal.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit c1f5651062687e800a52b5d8d16c88c0acde2934 +Author: John (J5) Palmieri +Date: Tue Jun 14 16:12:43 2011 -0400 + + [gi-invoke-ng] do not try to clean up NULL arguments + + gi/pygi-marshal-cleanup.c | 24 ++++++++++++++++-------- + 1 files changed, 16 insertions(+), 8 deletions(-) + +commit fbf5382fbc1aed49ed491d2255d616a1643a45fc +Merge: 499b68d 1491f62 +Author: John (J5) Palmieri +Date: Mon Jun 13 17:28:23 2011 -0400 + + Merge branch 'master' into invoke-rewrite + +commit 499b68d6c9040cffc6e43dc87789d68446564a92 +Merge: 4c9bced 426c710 +Author: John (J5) Palmieri +Date: Mon Jun 13 17:26:37 2011 -0400 + + Merge branch 'master' into invoke-rewrite + +commit 1491f6225b9906bd369b5a42e6369ab6884736b7 +Author: Ignacio Casal Quinteiro +Date: Fri Jun 10 14:01:32 2011 +0200 + + closure: avoid double free crash + + gi/pygi-closure.c | 12 ++++-------- + 1 files changed, 4 insertions(+), 8 deletions(-) + +commit 929f4236f2b8601e7960a4a7b0a860d976ad83c6 +Author: Jason Siefken +Date: Fri Jun 3 23:11:17 2011 -0700 + + Added __eq__ method for Gdk.Color and Gdk.RGBA + + Call Gdk.Color.equal and Gdk.RGBA.equal when + == equality testing is used. + + gi/overrides/Gdk.py | 6 ++++++ + tests/test_overrides.py | 4 ++++ + 2 files changed, 10 insertions(+), 0 deletions(-) + +commit dff5961ba229c7c34bd7b0a18a446b56bbe39e3a Author: Ignacio Casal Quinteiro -Date: Fri Jun 10 14:01:32 2011 +0200 +Date: Wed Jun 8 19:13:48 2011 +0200 + + closure: Check the out arg is not null. Fixes bug #651812 + + gi/pygi-closure.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit d7d178206bfbb0858556fcfd6c9ca8eefda3fdf5 +Author: Tomeu Vizoso +Date: Wed Jun 8 09:47:20 2011 +0200 + + Use constants instead of literals + + tests/test_overrides.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit fe386a0ad548a23e30e9cb947bfa2198fb48ef29 +Author: Tomeu Vizoso +Date: Mon Jun 6 19:07:22 2011 +0200 + + GVariant has now a GType, take that into account + + https://bugzilla.gnome.org/show_bug.cgi?id=647509 + + gi/pygi-argument.c | 8 ++++---- + gi/pygi-invoke.c | 20 +++++++++++++------- + 2 files changed, 17 insertions(+), 11 deletions(-) + +commit bd7b8d96a7420522c1fdc127ef8cfb7d6e8a1b31 +Author: Tomeu Vizoso +Date: Mon Jun 6 19:05:07 2011 +0200 + + GVariantType is a boxed struct + + https://bugzilla.gnome.org/show_bug.cgi?id=647509 + + gi/gimodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2d73012e5dbcc45a5782a6c119dfb272c14b5a61 +Author: Tomeu Vizoso +Date: Mon Jun 6 17:38:21 2011 +0200 + + Use _gi.Struct to wrap fundamentals + + https://bugzilla.gnome.org/show_bug.cgi?id=647509 + + gi/module.py | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit d82e6c8d1d9f2fc48fdcc15b7d2a97e4f24cf3bf +Author: Tomeu Vizoso +Date: Mon Jun 6 17:24:28 2011 +0200 + + Merge gi/HACKING into /HACKING + + HACKING | 16 ++++++++++++++++ + gi/HACKING | 26 -------------------------- + 2 files changed, 16 insertions(+), 26 deletions(-) + +commit 92aca4416a7930e5870b8d1a4016bae8140462ee +Author: Daniel Drake +Date: Fri Jun 3 16:59:15 2011 +0100 + + Fix GC-related crash during PyGObject deallocation + + Python-2.7.1's GC source has the following comment: + + /* Python's cyclic gc should never see an incoming refcount + * of 0: if something decref'ed to 0, it should have been + * deallocated immediately at that time. + * Possible cause (if the assert triggers): a tp_dealloc + * routine left a gc-aware object tracked during its teardown + * phase, and did something-- or allowed something to + happen -- + * that called back into Python. gc can trigger then, and may + * see the still-tracked dying object. Before this assert + * was added, such mistakes went on to allow gc to try to + * delete the object again. In a debug build, that caused + * a mysterious segfault, when _Py_ForgetReference tried + * to remove the object from the doubly-linked list of all + * objects a second time. In a release build, an actual + * double deallocation occurred, which leads to corruption + * of the allocator's internal bookkeeping pointers. That's + * so serious that maybe this should be a release-build + * check instead of an assert? + */ + + As shown in a backtrace at + https://bugzilla.redhat.com/show_bug.cgi?id=640972 , pygobject + is making + this exact mistake. Before untracking its object, pygobject_dealloc + calls PyObject_ClearWeakRefs() which can call back into python, create + new allocations, and trigger the GC. + + This is causing Sugar (based on pygobject2 + pygtk2 static bindings) + to + crash on a regular basis while interacting with widgets or launching + applications. + + Fix this by untracking the object early. Also fix the same issue + spotted + in the GSource wrapper. + + Thanks to Bernie Innocenti for initial diagnosis. + + glib/pygsource.c | 6 ++++-- + gobject/pygobject.c | 8 +++++++- + 2 files changed, 11 insertions(+), 3 deletions(-) + +commit 4c9bcedb4e11ad66a4b86174e2425c7afcafc473 +Author: John (J5) Palmieri +Date: Tue May 31 16:59:41 2011 -0400 + + [gi-invoke-ng] enable invoke-ng by default + + configure.ac | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 2e4cfb85a55ff205e263591d573ee5ecf0ffff3e +Author: John (J5) Palmieri +Date: Tue May 31 16:37:21 2011 -0400 + + [gi-invoke-ng] add code to clean up when input values fail to marshal + + gi/pygi-marshal-cleanup.c | 30 +++++++++++++++++++++++++----- + 1 files changed, 25 insertions(+), 5 deletions(-) + +commit 508b1b6ca1b143f1e123a3ddb83e8ce146758dfc +Author: John (J5) Palmieri +Date: Tue May 31 16:01:03 2011 -0400 + + [gi-invoke-ng] add hash cleanup routines + + gi/pygi-cache.c | 2 + + gi/pygi-marshal-cleanup.c | 64 + +++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-marshal-cleanup.h | 10 +++++- + 3 files changed, 74 insertions(+), 2 deletions(-) + +commit 1954c75b94a74259b4e5d28f5ff8d76aa4610832 +Author: John (J5) Palmieri +Date: Tue May 31 14:47:30 2011 -0400 + + [gi-invoke-ng] handle arrays with transfers of GI_TRANSFER_CONTAINER + + gi/pygi-marshal-cleanup.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit b626c46b4a95602c7bf1278c2a39aacb7f5027d9 +Author: John (J5) Palmieri +Date: Tue May 31 14:40:49 2011 -0400 + + [gi-invoke-ng] add list cleanup routines + + gi/pygi-cache.c | 8 ++-- + gi/pygi-marshal-cleanup.c | 84 + +++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-marshal-cleanup.h | 8 ++++ + 3 files changed, 96 insertions(+), 4 deletions(-) + +commit 2e542c327cd52c1f77af28905557dd25c64175d8 +Author: John (J5) Palmieri +Date: Thu May 26 16:10:13 2011 -0400 + + indentation fix + + gi/pygi-marshal.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 601aec11c49e821fe97dd30a2187fe3c75844712 +Author: John (J5) Palmieri +Date: Thu May 26 16:09:38 2011 -0400 + + [gi-invoke-ng] add out array cleanup + + gi/pygi-cache.c | 2 +- + gi/pygi-marshal-cleanup.c | 24 ++++++++++++++++++++++++ + gi/pygi-marshal.c | 37 +++++++++++++++++++++++++++++++------ + 3 files changed, 56 insertions(+), 7 deletions(-) + +commit e9ad4428b769f8c9ace1cdc973c684de84fb1a5e +Author: John (J5) Palmieri +Date: Thu May 26 13:22:38 2011 -0400 + + [gi-invoke-ng] do not allocate null terminator for garray + + * We are simply setting our own array so we don't want any allocate + null byte + + gi/pygi-marshal.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a986b2b8e5ee37f2a330f5aabc85c73ebb0de508 +Author: John (J5) Palmieri +Date: Thu May 26 13:21:55 2011 -0400 + + [gi-invoke-ng] add array cleanup for in arrays + + gi/pygi-cache.c | 2 +- + gi/pygi-marshal-cleanup.c | 72 + ++++++++++++++++++++++++++++++++++++++++++++- + gi/pygi-marshal-cleanup.h | 9 +++++ + gi/pygi-marshal.c | 13 ++++++-- + 4 files changed, 91 insertions(+), 5 deletions(-) + +commit 990c60805c8ef718eb29e2e1b24f057552c6159e +Author: John (J5) Palmieri +Date: Mon May 23 17:06:30 2011 -0400 + + [gi-invoke-ng] remove remaining bits of the invoke stage state machine + + gi/pygi-invoke-ng.c | 7 +------ + gi/pygi-invoke-state-struct.h | 14 -------------- + 2 files changed, 1 insertions(+), 20 deletions(-) + +commit dbbcf4a0e76fb572d85843ee31c3798df5cd5cc5 +Author: John (J5) Palmieri +Date: Mon May 23 16:59:57 2011 -0400 + + [gi-invoke-ng] revamp cleanup framework to be orthogonal to cache + setup + + * cleanup now has symmetry with setup so there are now in and out + cleanups + for each type that needs to be cleaned up + * no longer use state machine but instead call different cleanup + functions at + different stages of invoke, making it easier to understand what + happens at + each stage + + gi/pygi-cache.c | 19 ++- + gi/pygi-cache.h | 7 +- + gi/pygi-invoke-ng.c | 10 +-- + gi/pygi-invoke-state-struct.h | 2 + + gi/pygi-marshal-cleanup.c | 301 + ++++++++++++++++------------------------- + gi/pygi-marshal-cleanup.h | 45 ++++--- + gi/pygi-marshal.c | 15 +- + 7 files changed, 174 insertions(+), 225 deletions(-) + +commit 198714dc4585f7463f38929f1ca4e4b60a27dadb +Author: John (J5) Palmieri +Date: Thu May 12 17:29:20 2011 -0400 + + [gi-invoke-ng] stub out a cleaner way of cleaning up after ourselves + + * The state machine concept of cleaning up was getting a bit messy. + It was like we took a big bowl of spaghetti code and dumped it. + * Now we call specific cleanup functions at the point of failure (or + successful completion of a marshalling stage) + + gi/pygi-invoke-ng.c | 59 ++++++++++++++++++++++++++++++------ + gi/pygi-marshal-cleanup.c | 72 + +++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-marshal-cleanup.h | 14 +++++++++ + 3 files changed, 135 insertions(+), 10 deletions(-) + +commit c1389dadbf35afee3f28d90ef637efd8c1f071a5 +Author: José Alburquerque +Date: Thu May 12 11:53:40 2011 -0400 + + Doc Extractor: Correct the logic of the --no-since option. + + * codegen/docextract.py (process_final_sections): If the + --no-since + option has been specified and a "Since:" is encountered during the + processing of the final sections, simply don't append the + "Since: ..." + instead of reading the next line. This preserves the logical + flow of + processing. + + codegen/docextract.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 303d8e8ab9e60cb554de7fc0e8592cd9b2c50843 +Author: José Alburquerque +Date: Mon May 9 17:32:09 2011 -0400 + + Doc Extractor: Add a --no-since option. + + * codegen/docextract.py: + * codegen/docextract_to_xml.py: Modified so that if a --no-since + option is specified at the command line, the "Since: ..." portion + of + the gtkdoc function block is omitted. This is useful for C++ + modules + such as gstreamermm where this information would not be useful + as long + as the C API is still unstable. + + codegen/docextract.py | 15 ++++++++++++++- + codegen/docextract_to_xml.py | 9 ++++++--- + 2 files changed, 20 insertions(+), 4 deletions(-) + +commit 4f615c6e300d6f2d7551b640efa301060206ab58 +Author: John (J5) Palmieri +Date: Thu May 5 14:04:34 2011 -0400 + + [gi-invoke-ng] tweek cleanup routines + + gi/pygi-cache.c | 5 +++ + gi/pygi-marshal-cleanup.c | 87 + ++++++++++++++++++++++++++++++++++----------- + gi/pygi-marshal-cleanup.h | 6 ++-- + gi/pygi-marshal.c | 11 +----- + 4 files changed, 76 insertions(+), 33 deletions(-) + +commit 63c7f17c224821cb7136d06e8ef87eab7291848d +Author: Martin Pitt +Date: Mon May 2 15:49:52 2011 +0200 + + Fix symbol names to be locale independent + + We currently use upper() to present enum values, which are usually + defined in + lower case in the typelib, in upper cases. However, upper() is locale + dependent, so that e. g. in tr_TR.UTF-8, "invalid" becomes "iNVALiD" + because Turkish has some extra variants of "i". + + Use a local ASCII-only translate() call instead to avoid this. Thanks + to Nils + Philippsen for the idea! + + This also adds a test locale "te_ST@nouppera" which defines + toupper('a') == 'a'. + Run the Enum tests under this locale to reproduce the bug and verify + the fix. + + https://bugzilla.gnome.org/show_bug.cgi?id=649165 + + gi/module.py | 9 ++++++++- + tests/te_ST@nouppera | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_gi.py | 30 ++++++++++++++++++++++++++++++ + 3 files changed, 88 insertions(+), 1 deletions(-) + +commit b5e150da76c3d4de1a75f58d03c3a761e9005a63 +Author: Martin Pitt +Date: Wed May 4 08:35:27 2011 +0200 + + [gi] pygi-convert.sh: Convert gtk.gdk.CROSSHAIR + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit fcc5ea201ab25da6db94ea8a37364a1d3c4d7c65 +Author: John (J5) Palmieri +Date: Fri Apr 29 17:41:08 2011 -0400 - closure: avoid double free crash + [gi-invoke-ng] handle filename cleanup with the utf8 cleanup function - gi/pygi-closure.c | 12 ++++-------- - 1 files changed, 4 insertions(+), 8 deletions(-) + gi/pygi-cache.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) -commit 78366697d8f7fc53f20d9f52f9f39552c5e99bd1 +commit dbe8c4fabc8ac19415a3be0e854d3a54c2317e0b Author: John (J5) Palmieri -Date: Fri Jun 10 16:48:28 2011 -0400 +Date: Fri Apr 29 17:40:13 2011 -0400 - [gi] backport of "GVariant has a GType" fe386a + [gi-invoke-ng] handle caller allocates cleanup - * backport the switch to using GIInterfaceInfo instead of GITypeInfo - for foreign types to support this patch - 01596a + gi/pygi-invoke-ng.c | 5 +- + gi/pygi-marshal-cleanup.c | 104 + ++++++++++++++++++++++++++++++++++++--------- + gi/pygi-marshal-cleanup.h | 7 ++- + 3 files changed, 90 insertions(+), 26 deletions(-) - gi/pygi-argument.c | 10 +++++----- - gi/pygi-foreign-cairo.c | 18 ++++++++++-------- - gi/pygi-foreign-gvariant.c | 15 +++++++-------- - gi/pygi-foreign-gvariant.h | 14 ++++++-------- - gi/pygi-foreign.c | 21 +++++++++------------ - gi/pygi-foreign.h | 16 ++++++++-------- - gi/pygi-invoke.c | 26 ++++++++++++++++---------- - 7 files changed, 61 insertions(+), 59 deletions(-) - -commit 0c348da3d974f63629c44e75067b8056dacc60d3 +commit cdbf57f3b1f041a06cf545a5557424f701ed1ec7 Author: John (J5) Palmieri -Date: Fri Jun 10 16:46:20 2011 -0400 +Date: Thu Apr 28 19:16:02 2011 -0400 - [gi] fixes to backport commit 6b5a65 - in older glib GVariants are - still structs + [gi-invoke-ng] refactor the cleanup code and add utf8 cleanup as + initial test - gi/gimodule.c | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) + gi/pygi-cache.c | 15 +---------- + gi/pygi-invoke-ng.c | 8 ++---- + gi/pygi-invoke-state-struct.h | 2 + + gi/pygi-marshal-cleanup.c | 51 + ++++++++++++++++++++++++++++++++++++++++- + gi/pygi-marshal-cleanup.h | 3 ++ + 5 files changed, 60 insertions(+), 19 deletions(-) -commit 6b5a656a3b77438c9bbb897c65343634b981c0e5 -Author: Tomeu Vizoso -Date: Mon Jun 6 19:05:07 2011 +0200 +commit d1f1f4ccc55f9ecab73b7c0ee78762c4039b2c79 +Author: John (J5) Palmieri +Date: Wed Apr 27 15:47:19 2011 -0400 - GVariantType is a boxed struct + use PyCapsule when importing pycairo/require pycairo 1.10.0 for + python3 builds - https://bugzilla.gnome.org/show_bug.cgi?id=647509 + * PyCObject is deprecated and pycairo 1.10.0 is first release to + fix this issue - gi/gimodule.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + configure.ac | 15 +++++++++++---- + gi/pygi-foreign-cairo.c | 2 +- + 2 files changed, 12 insertions(+), 5 deletions(-) -commit 3f6bba909486d0ad1a27592fcf09c7ac8744fded -Author: Tomeu Vizoso -Date: Mon Jun 6 17:38:21 2011 +0200 +commit 83b7823a510b0b391560c6deaf9d15d8303c7b14 +Author: Ignacio Casal Quinteiro +Date: Thu Apr 21 16:52:20 2011 +0200 - Use _gi.Struct to wrap fundamentals + [python3] fix build. PYcairo_IMPORT doesn't exists anymore - https://bugzilla.gnome.org/show_bug.cgi?id=647509 + gi/pygi-foreign-cairo.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) - gi/module.py | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) +commit 3e933784df423757e591d703614cb700adb0bbe0 +Author: Sebastian Pölsterl +Date: Mon Apr 18 18:36:25 2011 +0200 -commit b7f5ce021bf16a422dc410b3ff44303e0757dc6e -Author: Jason Siefken -Date: Fri Jun 3 23:11:17 2011 -0700 + Updated DOAP file - Added __eq__ method for Gdk.Color and Gdk.RGBA + pygobject.doap | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) - Call Gdk.Color.equal and Gdk.RGBA.equal when - == equality testing is used. +commit 399d06b4b20685eb38acfd7e43226e06737ab7d2 +Author: Sebastian Pölsterl +Date: Sat Apr 16 16:02:05 2011 +0200 - gi/overrides/Gdk.py | 6 ++++++ - tests/test_overrides.py | 4 ++++ - 2 files changed, 10 insertions(+), 0 deletions(-) + [gi] Don't create variant twice -commit c016c27f545f398f1b57cf31f37392c97d2b5e50 -Author: Ignacio Casal Quinteiro -Date: Wed Jun 8 19:21:23 2011 +0200 + gi/overrides/GLib.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - Remove useless import +commit 8d8a84ea23d28d25851c5870f261c020d762cef4 +Author: Sebastian Pölsterl +Date: Fri Apr 15 16:14:43 2011 +0200 - tests/test_everything.py | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) + pygi-convert.sh: Make sure the uppercase GObject module is imported + instead of the lowercase -commit 1598047c0ddd6a1d04d41e59dd182f3c0524f3c4 -Author: Ignacio Casal Quinteiro -Date: Wed Jun 8 19:18:23 2011 +0200 + https://bugzilla.gnome.org/show_bug.cgi?id=647736 - Revert "[gi] Removed hack to avoid using GLib.Variant.new_variant." + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) - This reverts commit dfe95b9ec598b57deaabd98ab488ab054a44ec09. +commit 3b51d6426d0f59b2dd7e0dcdcded4bed43d6b9d8 +Author: Sebastian Pölsterl +Date: Fri Apr 15 15:58:53 2011 +0200 - gi/overrides/GLib.py | 14 +++++++++++++- - 1 files changed, 13 insertions(+), 1 deletions(-) + [gi] Removed hack to avoid using GLib.Variant.new_variant. -commit ae9e098c14de3d2364c8b16c862aa77570c06a4a -Author: Ignacio Casal Quinteiro -Date: Wed Jun 8 19:13:48 2011 +0200 + The bug in the annotations of GLib is fixed now. + https://bugzilla.gnome.org/show_bug.cgi?id=639952 + https://bugzilla.gnome.org/show_bug.cgi?id=647796 - closure: Check the out arg is not null. Fixes bug #651812 + gi/overrides/GLib.py | 14 +------------- + 1 files changed, 1 insertions(+), 13 deletions(-) - gi/pygi-closure.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) +commit bb4dce14ba666969815d4e56adbc38f0ac4f7ff7 +Author: Sebastian Pölsterl +Date: Fri Apr 15 15:58:31 2011 +0200 -commit eca590a3ff6bbfb78eef7b88d36cee59eb51b1d0 -Author: Daniel Drake -Date: Fri Jun 3 16:59:15 2011 +0100 + [gi] Added additional test case for GVariant handling - Fix GC-related crash during PyGObject deallocation + tests/test_overrides.py | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) - Python-2.7.1's GC source has the following comment: +commit 138df2778543409752e229a09828a805f68a420d +Author: Sebastian Pölsterl +Date: Mon Apr 11 18:34:31 2011 +0200 - /* Python's cyclic gc should never see an incoming refcount - * of 0: if something decref'ed to 0, it should have been - * deallocated immediately at that time. - * Possible cause (if the assert triggers): a tp_dealloc - * routine left a gc-aware object tracked during its teardown - * phase, and did something-- or allowed something to - happen -- - * that called back into Python. gc can trigger then, and may - * see the still-tracked dying object. Before this assert - * was added, such mistakes went on to allow gc to try to - * delete the object again. In a debug build, that caused - * a mysterious segfault, when _Py_ForgetReference tried - * to remove the object from the doubly-linked list of all - * objects a second time. In a release build, an actual - * double deallocation occurred, which leads to corruption - * of the allocator's internal bookkeeping pointers. That's - * so serious that maybe this should be a release-build - * check instead of an assert? - */ + [gi] Added support for GVariant arguments - As shown in a backtrace at - https://bugzilla.redhat.com/show_bug.cgi?id=640972 , pygobject - is making - this exact mistake. Before untracking its object, pygobject_dealloc - calls PyObject_ClearWeakRefs() which can call back into python, create - new allocations, and trigger the GC. + This is required in order for the "g-signal" signal of GDBusProxy + to work properly and thus to properly receive DBus signals with any + type of argument. - This is causing Sugar (based on pygobject2 + pygtk2 static bindings) - to - crash on a regular basis while interacting with widgets or launching - applications. + https://bugzilla.gnome.org/show_bug.cgi?id=647477 - Fix this by untracking the object early. Also fix the same issue - spotted - in the GSource wrapper. + gi/pygi-argument.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) - Thanks to Bernie Innocenti for initial diagnosis. +commit 985f239d891c7697d76ccecb797b189669ae6ee1 +Author: John (J5) Palmieri +Date: Tue Mar 22 18:46:28 2011 -0400 - glib/pygsource.c | 6 ++++-- - gobject/pygobject.c | 8 +++++++- - 2 files changed, 11 insertions(+), 3 deletions(-) + fix static ABI for setting string gvalues from python objects -commit ad96a3f1d187a640ec0a463b766fd5e027f3c16a -Author: Martin Pitt -Date: Mon May 2 15:49:52 2011 +0200 + * the static bindings used to be able to set a string gvalue to + any python + object that implemented __str__, for instance when setting a + treemodel column + * this restores that code while still keeping unicode and python 3 + compatability - Fix symbol names to be locale independent + gobject/pygtype.c | 28 +++++++++++++++++++--------- + tests/test_properties.py | 8 ++++++++ + 2 files changed, 27 insertions(+), 9 deletions(-) - We currently use upper() to present enum values, which are usually - defined in - lower case in the typelib, in upper cases. However, upper() is locale - dependent, so that e. g. in tr_TR.UTF-8, "invalid" becomes "iNVALiD" - because Turkish has some extra variants of "i". +commit 58cfc3cd1152b4448b56a6ff597f954d8450b83e +Author: Dieter Verfaillie +Date: Tue Mar 22 20:47:51 2011 +0100 - Use a local ASCII-only translate() call instead to avoid this. Thanks - to Nils - Philippsen for the idea! + dsextras.py: ensure eol characters are preserved when writing template + files (so \n does not become \r\n) - This also adds a test locale "te_ST@nouppera" which defines - toupper('a') == 'a'. - Run the Enum tests under this locale to reproduce the bug and verify - the fix. + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - https://bugzilla.gnome.org/show_bug.cgi?id=649165 +commit 629d267478982c426ba61a639d5c9603fed856e6 +Author: Dieter Verfaillie +Date: Tue Mar 22 11:35:44 2011 +0100 - gi/module.py | 9 ++++++++- - tests/te_ST@nouppera | 50 - ++++++++++++++++++++++++++++++++++++++++++++++++++ - tests/test_gi.py | 30 ++++++++++++++++++++++++++++++ - 3 files changed, 88 insertions(+), 1 deletions(-) + dsextras.py: remove \r as wel as \n character -commit 90530b52f6eaa30bb704e413c01bb94ee511a0bb -Author: Sebastian Pölsterl -Date: Mon Apr 18 18:36:25 2011 +0200 + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - Updated DOAP file +commit 426c7109d4c0dbf0d56cc075f97f33b3451f79a8 +Author: John (J5) Palmieri +Date: Wed Apr 27 15:47:19 2011 -0400 - pygobject.doap | 15 +++++++++++++++ - 1 files changed, 15 insertions(+), 0 deletions(-) + use PyCapsule when importing pycairo/require pycairo 1.10.0 for + python3 builds -commit 996e5676a00e8d8fc55ef7400d15ccf5a4d904eb -Author: Sebastian Pölsterl -Date: Mon Apr 18 18:16:42 2011 +0200 + * PyCObject is deprecated and pycairo 1.10.0 is first release to + fix this issue - Post release version bump to 2.28.5 + configure.ac | 15 +++++++++++---- + gi/pygi-foreign-cairo.c | 2 +- + 2 files changed, 12 insertions(+), 5 deletions(-) - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +commit 4e5833d0c2fe548617e5ea510f05920fd0caf73b +Author: Ignacio Casal Quinteiro +Date: Thu Apr 21 16:52:20 2011 +0200 -commit afbcc71b71343b5a16dc8873c2ac7b9ca7dd801a + [python3] fix build. PYcairo_IMPORT doesn't exists anymore + + gi/pygi-foreign-cairo.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 91ec337359720839862d3f5a8a0ea98f760a0752 Author: Sebastian Pölsterl -Date: Mon Apr 18 18:06:56 2011 +0200 +Date: Mon Apr 18 18:36:25 2011 +0200 - Release 2.28.4 + Updated DOAP file - NEWS | 11 +++++++++++ - configure.ac | 2 +- - 2 files changed, 12 insertions(+), 1 deletions(-) + pygobject.doap | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) -commit 4643bcad5845f5ec3dd9961616e3ed3b0946001f +commit 05c766044c83340c44564d0097514bfc1d1d9df7 Author: Sebastian Pölsterl -Date: Sat Apr 16 16:02:05 2011 +0200 +Date: Sat Apr 16 16:02:05 2011 +0200 [gi] Don't create variant twice gi/overrides/GLib.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit 0e9e4ec7c28ac4564e15283636adc8b7bc1a83be +commit eb8f212e3687af30407cf01fcdfbf530257bcddb Author: Sebastian Pölsterl -Date: Fri Apr 15 16:14:43 2011 +0200 +Date: Fri Apr 15 16:14:43 2011 +0200 pygi-convert.sh: Make sure the uppercase GObject module is imported instead of the lowercase @@ -227,9 +1780,9 @@ Date: Fri Apr 15 16:14:43 2011 +0200 pygi-convert.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -commit dfe95b9ec598b57deaabd98ab488ab054a44ec09 +commit af31729573de24161ee90563e5738187c749783c Author: Sebastian Pölsterl -Date: Fri Apr 15 15:58:53 2011 +0200 +Date: Fri Apr 15 15:58:53 2011 +0200 [gi] Removed hack to avoid using GLib.Variant.new_variant. @@ -240,18 +1793,51 @@ Date: Fri Apr 15 15:58:53 2011 +0200 gi/overrides/GLib.py | 14 +------------- 1 files changed, 1 insertions(+), 13 deletions(-) -commit cfccd55128377864e3a42a64785637bd453621b2 +commit 070f6688be4afb926656038dcceac4c8b8ed97c7 Author: Sebastian Pölsterl -Date: Fri Apr 15 15:58:31 2011 +0200 +Date: Fri Apr 15 15:58:31 2011 +0200 [gi] Added additional test case for GVariant handling tests/test_overrides.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) -commit 666ec192a4369e2fae508261a7a81b34326fc227 +commit 65aa040e86d94ee6bb227a2bce09668b60208027 +Author: John (J5) Palmieri +Date: Tue Apr 12 14:51:35 2011 -0400 + + [gi-invoke-ng] fix prototype + + gi/pygi-cache.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 12aa4e6376366ca9d758434f6544c9c70a1e5df8 +Author: John (J5) Palmieri +Date: Tue Apr 12 14:48:16 2011 -0400 + + [gi-invoke-ng] create new framework for cleaning up args + + * we now have a state machine so we know what point in the marshalling + process + we are and which args need to be cleaned up + * call the cleanup functions after invoking the gi callable, after + marshalling + the out parameters and at any time an error occures + + gi/Makefile.am | 4 ++- + gi/pygi-cache.c | 25 +++++++------ + gi/pygi-cache.h | 5 ++- + gi/pygi-invoke-ng.c | 34 ++++++++++++++--- + gi/pygi-invoke-state-struct.h | 13 +++++++ + gi/pygi-marshal-cleanup.c | 81 + +++++++++++++++++++++++++++++++++++++++++ + gi/pygi-marshal-cleanup.h | 43 ++++++++++++++++++++++ + gi/pygi-marshal.c | 1 + + 8 files changed, 187 insertions(+), 19 deletions(-) + +commit 0463295cd046bd6382ad9dc71ea1518858d63c5f Author: Sebastian Pölsterl -Date: Mon Apr 11 18:34:31 2011 +0200 +Date: Mon Apr 11 18:34:31 2011 +0200 [gi] Added support for GVariant arguments @@ -261,122 +1847,163 @@ Date: Mon Apr 11 18:34:31 2011 +0200 https://bugzilla.gnome.org/show_bug.cgi?id=647477 - gi/pygi-argument.c | 2 ++ + gi/pygi-argument.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -commit cc0e8423f36486d15f751bd3c14351edda28538d -Author: Steve Frécinaux -Date: Mon Apr 4 21:12:18 2011 +0200 +commit 1d64c3d3db2ec17b9a48df55271f712db6c07060 +Author: John (J5) Palmieri +Date: Wed Mar 30 16:40:31 2011 -0400 - Fix ABI break in old static bindings. + [gi-invoke-ng] fix marshal header that is no longer part of + pygi-arguments.h - Commit 84d6142c14a7ebfb7284d3db52e14d3393f93905 (Always register a new - GType when a GObject class is subclassed) breaks the more advanced - usage - of PyGObject with regards to "metaclass hackery" as used in for - example - the kiwi and sqlkit projects. But the users of the gi-based bindings - now rely on the new behaviour. + gi/pygi-marshal.h | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) - We fix this by restraining the systematical registering of new - types to - the new gi-based bindings, leaving the old pygtk ones untouched. +commit 3580cd1c7222022ebeef3476f9e609c8045f12a3 +Author: John (J5) Palmieri +Date: Wed Mar 30 15:53:13 2011 -0400 - https://bugzilla.gnome.org/show_bug.cgi?id=646437 + [gi-invoke-ng] code style space fixes - gi/types.py | 9 +++++++++ - gobject/__init__.py | 16 +++++++++------- - 2 files changed, 18 insertions(+), 7 deletions(-) + gi/pygi-cache.c | 420 +++++++++++++++++++------------------- + gi/pygi-invoke-ng.c | 145 +++++++------- + gi/pygi-marshal.c | 565 + ++++++++++++++++++++++++++------------------------- + 3 files changed, 566 insertions(+), 564 deletions(-) -commit b0e499744d337adc608e2aa8996469bca2df044a -Author: Mike Gorse -Date: Sat Apr 2 18:45:40 2011 -0500 +commit 81662fcd09f112bfffcdc5b7f01a5537b84cd9d4 +Author: John (J5) Palmieri +Date: Tue Mar 29 16:54:44 2011 -0400 - fetch size from an enum type + [gi-invoke-ng] don't decref value taken from a dict as it is borrowed - Do not assume that an enum is returned as a long; treat it as an - int if - the type indicates that its size is that of an int. + gi/pygi-invoke-ng.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) - http://bugzilla.gnome.org/show_bug.cgi?id=646581 +commit a456fc0adc1f8a0754bf59cde8924f905bfc7dc1 +Author: John (J5) Palmieri +Date: Tue Mar 29 15:23:06 2011 -0400 - gi/pygi-argument.c | 25 ++++++++++++++++++++++--- - 1 files changed, 22 insertions(+), 3 deletions(-) + [gi-invoke-ng] return None when appropriate so we don't crash -commit 4f59bee3a875eb71b8c9adce855b9addc965fe3b -Author: Dieter Verfaillie -Date: Tue Mar 22 20:47:51 2011 +0100 + gi/pygi-marshal.c | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) - dsextras.py: ensure eol characters are preserved when writing template - files (so \n does not become \r\n) +commit e8c8c37e5587dc7ff62519df336988a12e6f5d0a +Author: John (J5) Palmieri +Date: Tue Mar 29 15:21:41 2011 -0400 - dsextras.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + [gi-invoke-ng] fix aux value caching + + gi/pygi-cache.c | 15 ++++++++++----- + 1 files changed, 10 insertions(+), 5 deletions(-) -commit b7a6f884e9ea5946691dd661b79e3094b6e1b34c +commit 4e4c1847c713a4eb4ab34d04488e94dac24d9167 Author: John (J5) Palmieri -Date: Thu Mar 24 12:10:47 2011 -0400 +Date: Mon Mar 28 20:25:46 2011 -0400 - release 2.28.3 + [gi-invoke-ng] backport handling flags with no gtype - NEWS | 3 +++ - configure.ac | 2 +- - 2 files changed, 4 insertions(+), 1 deletions(-) + gi/pygi-marshal.c | 25 ++++++++++++++++++++++++- + 1 files changed, 24 insertions(+), 1 deletions(-) -commit 99689e2849a9df78980c9d25d9ddabc1e95f1252 +commit fd76423e655b3711e1ffbf9b61ea4e2c94040234 Author: John (J5) Palmieri -Date: Thu Mar 24 12:08:10 2011 -0400 +Date: Mon Mar 28 18:32:00 2011 -0400 - Revert "dsextras.py: ensure eol characters are preserved when writing - template files (so \n does not become \r\n)" + [gi-invoke-ng] backport raw gvalue handling - This reverts commit 27496e0e86e7d8798caf019fd09af5c6a30ec633. + gi/pygi-marshal.c | 23 ++++++++++++++++++----- + 1 files changed, 18 insertions(+), 5 deletions(-) - dsextras.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +commit 507b5051c83f70ceae79e0fa693c86e5cbb9f442 +Author: John (J5) Palmieri +Date: Mon Mar 28 18:30:31 2011 -0400 -commit 27496e0e86e7d8798caf019fd09af5c6a30ec633 -Author: Dieter Verfaillie -Date: Tue Mar 22 20:47:51 2011 +0100 + [gi-invoke-ng] marshal instances seperately since they differ slightly + from other args - dsextras.py: ensure eol characters are preserved when writing template - files (so \n does not become \r\n) + gi/pygi-cache.c | 2 +- + gi/pygi-marshal.c | 38 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 39 insertions(+), 1 deletions(-) - dsextras.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +commit 726a27c0e74ace3ff23d9cc4d393ae53e57f1fac +Author: John (J5) Palmieri +Date: Mon Mar 28 18:26:09 2011 -0400 -commit b7449d63e0c1bdfb5acbd8c5ec073711441301b9 -Author: Dieter Verfaillie -Date: Tue Mar 22 11:35:44 2011 +0100 + [gi-invoke-ng] refactor FunctionCache to be more generic CallableCache - dsextras.py: remove \r as wel as \n character + gi/pygi-cache.c | 392 + ++++++++++++++++++++++++++------------------------- + gi/pygi-cache.h | 12 +- + gi/pygi-info.c | 2 +- + gi/pygi-invoke-ng.c | 40 +++--- + gi/pygi-marshal.c | 140 +++++++++--------- + gi/pygi-marshal.h | 159 ++++++++------------- + gi/pygi.h | 2 +- + 7 files changed, 362 insertions(+), 385 deletions(-) - dsextras.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +commit 3d5d9ff5c18a850650992bdd52e8e4c722b23396 +Author: John (J5) Palmieri +Date: Mon Mar 28 15:01:12 2011 -0400 + + [gi-invoke-rewrite] backport glib error handling -commit 075ead0533ba311120b3ca9ac9ae75ca84ace8fb + gi/pygi-invoke-ng.c | 14 ++++++-------- + 1 files changed, 6 insertions(+), 8 deletions(-) + +commit 37b14b28a5f2aec16ac7f321efbf07e1403e9531 Author: John (J5) Palmieri -Date: Wed Mar 23 10:39:19 2011 -0400 +Date: Fri Mar 25 18:48:42 2011 -0400 - fix a typo when converting objects to strings gvalues + [gi-invoke-ng] backport closure passing from invoke - gobject/pygtype.c | 4 ++-- - tests/test_properties.py | 8 ++++++++ - 2 files changed, 10 insertions(+), 2 deletions(-) + gi/pygi-marshal.c | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) -commit a904f0dea4b7f04aac7c9ddd3b01ffbbd808375e +commit cf7f97eabc9c49773c2916929b8c43ef453d0652 Author: John (J5) Palmieri -Date: Tue Mar 22 21:56:14 2011 -0400 +Date: Fri Mar 25 18:47:36 2011 -0400 - prep 2.28.2 release + [gi-invoke-ng] handle vfuncs and fix cosntrutors - NEWS | 6 ++++++ - configure.ac | 2 +- - 2 files changed, 7 insertions(+), 1 deletions(-) + gi/pygi-cache.c | 9 ++++++ + gi/pygi-cache.h | 2 + + gi/pygi-invoke-ng.c | 56 + ++++++++++++++++++++++++++++++---------- + gi/pygi-invoke-state-struct.h | 2 + + 4 files changed, 55 insertions(+), 14 deletions(-) + +commit af2ce400fcf771ee6c9bc01aecfb59467be5a0ce +Author: John (J5) Palmieri +Date: Fri Mar 25 18:39:06 2011 -0400 + + [gi-invoke-ng] handle foreign types correctly + + gi/pygi-cache.c | 22 ++++++---------------- + gi/pygi-marshal.c | 3 +++ + 2 files changed, 9 insertions(+), 16 deletions(-) -commit c1ee6642d4b69a8c417cf92534ba091f89c7f68c +commit 482553ae5d863ca523be3bd1eededa5d02a4f87e Author: John (J5) Palmieri -Date: Tue Mar 22 18:46:28 2011 -0400 +Date: Fri Mar 25 13:14:01 2011 -0400 + + [gi] remove the class parameter from the argument list of constructors + + * constructors pass in their class to be constructed. Since we + use GI + and g_object_new to do the construction we ignore this for now but + keep it around in the state for future use. + + gi/pygi-invoke-ng.c | 46 + +++++++++++++++++++++++++++++++++++----- + gi/pygi-invoke-state-struct.h | 1 + + 2 files changed, 41 insertions(+), 6 deletions(-) + +commit 0534eb0e843cdf09611143da184052f7e549e4dc +Author: John (J5) Palmieri +Date: Tue Mar 22 18:46:28 2011 -0400 fix static ABI for setting string gvalues from python objects @@ -387,12 +2014,123 @@ Date: Tue Mar 22 18:46:28 2011 -0400 * this restores that code while still keeping unicode and python 3 compatability - gobject/pygtype.c | 28 +++++++++++++++++++--------- - 1 files changed, 19 insertions(+), 9 deletions(-) + gobject/pygtype.c | 28 +++++++++++++++++++--------- + tests/test_properties.py | 8 ++++++++ + 2 files changed, 27 insertions(+), 9 deletions(-) + +commit 5f0e130026a663a57ed1317e0fa0e1f78f9e6e0a +Author: Dieter Verfaillie +Date: Tue Mar 22 20:47:51 2011 +0100 + + dsextras.py: ensure eol characters are preserved when writing template + files (so \n does not become \r\n) + + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 62a6274105003ef386ddfe9ef38e8afa8c43d124 +Author: Dieter Verfaillie +Date: Tue Mar 22 11:35:44 2011 +0100 + + dsextras.py: remove \r as wel as \n character + + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 86c436978c933f6ebe17627abe98325ce66f6baa +Author: John (J5) Palmieri +Date: Tue Mar 22 16:13:58 2011 -0400 + + [gi] make new invoke-ng codepath compile correctly + + configure.ac | 4 + + gi/Makefile.am | 5 +- + gi/pygi-cache.c | 2 +- + gi/pygi-invoke-ng.c | 841 ---------------------- + gi/pygi-marshal.c | 1962 + +-------------------------------------------------- + gi/pygi-private.h | 4 +- + 6 files changed, 9 insertions(+), 2809 deletions(-) + +commit 35619fec43f4df85edf5456f3fc9733b16f2ba90 +Author: John (J5) Palmieri +Date: Tue Mar 22 15:40:02 2011 -0400 + + [gi] conditionalize invoke code paths + + configure.ac | 7 +++++++ + gi/Makefile.am | 20 +++++++++++++++----- + gi/pygi-cache.h | 2 ++ + gi/pygi-info.c | 4 +++- + gi/pygi-private.h | 9 +++++++-- + gi/pygi.h | 4 +++- + 6 files changed, 37 insertions(+), 9 deletions(-) + +commit 83c51bd2bb6ca24ce610c04cff1527bcd2689d90 +Author: John (J5) Palmieri +Date: Tue Mar 22 15:37:24 2011 -0400 + + [gi] revert back to the type.py from master + + gi/types.py | 21 +++++++++++++++------ + 1 files changed, 15 insertions(+), 6 deletions(-) + +commit cb30d00d1c92e73d9bfb08cc7b600a5aa70f2fc0 +Author: John (J5) Palmieri +Date: Tue Mar 22 14:46:29 2011 -0400 + + [gi] revert pygi-argument.h and move the invoke-ng code to + pygi-marshal.h + + gi/pygi-argument.h | 268 +----------------------------------------- + gi/pygi-marshal.h | 336 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 337 insertions(+), 267 deletions(-) + +commit 17cb714cfdaf45b6d7dd627b0189bd24e6578f74 +Merge: 7332a1b 01596a9 +Author: John (J5) Palmieri +Date: Tue Mar 22 13:34:36 2011 -0400 + + Merge branch 'master' into invoke-rewrite -commit cd38572b9781502d3228e74c017cb7cc39a07b3d + Conflicts: + gi/Makefile.am + gi/pygi-argument.c + gi/pygi-foreign-cairo.c + gi/pygi-foreign-gvariant.c + gi/pygi-foreign-gvariant.h + gi/pygi-foreign.c + gi/pygi-foreign.h + gi/pygi-private.h + gi/pygi.h + +commit 01596a9b7cc0ceef3904da5b96939140ee0732fd +Author: John (J5) Palmieri +Date: Tue Mar 22 13:20:54 2011 -0400 + + [gi] foreign types now take interface infos instead of type infos + + * this is a prep for the invoke-rewrite branch + * when marshalling foreign structs we may not have the type info but + we will always have the interface info to pass + * this simplifies the code because we were simply converting the + type info back to an interface info anyway so there is less + refcounting to keep track of + * also fixes a bug where we were leaking PyNone ref counts + + gi/pygi-argument.c | 4 ++-- + gi/pygi-foreign-cairo.c | 16 ++++++++-------- + gi/pygi-foreign-gvariant.c | 12 ++++++------ + gi/pygi-foreign.c | 32 +++++++++++++------------------- + gi/pygi-foreign.h | 8 ++++---- + gi/pygi-invoke.c | 6 +++--- + gi/pygi.h | 12 ++++++------ + 7 files changed, 42 insertions(+), 48 deletions(-) + +commit fbabc1fdafa1dcbd1f6aaea7b821bd1c64a546ab Author: Martin Pitt -Date: Tue Mar 22 15:04:01 2011 +0100 +Date: Tue Mar 22 15:04:01 2011 +0100 Fix GSchema tests for separate build tree @@ -404,45 +2142,59 @@ Date: Tue Mar 22 15:04:01 2011 +0100 prefer it over test_overrides.py's directory. - tests/Makefile.am | 3 ++- + tests/Makefile.am | 3 ++- tests/test_overrides.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) -commit be81ea00d6cd92a5ae77c5bb301b6f6baeb6d89a -Author: Martin Pitt -Date: Tue Mar 22 14:02:46 2011 +0100 +commit 7332a1b99775519fdc5500cab6628b713e946a8c +Author: John (J5) Palmieri +Date: Mon Mar 21 19:03:29 2011 -0400 - GIO tests: Fix remaining test case for separate build tree + [gi] start of merge from master - tests/test_gio.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + * move some of the modified files that will cause merge conflicts + to their + own, nonconflicting files + * copy the old files out of master -commit 178df3e438835bec9b40dea243867784dee35815 -Author: Martin Pitt -Date: Tue Mar 22 13:21:27 2011 +0100 + gi/pygi-argument.c | 2101 +++------------------------- + gi/pygi-invoke-ng.c | 1179 ++++++++++++++++ + gi/pygi-invoke.c | 421 ++---- + gi/pygi-marshal.c | 3916 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 5389 insertions(+), 2228 deletions(-) - GIO tests: Fix for separate build tree +commit 62b49dae97441953452d097cb1751df14302547a +Author: John (J5) Palmieri +Date: Wed Mar 16 17:34:18 2011 -0400 - When using a separate build tree, "test_gio.py" is not in the - current working - dir (which is the build tree), but in the srcdir. Use __file__ - instead. + [gi] marshal raw closures - tests/test_gio.py | 14 +++++++------- - 1 files changed, 7 insertions(+), 7 deletions(-) + * before we were able to marshal python callables into methods + that took + GClosures but we had no way to take a GClosure returned from one + method and pass it to another - this enables that usecase -commit 27dcb9b1963be0c0d18e19a0b108a4a64d5e048b -Author: John (J5) Palmieri -Date: Mon Mar 21 12:42:36 2011 -0400 + https://bugzilla.gnome.org/show_bug.cgi?id=644757 - prep for 2.28.1 release + gi/pygi-argument.c | 17 ++++++++++------- + tests/test_gi.py | 4 ++++ + 2 files changed, 14 insertions(+), 7 deletions(-) - NEWS | 15 +++++++++++++++ - 1 files changed, 15 insertions(+), 0 deletions(-) +commit 1e70957c5470a0f4bceba38ca66a4e4274fdc8d8 +Author: John Stowers +Date: Sun Mar 6 23:41:01 2011 +1300 + + pygi-convert.sh add GObject.xxx and webkit + + https://bugzilla.gnome.org/show_bug.cgi?id=644347 -commit 072d45cbfa7b360a0e616c4c56ba75d4dc08e7df + pygi-convert.sh | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 2292673c96e7973a0732ca15bbd5b0bf7a9c7dcf Author: John Stowers -Date: Sun Mar 6 23:41:30 2011 +1300 +Date: Sun Mar 6 23:41:30 2011 +1300 pygi-convert.sh remove gobject tests, GObject works now @@ -451,37 +2203,38 @@ Date: Sun Mar 6 23:41:30 2011 +1300 pygi-convert.sh | 28 ---------------------------- 1 files changed, 0 insertions(+), 28 deletions(-) -commit 205fee1622e461c0bcbe50e8befe30f01aac81eb -Author: John Stowers -Date: Sun Mar 6 23:41:01 2011 +1300 - - pygi-convert.sh add GObject.xxx and webkit +commit d26e5cc45f277f6b7edb32aa416520bb53bff9c2 +Author: John (J5) Palmieri +Date: Fri Mar 11 14:09:02 2011 -0500 - https://bugzilla.gnome.org/show_bug.cgi?id=644347 + [gi-demos] add pickers demo - pygi-convert.sh | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) + demos/gtk-demo/demos/pickers.py | 74 + +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 74 insertions(+), 0 deletions(-) -commit f5ee2924af489c17b64e56be5d2bd1c39d1293d1 +commit b8d926a458ed7d7e92719e41b5bc1c36f68882b3 Author: John (J5) Palmieri -Date: Wed Mar 16 17:34:18 2011 -0400 +Date: Thu Mar 10 18:12:50 2011 -0500 - [gi] marshal raw closures + [gi-demos] add menu demo - * before we were able to marshal python callables into methods - that took - GClosures but we had no way to take a GClosure returned from one - method and pass it to another - this enables that usecase + demos/gtk-demo/demos/menus.py | 122 + +++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 122 insertions(+), 0 deletions(-) - https://bugzilla.gnome.org/show_bug.cgi?id=644757 +commit 9baec8ed1c5d99c1677a75eaa1d38912f41f0b2d +Author: John (J5) Palmieri +Date: Wed Mar 9 13:02:50 2011 -0500 - gi/pygi-argument.c | 15 ++++++++++----- - tests/test_gi.py | 4 ++++ - 2 files changed, 14 insertions(+), 5 deletions(-) + [gi-overrides] fix exception block so it works in Python 2.5 + + gi/overrides/Gio.py | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) -commit ac11dc70b34fe077be18f7e605c9f3cce03ad3fa +commit 5ac534ac3ceee3cc19fe2297e3cd009817ed726f Author: Martin Pitt -Date: Mon Mar 21 13:25:12 2011 +0100 +Date: Mon Mar 21 13:19:58 2011 +0100 Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" @@ -495,42 +2248,24 @@ Date: Mon Mar 21 13:25:12 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=620215 - gi/Makefile.am | 4 +--- - gio/Makefile.am | 2 +- - glib/Makefile.am | 2 +- - m4/python.m4 | 7 ++----- - tests/Makefile.am | 2 +- - 5 files changed, 6 insertions(+), 11 deletions(-) + gi/Makefile.am | 4 +--- + glib/Makefile.am | 2 +- + m4/python.m4 | 7 ++----- + tests/Makefile.am | 2 +- + 4 files changed, 5 insertions(+), 10 deletions(-) -commit aed7582de1c0623042601c8038a7631fa41d087d +commit cd01f8ce1373f28b1427dd847bef44f747f1e6b3 Author: Dieter Verfaillie -Date: Fri Mar 18 17:06:08 2011 +0100 +Date: Fri Mar 18 17:06:08 2011 +0100 setup.py: fix user_access_control option setup.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit 6f0d33101a2451854f216291813951349d5ac471 -Author: John (J5) Palmieri -Date: Wed Mar 16 15:20:43 2011 -0400 - - [gi-overrides] fix marshalling pygobjects in treemodels - - * PyGObjects wern't being marshalled correctly as python objects - when a - treemodel column was set to take pyobjects - * Fix this by explicetly marshalling all PyObjects as boxed gvalue - types - in the overrides - - gi/overrides/Gtk.py | 9 +++++---- - tests/test_overrides.py | 34 ++++++++++++++++++++++++++-------- - 2 files changed, 31 insertions(+), 12 deletions(-) - -commit adb6f0320bed9a00a96c99424d4982199dc85af2 +commit 2da60baec4f43c41f43527cbfde4e21e0eea728c Author: Martin Pitt -Date: Wed Mar 16 10:22:35 2011 +0100 +Date: Wed Mar 16 10:22:35 2011 +0100 [gi] Respect the MessageType for Gtk.MessageDialog @@ -538,12 +2273,12 @@ Date: Wed Mar 16 10:22:35 2011 +0100 to Tualatrix Chou for spotting this! - gi/overrides/Gtk.py | 1 + + gi/overrides/Gtk.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -commit 115c4750f071270b648218c9678931a65a4b3e3d +commit 029a79d1af1e0998aa6bc88ce1c1f48ce0ccd2a0 Author: Martin Pitt -Date: Tue Mar 15 10:22:39 2011 +0100 +Date: Tue Mar 15 10:22:39 2011 +0100 [gi] Do not require signature for D-BUS methods without arguments @@ -562,124 +2297,64 @@ Date: Tue Mar 15 10:22:39 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=644260 - gi/overrides/Gio.py | 16 +++++++++++++++- - tests/test_gdbus.py | 13 +++++++++++++ + gi/overrides/Gio.py | 16 +++++++++++++++- + tests/test_gdbus.py | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletions(-) -commit 0df9e153812e1e5077bb906449e211ecb0af8736 -Author: John (J5) Palmieri -Date: Fri Mar 11 14:09:02 2011 -0500 - - [gi-demos] add pickers demo - - demos/gtk-demo/demos/pickers.py | 74 - +++++++++++++++++++++++++++++++++++++++ - 1 files changed, 74 insertions(+), 0 deletions(-) - -commit 419bfdd44b566ffb88f71165c00728872987dc5e -Author: John (J5) Palmieri -Date: Thu Mar 10 18:12:50 2011 -0500 - - [gi-demos] add menu demo - - demos/gtk-demo/demos/menus.py | 122 - +++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 122 insertions(+), 0 deletions(-) - -commit 0877670e184a591866cbf3ab14284fcb217b540b +commit 5bf66ce79267b25bcc80251f9170498fa1d765f6 Author: John Stowers -Date: Sun Mar 6 23:05:33 2011 +1300 +Date: Sun Mar 6 23:05:33 2011 +1300 [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None https://bugzilla.gnome.org/show_bug.cgi?id=644343 - gi/overrides/Gtk.py | 2 ++ + gi/overrides/Gtk.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -commit 1f69c520d95fec30094fac47cb0efa31c79da81c +commit 8e4f86e17a1de533a93b0748fd8de3cbfa70ba62 Author: John Stowers -Date: Sun Mar 6 17:48:04 2011 +1300 +Date: Sun Mar 6 17:48:04 2011 +1300 [gi-demos] dont try and run demos that represent directories - demos/gtk-demo/gtk-demo.py | 3 ++- + demos/gtk-demo/gtk-demo.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -commit f06ad511725b28d821532acae45a25d0a186fc9f -Author: John (J5) Palmieri -Date: Wed Mar 9 13:02:50 2011 -0500 - - [gi-overrides] fix exception block so it works in Python 2.5 - - gi/overrides/Gio.py | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) - -commit a784350b6e76c6c66fb2856dd597238f4ac992e9 -Author: John (J5) Palmieri -Date: Tue Mar 8 13:25:57 2011 -0500 - - post release version bump - - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -commit aa745352bb99862c360dc56e2fececc4b2968cbc +commit 097e5efab29d3d2d91d0b9fc75bf00219e9b7810 Author: John (J5) Palmieri -Date: Tue Mar 8 13:20:31 2011 -0500 +Date: Mon Mar 7 18:09:18 2011 -0500 - prep 2.28.0 release + [gi-demos] some python 3 compat fixes - NEWS | 25 +++++++++++++++++++++++++ - configure.ac | 4 ++-- - 2 files changed, 27 insertions(+), 2 deletions(-) + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 6 ++++++ + demos/gtk-demo/demos/Tree View/liststore.py | 2 +- + demos/gtk-demo/demos/rotatedtext.py | 4 ++-- + demos/gtk-demo/gtk-demo.py | 4 ++-- + 4 files changed, 11 insertions(+), 5 deletions(-) -commit d3bafc0a8bacf99e22b18c978012ab719e70954e +commit fd5d5ef3abc947d3c6066eea6378514f87b7f0ce Author: John (J5) Palmieri -Date: Mon Mar 7 18:09:18 2011 -0500 +Date: Tue Feb 22 15:07:40 2011 -0500 - [gi-demos] some python 3 compat fixes + [gi-demos] add liststore demo - demos/gtk-demo/demos/Icon View/iconviewbasics.py | 6 ++++++ - demos/gtk-demo/demos/Tree View/liststore.py | 2 +- - demos/gtk-demo/demos/rotatedtext.py | 4 ++-- - demos/gtk-demo/gtk-demo.py | 4 ++-- - 4 files changed, 11 insertions(+), 5 deletions(-) + demos/gtk-demo/demos/Tree View/liststore.py | 205 + +++++++++++++++++++++++++++ + 1 files changed, 205 insertions(+), 0 deletions(-) -commit eaafff23d397852b08384b4e15d68e3888e99b48 +commit 09de5cf99474fc8a34b5f4a61cede1fb47353ebb Author: John (J5) Palmieri -Date: Mon Mar 7 18:08:40 2011 -0500 +Date: Mon Mar 7 18:08:40 2011 -0500 [gi-demos] catch the correct error class demos/gtk-demo/demos/images.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) -commit b113540b452638601945f63297e68b7564c3d4df -Author: Steve Frécinaux -Date: Mon Mar 7 01:58:36 2011 +0100 - - Try not to sink objects returned by C functions. - - When creating a wrapper around an object to call a python function, we - try to avoid calling pygobject_sink() when the object was not - created by - pygobject or the static bindings because otherwise we can end - up leaking - one reference for GInitiallyUnowned subclasses if the object was - already - owned by someone else. - - https://bugzilla.gnome.org/show_bug.cgi?id=644067 - - gobject/pygobject-private.h | 1 + - gobject/pygobject.c | 7 +++++++ - gobject/pygtype.c | 6 +++--- - 3 files changed, 11 insertions(+), 3 deletions(-) - -commit 7bece91e83e3c72a7bd04d2096dcf9b31aa9d366 +commit 7284d2d4622978fc9ddfd00f2714b3a572b7ab56 Author: Steve Frécinaux -Date: Sun Mar 6 21:18:36 2011 +0100 +Date: Sun Mar 6 21:18:36 2011 +0100 Do not leak python references when using the gobject.property() helper. @@ -691,25 +2366,13 @@ Date: Sun Mar 6 21:18:36 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=644039 - gobject/propertyhelper.py | 5 ++--- + gobject/propertyhelper.py | 5 ++--- tests/test_properties.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) -commit 030695cb4306d915044aea4fae7c7122ccde31b4 +commit 618dbb0ee15b47e5e7cb16a34ffce0937d7fa26d Author: John (J5) Palmieri -Date: Mon Mar 7 11:13:12 2011 -0500 - - [gi] fix try except blocks so they work in Python 2.5 - - * use etype, e = sys.exc_info[:2] to extract error details instead of - except Exception as e or except Exception, e - - tests/test_gdbus.py | 27 ++++++++++++++++++++------- - 1 files changed, 20 insertions(+), 7 deletions(-) - -commit 7e6d833c7f74031b010b45b635214cde5d85f7ae -Author: John (J5) Palmieri -Date: Fri Mar 4 12:25:49 2011 -0500 +Date: Fri Mar 4 12:25:49 2011 -0500 handle uchar as bytes, not strings in python 3 @@ -721,31 +2384,31 @@ Date: Fri Mar 4 12:25:49 2011 -0500 * PYGLIB_PyBytes_FromStringAndSize evaluates to a PyString in Python 2 and a PyBytes object in Python 3 - gobject/pygtype.c | 2 +- + gobject/pygtype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit aae4ce5d9e9b7747bf5847071a72a6cdd1371a3e +commit 7e9483ff75b7a63ddda0fa9a9847f9f22ad71240 Author: John (J5) Palmieri -Date: Fri Mar 4 12:24:35 2011 -0500 +Date: Fri Mar 4 12:24:35 2011 -0500 [gi-overrides] handle unichar gvalues when setting treemodels - gi/overrides/Gtk.py | 10 ++++++++++ + gi/overrides/Gtk.py | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) -commit 0d65223992abec46eee7b2b3c76f68da67de4905 +commit 6367bffa006e94dc667d7008fccad8d47d8d3646 Author: John (J5) Palmieri -Date: Fri Mar 4 11:43:51 2011 -0500 +Date: Fri Mar 4 11:43:51 2011 -0500 [gi-overrides] special case python 2 keywords that crept in - gi/overrides/Gtk.py | 6 +++++- + gi/overrides/Gtk.py | 6 +++++- tests/test_overrides.py | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) -commit 094b355a785fbe7ebc776cbbd059e6a3d9241ce2 +commit 83b0f8a37d5f3236780d87a1ca466c5e44ae2bc0 Author: John (J5) Palmieri -Date: Fri Mar 4 11:10:16 2011 -0500 +Date: Fri Mar 4 11:10:16 2011 -0500 check for the py3 _thread module in configure.ac if thread is not found @@ -753,9 +2416,9 @@ Date: Fri Mar 4 11:10:16 2011 -0500 configure.ac | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) -commit b0d537c58e6997b546a9a367860abb3b93ce3440 +commit 4645af87d3c587f535404867dab56608719e5c7b Author: John (J5) Palmieri -Date: Fri Mar 4 00:39:23 2011 -0500 +Date: Fri Mar 4 00:39:23 2011 -0500 [gi-demos] add iconview demo @@ -763,9 +2426,9 @@ Date: Fri Mar 4 00:39:23 2011 -0500 ++++++++++++++++++++++ 1 files changed, 212 insertions(+), 0 deletions(-) -commit e5aa7268c2a0fc285d60b30e135fd79d039b9ae5 +commit 761dcb516a04f7a89b3c7d68e88fff23055e2a80 Author: John (J5) Palmieri -Date: Thu Mar 3 18:39:16 2011 -0500 +Date: Thu Mar 3 18:39:16 2011 -0500 [gi] wrap the keyword argument in a dict so we don't break Python 2.5 @@ -773,12 +2436,12 @@ Date: Thu Mar 3 18:39:16 2011 -0500 sending in *args. You can only send in **kwds. - gi/types.py | 2 +- + gi/types.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit 79d03b40b2395874556860e7e39e0c607b6a676a +commit f9604e90af12a1b9dbe7d7f311308e87cd0ed7dd Author: John (J5) Palmieri -Date: Thu Mar 3 18:30:40 2011 -0500 +Date: Thu Mar 3 18:30:40 2011 -0500 [gi-demos] add the combobox with string ids section to the demos @@ -786,29 +2449,29 @@ Date: Thu Mar 3 18:30:40 2011 -0500 +++++++++++++++++++++++++++++++++++++- 1 files changed, 48 insertions(+), 1 deletions(-) -commit 1b4ac8bef90ed1d3d51d45dafa61bfd70c6f9eb7 +commit b70f4daf071cf77a4561b57f5521eb928f66d1ce Author: John (J5) Palmieri -Date: Thu Mar 3 16:47:51 2011 -0500 +Date: Thu Mar 3 16:47:51 2011 -0500 [gi-overrides] add an override for Gdk.RGBA - gi/overrides/Gdk.py | 18 ++++++++++++++++++ + gi/overrides/Gdk.py | 18 ++++++++++++++++++ tests/test_overrides.py | 10 ++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) -commit c1c491c8cb4684a10404fee59b2706bec6b8606b +commit ee2b63f60f350332ed21927721ed9ddff3a8034e Author: John (J5) Palmieri -Date: Thu Mar 3 16:10:17 2011 -0500 +Date: Thu Mar 3 16:10:17 2011 -0500 [gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ master - demos/gtk-demo/demos/Entry/search_entry.py | 23 +++++++++-------------- + demos/gtk-demo/demos/Entry/search_entry.py | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) -commit 9687fbcf75582986e95188c5b2a24d0fe6b855db +commit cd046e4c355706ead5f512b810a2a48317f8c32e Author: John (J5) Palmieri -Date: Wed Mar 2 18:13:43 2011 -0500 +Date: Wed Mar 2 18:13:43 2011 -0500 [gi-demos] add search entry demo @@ -816,76 +2479,54 @@ Date: Wed Mar 2 18:13:43 2011 -0500 ++++++++++++++++++++++++++++ 1 files changed, 257 insertions(+), 0 deletions(-) -commit 28fbd6a11bda726fecfd7322f4acf41d06c54ec3 +commit d5ddaa92e6349c2f52b67317326060973cb69661 Author: John (J5) Palmieri -Date: Wed Mar 2 15:37:27 2011 -0500 +Date: Wed Mar 2 15:37:27 2011 -0500 [gi] wrap map in a list for Python 3 compat - gi/types.py | 2 +- + gi/types.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit d71224aa5b329cbb7116d35b8f98027fc27e630d +commit 3e5ab72a2e1fa2d8c4c2864137c6251f264ff4af Author: John (J5) Palmieri -Date: Tue Mar 1 14:52:00 2011 -0500 +Date: Tue Mar 1 14:52:00 2011 -0500 [gi-demos] fix up the validation combobox demos/gtk-demo/demos/combobox.py | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) -commit d7d2f9c185773b35a6b89379be9bd96d04be79fb +commit 08af5f99f0838b3584f6a3b210d0a0304811e8ff Author: John (J5) Palmieri -Date: Tue Mar 1 12:31:35 2011 -0500 +Date: Tue Mar 1 12:31:35 2011 -0500 add overridesdir variable in the .pc file for 3rd party overrides - pygobject-2.0.pc.in | 1 + + pygobject-2.0.pc.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -commit c2cfdfa6c08b9da6bff9fc9d479e441a83cbf60a -Author: John (J5) Palmieri -Date: Tue Mar 1 12:19:28 2011 -0500 - - [gi] remove unref for closures since they are floating objects that - get sunk - - * right now we trust that the containers we send the closures into - will sink - them - * we should research this a bit more to see if there is a better - way to handle - floating closures once we are free to break static binding ABI - * for now this is the least invasive of all the options - * don't assert on transfer != GI_TRANSFER_NONE since the behavior for - closures is always the same (and should actually be - GI_TRANSFER_FULL) - - gi/pygi-argument.c | 6 ------ - tests/test_overrides.py | 8 ++++++++ - 2 files changed, 8 insertions(+), 6 deletions(-) - -commit e016486cbb24f696ebfc0cf1f457ec4e37a123cb +commit 4a6b14a92a687a2311516b2c16c355216b5270a7 Author: Dieter Verfaillie -Date: Fri Feb 11 17:14:11 2011 +0100 +Date: Fri Feb 11 17:14:11 2011 +0100 setup.py: Set bdist_wininst user-access-control property setup.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -commit 2923f26c7850d12ece67b3ef96054721d38f888f +commit ad3ab659b83cb985730e19a83651da319d4bcb9c Author: Martin Pitt -Date: Wed Mar 2 16:29:00 2011 +0100 +Date: Wed Mar 2 16:29:00 2011 +0100 Fix uninitialized variable in gi.require_version() gi/__init__.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -commit aaaa00bb4027432503efee88622d9289319b1983 +commit 6e7606ee8830f6f51b777f41f6df2f6ea1784e89 Author: Martin Pitt -Date: Tue Mar 1 23:26:07 2011 +0100 +Date: Tue Mar 1 23:26:07 2011 +0100 Run tests with LC_MESSAGES="C" @@ -894,40 +2535,32 @@ Date: Tue Mar 1 23:26:07 2011 +0100 visible strings. Ensure that these do not get translated in the test suite. - tests/runtests.py | 2 ++ + tests/runtests.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -commit 3aa089668f9ff3de86d2ca28e72c206c16c3403a +commit 0461e05174637ae02f34029b85ba217d5ae48c53 Author: John (J5) Palmieri -Date: Mon Feb 28 18:21:43 2011 -0500 +Date: Mon Feb 28 18:21:43 2011 -0500 [gi-overrides] override Gtk.stock_lookup to not return success demos/gtk-demo/demos/combobox.py | 2 +- - gi/overrides/Gtk.py | 9 +++++++++ + gi/overrides/Gtk.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletions(-) -commit 9614680269a267f8cf32a2d5534c50fb76ec48ec -Author: John (J5) Palmieri -Date: Mon Feb 28 14:23:04 2011 -0500 - - post release bump - - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -commit 093334ee29b5846ff57b4e9f74380efc9ed591e7 +commit 40decf3501823004a6e4d3acbbf204c4d4d0a7ec Author: John (J5) Palmieri -Date: Mon Feb 28 14:16:00 2011 -0500 +Date: Mon Feb 28 14:16:00 2011 -0500 - prep for 2.27.91 release + update NEWS to reflect changes in the 2.27.91 release (PYGOBJECT_2_28 + branch) NEWS | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) -commit 4b49a4f6123f0bbd5a36eba65b00142e3df7e595 +commit c2d5122b8e3cf51ec52418f90f1788895b842b6a Author: John (J5) Palmieri -Date: Mon Feb 28 14:08:05 2011 -0500 +Date: Mon Feb 28 14:08:05 2011 -0500 [gi-tests] use Gdk.test_simulate_button instead of emitting event ourselves @@ -939,9 +2572,9 @@ Date: Mon Feb 28 14:08:05 2011 -0500 tests/test_overrides.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) -commit baa9865e6ff8b4eee4b16235b8dcc5dc48d2634d +commit 1be1a2ea2787dffeb71ab4a38233fb71e761bd21 Author: Laszlo Pandy -Date: Thu Feb 24 19:30:32 2011 +0100 +Date: Thu Feb 24 19:30:32 2011 +0100 [gi-tests] tests for EventButton override. @@ -953,34 +2586,21 @@ Date: Thu Feb 24 19:30:32 2011 +0100 tests/test_overrides.py | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) -commit 6366307ba020a40f6dfa22e64fd6345b118fd2e5 -Author: Tomeu Vizoso -Date: Wed Feb 16 09:44:12 2011 +0100 - - Skip interfaces when checking for conflicts in the MRO - - https://bugzilla.gnome.org/show_bug.cgi?id=642437 - - gi/types.py | 40 ++++++++++++++++++++++++++++++++++++++++ - gobject/gobjectmodule.c | 9 +++++++-- - tests/test_gi.py | 16 ++++++++++++++++ - 3 files changed, 63 insertions(+), 2 deletions(-) - -commit 14c787541966be8f497905d33d554343dabf8b73 +commit 99044a4860dd65c97f52b41b7cd3f216f4a97cd4 Author: John (J5) Palmieri -Date: Wed Feb 23 18:43:27 2011 -0500 +Date: Wed Feb 23 18:43:27 2011 -0500 [gi-overrides] Add event methods to all event union members https://bugzilla.gnome.org/show_bug.cgi?id=642554 - gi/overrides/Gdk.py | 70 + gi/overrides/Gdk.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) -commit 7f013383063c1d1e5a95cf4c056ff152d4aa2645 +commit 6e30c69d38fd382414eb820097c297a80be547ac Author: John (J5) Palmieri -Date: Wed Feb 23 14:14:16 2011 -0500 +Date: Wed Feb 23 14:14:16 2011 -0500 [gi] check to see if object is a member of a union when validating paramaters @@ -1000,23 +2620,36 @@ Date: Wed Feb 23 14:14:16 2011 -0500 https://bugzilla.gnome.org/show_bug.cgi?id=642554 - gi/pygi-argument.c | 38 ++++++++++++++++++++++++++++++++++++++ + gi/pygi-argument.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) -commit 284e775b6caa86ef6465d17c87ec77376e66931c +commit 525f21d1365c24488b768955362085bf82512dee +Author: Tomeu Vizoso +Date: Wed Feb 16 09:44:12 2011 +0100 + + Skip interfaces when checking for conflicts in the MRO + + https://bugzilla.gnome.org/show_bug.cgi?id=642437 + + gi/types.py | 40 ++++++++++++++++++++++++++++++++++++++++ + gobject/gobjectmodule.c | 9 +++++++-- + tests/test_gi.py | 16 ++++++++++++++++ + 3 files changed, 63 insertions(+), 2 deletions(-) + +commit da212024772a7a0c32f04f3589bfb24d2eb5706f Author: Laszlo Pandy -Date: Thu Feb 24 18:46:15 2011 +0100 +Date: Thu Feb 24 18:46:15 2011 +0100 [gi] Remove DyanmicModule.load() to _load() to prevent overriding GI attrs. gi/importer.py | 2 +- - gi/module.py | 2 +- + gi/module.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -commit 6d6d4fcf4678b512558c2c0e44c0c2e235c810f4 +commit 2ce6b58c7427cf67ba4f55731ba0a4c04703e495 Author: Laszlo Pandy -Date: Wed Feb 23 12:05:03 2011 +0100 +Date: Wed Feb 23 12:05:03 2011 +0100 Test case with John's fix for crash with C arrays and a GError is set. @@ -1028,35 +2661,35 @@ Date: Wed Feb 23 12:05:03 2011 +0100 * This is a hack and there is really no way around it without ripping out - the current array handling code which spans between pygi-invoke.c - and - pygi-argument.c and completely rewriting it. + the current array handling code which spans between pygi-invoke.c + and + pygi-argument.c and completely rewriting it. * The is no time before our stable release * This patch trades a segfault for a leak in the very unusual case where - an error occures inside an interface that takes one or more C - arrays. Since - we wrap C arrays in GArrays internally but have to unwrap them - to send them - to the introspected C function, there is a period of time where - an error - can occure with the C array in an unknown state (some being true - C arrays - and others still wrapped in a GArray) + an error occures inside an interface that takes one or more C + arrays. Since + we wrap C arrays in GArrays internally but have to unwrap them + to send them + to the introspected C function, there is a period of time where + an error + can occure with the C array in an unknown state (some being true + C arrays + and others still wrapped in a GArray) * This patch adds a c_arrays_are_wrapped state to signal that it is safe to - free them. However since c_arrays_are_wrapped can only track - arrays - as a group, not individually, if it is set to FALSE we can - not assume - that every array is a pure C array, so instead we will simply - leak them - to avoid incorrectly freeing one and causing a segfault. + free them. However since c_arrays_are_wrapped can only track + arrays + as a group, not individually, if it is set to FALSE we can + not assume + that every array is a pure C array, so instead we will simply + leak them + to avoid incorrectly freeing one and causing a segfault. * This issue is fixed in the invoke rewrite branch as it treats C arrays and - GArrays separately, however that branch is not yet ready to be - merged and - won't be until the next release. + GArrays separately, however that branch is not yet ready to be + merged and + won't be until the next release. https://bugzilla.gnome.org/show_bug.cgi?id=642708 @@ -1065,47 +2698,32 @@ Date: Wed Feb 23 12:05:03 2011 +0100 tests/test_gi.py | 9 +++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) -commit 3534c1d4babefd4ee63e46119b279126058b7a71 +commit 702a89beca92cab6b0142829b20281b9245f28b8 Author: John (J5) Palmieri -Date: Wed Feb 23 15:11:59 2011 -0500 +Date: Wed Feb 23 15:11:59 2011 -0500 [gi-overrides] fix setting rows in treeview to accept None as a value * as done in PyGTK None indicates the column should not be set - gi/overrides/Gtk.py | 3 +++ + gi/overrides/Gtk.py | 3 +++ tests/test_overrides.py | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) -commit ecbfaf60914a87f29ff0529614db9b6afca94c82 +commit 498f0d9c903131aca5efe27ffaad7620e40f72ea Author: Laszlo Pandy -Date: Wed Feb 23 14:23:19 2011 +0100 +Date: Wed Feb 23 14:23:19 2011 +0100 [gi] Add value_name for enum and flags from introspection "c:identifier" (if attr is available). - gi/gimodule.c | 22 ++++++++++++++++++---- + gi/gimodule.c | 22 ++++++++++++++++++---- tests/test_gi.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) -commit e5ae620ad772f62cb14ab7c049ba0ce00cc501f2 +commit 824aeb7fab17d6590e5babf2d1f64298f2d0e16b Author: Laszlo Pandy -Date: Tue Feb 22 21:37:33 2011 +0100 - - Don't force loading of DynamicModule until set in sys.modules - - This fixes Tomeu's previous commit, which removed lazy loading. - Forcing the loading of a module before it is installed in sys.modules - prevents some overrides from being registered (namely Gtk.main_quit). - - https://bugzilla.gnome.org/show_bug.cgi?id=642305 - - gi/importer.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -commit 992c0c1096c77bc299a40a34ec30a2ac0c562ed4 -Author: Laszlo Pandy -Date: Wed Feb 23 11:40:55 2011 +0100 +Date: Wed Feb 23 11:40:55 2011 +0100 Fix flags with multiple names for the same value. @@ -1118,55 +2736,27 @@ Date: Wed Feb 23 11:40:55 2011 +0100 of duplicate instances we keep, because if an instance is not found in the dict, a new one is created anyway. - gobject/pygflags.c | 2 +- + gobject/pygflags.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit 8bf3f6ed075994eb3e29950670395bcf1b9dc2a0 -Author: John (J5) Palmieri -Date: Tue Feb 22 15:07:40 2011 -0500 - - [gi-demos] add liststore demo - - demos/gtk-demo/demos/Tree View/liststore.py | 205 - +++++++++++++++++++++++++++ - 1 files changed, 205 insertions(+), 0 deletions(-) - -commit 788fc96771046fc64cede392e748b2d1b6b3aa1c -Author: John (J5) Palmieri -Date: Tue Feb 22 14:35:44 2011 -0500 - - [gi-demos] run through the demos and remove the FIXMEs that have - been fixed - - demos/gtk-demo/demos/appwindow.py | 18 ++++++------------ - demos/gtk-demo/demos/assistant.py | 3 --- - demos/gtk-demo/demos/builder.py | 3 --- - demos/gtk-demo/demos/button_box.py | 10 +++------- - demos/gtk-demo/demos/clipboard.py | 8 ++------ - demos/gtk-demo/demos/colorselector.py | 2 -- - demos/gtk-demo/demos/combobox.py | 4 +--- - demos/gtk-demo/demos/drawingarea.py | 3 --- - 8 files changed, 12 insertions(+), 39 deletions(-) - -commit adf7aec853878681b450c3ef1f89bfe9ba85fec1 -Author: Tomeu Vizoso -Date: Wed Feb 16 11:53:18 2011 +0100 +commit 3afbebeee486e14fd3f48552368903eb78f6b10c +Author: Laszlo Pandy +Date: Tue Feb 22 21:37:33 2011 +0100 - Load typelibs at import time, add gi.require_version() + Don't force loading of DynamicModule until set in sys.modules - also adds Repository.get_loaded_namespaces() + This fixes Tomeu's previous commit, which removed lazy loading. + Forcing the loading of a module before it is installed in sys.modules + prevents some overrides from being registered (namely Gtk.main_quit). https://bugzilla.gnome.org/show_bug.cgi?id=642305 - gi/__init__.py | 29 ++++++++++++++++++++++++++++- - gi/importer.py | 1 + - gi/module.py | 21 ++++----------------- - gi/pygi-repository.c | 23 +++++++++++++++++++++++ - 4 files changed, 56 insertions(+), 18 deletions(-) + gi/importer.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) -commit 6fe7783b96366f380f9168909932a87e35d994b3 +commit 2a9cbfb435b47dc646e2c6ffe630464b560229a6 Author: John (J5) Palmieri -Date: Mon Feb 21 17:20:57 2011 -0500 +Date: Mon Feb 21 17:20:57 2011 -0500 use GValue support to marshal GtkTreeModel values correctly @@ -1174,14 +2764,14 @@ Date: Mon Feb 21 17:20:57 2011 -0500 https://bugzilla.gnome.org/show_bug.cgi?id=642921 - gi/overrides/Gtk.py | 37 ++++++++++++++++++-- + gi/overrides/Gtk.py | 37 ++++++++++++++++++-- tests/test_overrides.py | 87 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 107 insertions(+), 17 deletions(-) -commit bc4a570bcc0a02029d746fbbcfdf4cc14c37f2ad +commit 9e4ce7dc0f03ea407654c4af028122f57cbc4c5e Author: John (J5) Palmieri -Date: Mon Feb 21 16:14:20 2011 -0500 +Date: Mon Feb 21 16:14:20 2011 -0500 [gi] pass raw GValues instead of trying to marshal them @@ -1194,9 +2784,9 @@ Date: Mon Feb 21 16:14:20 2011 -0500 the raw GValue interfaces and expect paramaters that take GValues to marshal them correctly e.g.: - value = GObject.Value() - value.int(GObject.TYPE_UINT) - value.set_uint(1234) + value = GObject.Value() + value.int(GObject.TYPE_UINT) + value.set_uint(1234) * The objective here is to not for users to use this API but for overrides to be able to utilize them. For instance in the TreeModel API @@ -1207,13 +2797,13 @@ Date: Mon Feb 21 16:14:20 2011 -0500 https://bugzilla.gnome.org/show_bug.cgi?id=642914 - gi/pygi-argument.c | 24 ++++++++++++++++++------ - tests/test_gi.py | 9 ++++++++- + gi/pygi-argument.c | 24 ++++++++++++++++++------ + tests/test_gi.py | 9 ++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) -commit 428fc90eb12f26ceb7c868879ad05788890d32a3 +commit b458f6f3424a04f6ceece09d443009372d70544c Author: John (J5) Palmieri -Date: Sat Feb 19 19:42:41 2011 -0500 +Date: Sat Feb 19 19:42:41 2011 -0500 [gi-demos] add icon view edit and drag-and-drop demo @@ -1221,9 +2811,35 @@ Date: Sat Feb 19 19:42:41 2011 -0500 ++++++++++++++++++++++++ 1 files changed, 101 insertions(+), 0 deletions(-) -commit eb0e179bff167303db1c20412f4bc9c8baa94582 +commit 7b47289e25d1dd57ce15556ccfbb3ede1c4bfe8b +Author: John (J5) Palmieri +Date: Sat Feb 19 17:26:42 2011 -0500 + + [gi-demos] add info bars demo + + demos/gtk-demo/demos/infobars.py | 99 + ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 99 insertions(+), 0 deletions(-) + +commit 76758efb6579752237a0dc4d56cf9518de6c6e55 +Author: Tomeu Vizoso +Date: Wed Feb 16 11:53:18 2011 +0100 + + Load typelibs at import time, add gi.require_version() + + also adds Repository.get_loaded_namespaces() + + https://bugzilla.gnome.org/show_bug.cgi?id=642305 + + gi/__init__.py | 29 ++++++++++++++++++++++++++++- + gi/importer.py | 1 + + gi/module.py | 21 ++++----------------- + gi/pygi-repository.c | 23 +++++++++++++++++++++++ + 4 files changed, 56 insertions(+), 18 deletions(-) + +commit 96f7d1aed732db09a74cd463ed894b7347dbcb15 Author: Laszlo Pandy -Date: Sat Feb 19 23:11:25 2011 +0100 +Date: Sat Feb 19 23:11:25 2011 +0100 [gi] Register GType for non-GType enums and flags at runtime. @@ -1240,39 +2856,18 @@ Date: Sat Feb 19 23:11:25 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=642607 - gi/gimodule.c | 117 + gi/gimodule.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - gi/module.py | 24 +++++++---- - gi/pygi-info.c | 15 +++++++ - gi/types.py | 16 ------- - gobject/pygflags.c | 13 ++++-- - tests/test_gi.py | 35 +++++++++++++++ + gi/module.py | 24 +++++++---- + gi/pygi-info.c | 15 +++++++ + gi/types.py | 16 ------- + gobject/pygflags.c | 13 ++++-- + tests/test_gi.py | 35 +++++++++++++++ 6 files changed, 191 insertions(+), 29 deletions(-) -commit d5e67257361609036d2bbfa47ea85a6c759b332a -Author: John (J5) Palmieri -Date: Sat Feb 19 17:26:42 2011 -0500 - - [gi-demos] add info bars demo - - demos/gtk-demo/demos/infobars.py | 99 - ++++++++++++++++++++++++++++++++++++++ - 1 files changed, 99 insertions(+), 0 deletions(-) - -commit 372f480b078d1befb30532a0ebe0ad9c90e78df0 -Author: Martin Pitt -Date: Sat Feb 19 15:44:52 2011 +0100 - - tests/runtests.py: Add missing "import sys" - - master already has this. - - tests/runtests.py | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -commit c1b35fc49680ad25e996de57e3e020bd43d9186c +commit 63a60bcc20e724f96ea8d565ee0cf13a228b72b9 Author: Martin Pitt -Date: Tue Feb 8 15:38:21 2011 +0100 +Date: Tue Feb 8 15:38:21 2011 +0100 [gi] Add Pythonic gdbus method invocation @@ -1292,15 +2887,15 @@ Date: Tue Feb 8 15:38:21 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640181 - gi/overrides/Gio.py | 99 + gi/overrides/Gio.py | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ - tests/test_gdbus.py | 102 + tests/test_gdbus.py | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 199 insertions(+), 2 deletions(-) -commit 2737e1c2c506cd324a0aa2abfdfeb3ad4f08e678 +commit ed5cdbb6f52bdbd13521a814516b15687955d6f7 Author: Laszlo Pandy -Date: Fri Feb 18 22:48:59 2011 +0100 +Date: Fri Feb 18 22:48:59 2011 +0100 Skip GError out parameters in Python closure. @@ -1311,24 +2906,33 @@ Date: Fri Feb 18 22:48:59 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=642715 - gi/pygi-closure.c | 8 ++++++++ + gi/pygi-closure.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) -commit 93677502c12a3ee123dd565bf1b404ef47ec1c47 +commit 5a5ee3877e22939a697772a7f0630ef8cae3d52f +Author: Laszlo Pandy +Date: Fri Feb 18 10:15:59 2011 +0100 + + Fix runtests.py to work with Python3 (print function syntax error). + + tests/runtests.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ad5d3fccff9433e2dadac89d731dac5cafb0eac3 Author: John (J5) Palmieri -Date: Thu Feb 17 19:46:49 2011 -0500 +Date: Thu Feb 17 19:46:49 2011 -0500 [gi-demos] added rotate text demo * needs some Pango Attr fixes to be 100% done, See FIXME - demos/gtk-demo/demos/rotatedtext.py | 196 + demos/gtk-demo/demos/rotatedtext.py | 196 +++++++++++++++++++++++++++++++++++ 1 files changed, 196 insertions(+), 0 deletions(-) -commit 8495ab57f49fb507a8004a9cf967d6fe91bb4ef0 +commit 9ac11c3c3b1c0399c85ece57c0983ed60d419d7a Author: John (J5) Palmieri -Date: Thu Feb 17 17:25:00 2011 -0500 +Date: Thu Feb 17 17:25:00 2011 -0500 [gi-demos] add images demo @@ -1338,9 +2942,9 @@ Date: Thu Feb 17 17:25:00 2011 -0500 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 311 insertions(+), 0 deletions(-) -commit 60b9dd8d021e550089f44dc489ffeb77af6976ee +commit 13b06170b89b3468e6255be32af4833ffc675c9d Author: John (J5) Palmieri -Date: Thu Feb 17 14:48:24 2011 -0500 +Date: Thu Feb 17 14:48:24 2011 -0500 [gi-demos] add pixbuf demo @@ -1348,18 +2952,18 @@ Date: Thu Feb 17 14:48:24 2011 -0500 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 183 insertions(+), 0 deletions(-) -commit f57153dd6786858ff2ab79c28227cd021755d693 +commit 7abcfd5b4db99bb0f50c5a47d346a2de3836f994 Author: John (J5) Palmieri -Date: Thu Feb 17 14:47:12 2011 -0500 +Date: Thu Feb 17 14:47:12 2011 -0500 [gi-demos] remove fixmes from print demo, fixed in pango demos/gtk-demo/demos/printing.py | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) -commit b8345be15c7f65e97f6bc148ad6c35ff80ff3870 +commit 9b13f49356da7d71c69b82da2a59d92f456a6913 Author: John (J5) Palmieri -Date: Wed Feb 16 19:39:30 2011 -0500 +Date: Wed Feb 16 19:39:30 2011 -0500 [gi-demos] add printing demo @@ -1369,21 +2973,21 @@ Date: Wed Feb 16 19:39:30 2011 -0500 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 177 insertions(+), 0 deletions(-) -commit 123877715145038a5877b8c538a48a1285f1ed54 +commit 6025b62ee662af347e48b6752e6d5be74b4a8215 Author: John (J5) Palmieri -Date: Wed Feb 16 17:52:38 2011 -0500 +Date: Wed Feb 16 17:52:38 2011 -0500 [gi-overrides] add cursor overrides https://bugzilla.gnome.org/show_bug.cgi?id=635947 - gi/overrides/Gdk.py | 41 +++++++++++++++++++++++++++++++++++++++++ + gi/overrides/Gdk.py | 41 +++++++++++++++++++++++++++++++++++++++++ tests/test_overrides.py | 23 +++++++++++++++++++++++ 2 files changed, 64 insertions(+), 0 deletions(-) -commit 68d72e015997da8d5732527c7ab96dd8c61fa664 +commit 03c0aa498470037ef2aa6a8233198ff521f8d42f Author: John (J5) Palmieri -Date: Wed Feb 16 16:18:24 2011 -0500 +Date: Wed Feb 16 16:18:24 2011 -0500 [gi-demos] add the links demo @@ -1391,9 +2995,9 @@ Date: Wed Feb 16 16:18:24 2011 -0500 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) -commit 00505a9a5445b85a091650a777a47f632ddc9d6d +commit 79ecddf8d54b3f4f8b5ef05d302675152622c832 Author: John (J5) Palmieri -Date: Wed Feb 16 15:48:40 2011 -0500 +Date: Wed Feb 16 15:48:40 2011 -0500 [gi-demos] add expander demo @@ -1401,20 +3005,20 @@ Date: Wed Feb 16 15:48:40 2011 -0500 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+), 0 deletions(-) -commit ed8710c7aa05cc0c919366536c94bf43955f1b71 +commit 76cdb13ab872f91f8384d26b0f2932087a746117 Author: John (J5) Palmieri -Date: Wed Feb 16 15:14:35 2011 -0500 +Date: Wed Feb 16 15:14:35 2011 -0500 [gi-overrides] use pop instead of del and add extra tests for Gtk.Table kwargs - gi/overrides/Gtk.py | 6 ++---- + gi/overrides/Gtk.py | 6 ++---- tests/test_overrides.py | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) -commit 888675f85c895a60d4432b992961ec3067da6e20 +commit 6ef83c049735689c42f085ca9d7b8e1f251c410f Author: Laszlo Pandy -Date: Tue Feb 15 20:07:42 2011 +0100 +Date: Tue Feb 15 20:07:42 2011 +0100 [tests] Separate processes for GI and static binding tests. @@ -1429,40 +3033,13 @@ Date: Tue Feb 15 20:07:42 2011 +0100 so that make does not continue. Otherwise you might miss the failures from the first batch of tests in the scrollback. - tests/Makefile.am | 29 ++++++++++++----------------- - tests/runtests.py | 4 +++- - 2 files changed, 15 insertions(+), 18 deletions(-) - -commit 71b0dd93d524afce9f4a4b0b393c8a16a1f70e2f -Author: Laszlo Pandy -Date: Tue Feb 15 16:26:24 2011 +0100 - - [GI] Remove implicit loading of gi module preserve the code path - for static bindings. - - Previously type lookups (as well as property accesses and signal - connects would trigger an import of the gi module). Now we make - those paths fail, and fallback to the old static binding code - paths *unless* the gi module is already in sys.modules. - - So if Python code calls: - from gi.repository import Gtk - - or even just: - import gi - - then everything will work just like it did without this patch. If gi - is not explicitly imported, the code skips the introspection code - and acts like the old static bindings did. - - https://bugzilla.gnome.org/show_bug.cgi?id=642387 + tests/Makefile.am | 19 +++++++++++-------- + tests/runtests.py | 4 +++- + 2 files changed, 14 insertions(+), 9 deletions(-) - gi/pygi.h | 10 ++++++++-- - 1 files changed, 8 insertions(+), 2 deletions(-) - -commit 97e78181813f15f693e650df5a8901bd2fe71541 +commit e0896b45f60f37097ec521f1bc38778383b78dd8 Author: John (J5) Palmieri -Date: Tue Feb 15 14:47:10 2011 -0500 +Date: Tue Feb 15 14:47:10 2011 -0500 [gi-demos] add dialogs demo @@ -1470,46 +3047,46 @@ Date: Tue Feb 15 14:47:10 2011 -0500 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 153 insertions(+), 0 deletions(-) -commit a23a48edafb9d08fec5411b828d1e0c6763e84af +commit 2dea743e82f6b18697950c34f116b2d0f1d6b1dd Author: John (J5) Palmieri -Date: Tue Feb 15 14:46:41 2011 -0500 +Date: Tue Feb 15 14:46:41 2011 -0500 [gi-overrides] fix typo in GtkTable constructor - gi/overrides/Gtk.py | 8 ++++---- + gi/overrides/Gtk.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) -commit bcccff3b2ad9c8054a4d5462c62cde566587eba6 +commit 9c277e1782c5a9d672d91fabf5289c5415891682 Author: John (J5) Palmieri -Date: Tue Feb 15 13:26:38 2011 -0500 +Date: Tue Feb 15 13:26:38 2011 -0500 [gi-demos] keep popup menu from destroying itself by holding a ref in app class - demos/gtk-demo/demos/clipboard.py | 8 ++++---- + demos/gtk-demo/demos/clipboard.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) -commit 9dc0979ba7d35b6ff9bb219a21926c2fd88451c7 +commit 18800c4db0e1faea38fd84f635d26a7ded5d10de Author: John (J5) Palmieri -Date: Tue Feb 15 13:25:13 2011 -0500 +Date: Tue Feb 15 13:25:13 2011 -0500 [gi-overrides] add a Gtk.Menu override for the popup method - gi/overrides/Gtk.py | 7 +++++++ + gi/overrides/Gtk.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) -commit 317278a3ddf15f1f9da53051295a0b533b1b1a11 +commit ad93386ba9f73ef4c3826544b3868cf03c01225e Author: John (J5) Palmieri -Date: Tue Feb 15 13:24:33 2011 -0500 +Date: Tue Feb 15 13:24:33 2011 -0500 [gi-demos] fix the about dialog in appwindow demo demos/gtk-demo/demos/appwindow.py | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) -commit cb2d2aad023789991b20036e22cae5ad3eee9b36 +commit d0c45c80974f05b6adfd3bb01d785be268a53a98 Author: John (J5) Palmieri -Date: Tue Feb 15 11:21:13 2011 -0500 +Date: Tue Feb 15 11:21:13 2011 -0500 [gi-demos] fix clipboard demo so DnD works @@ -1520,18 +3097,18 @@ Date: Tue Feb 15 11:21:13 2011 -0500 demos/gtk-demo/demos/clipboard.py | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) -commit 5434b7aac323170ea9469afbda520b801462c246 +commit 02d0327508234ab2e3b7dc6de506d70e6fcaaa17 Author: John (J5) Palmieri -Date: Tue Feb 15 10:18:53 2011 -0500 +Date: Tue Feb 15 10:18:53 2011 -0500 [gi-demos] fix clipboard demo to reflect new API - demos/gtk-demo/demos/clipboard.py | 6 +++--- + demos/gtk-demo/demos/clipboard.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) -commit b6c97de9680f3d5d629132415c1f7a9c42e558f8 +commit aa006cad6990eff0cbb68fa9550e428f2bc96473 Author: John (J5) Palmieri -Date: Mon Feb 14 18:17:20 2011 -0500 +Date: Mon Feb 14 18:17:20 2011 -0500 [gi-demo] Fix color dialog demo to run with new draw, style and color apis @@ -1540,9 +3117,9 @@ Date: Mon Feb 14 18:17:20 2011 -0500 ++++++++++++-------------------- 1 files changed, 17 insertions(+), 27 deletions(-) -commit 7147bd635fb03439a5f9edbce56c5558d092428c +commit f94a96c53e9432ac085bd05acee7ebdd2803fbad Author: John (J5) Palmieri -Date: Mon Feb 14 17:58:25 2011 -0500 +Date: Mon Feb 14 17:58:25 2011 -0500 [gi-demos] fix most of the combobox app @@ -1551,9 +3128,9 @@ Date: Mon Feb 14 17:58:25 2011 -0500 demos/gtk-demo/demos/combobox.py | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) -commit a64b8fe89492ae47172979f1900686455cd1f9a8 +commit 3606eb20ad1651af621bf1aa429ec102082565eb Author: Laszlo Pandy -Date: Mon Feb 14 19:36:27 2011 +0100 +Date: Mon Feb 14 19:36:27 2011 +0100 Use PyGI type conversion (to fix foreign types) for signal callbacks. @@ -1562,31 +3139,31 @@ Date: Mon Feb 14 19:36:27 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=637601 - gi/Makefile.am | 2 + - gi/gimodule.c | 1 + - gi/pygi-argument.c | 91 +++++++++++++++++ - gi/pygi-argument.h | 2 + - gi/pygi-private.h | 1 + + gi/Makefile.am | 2 + + gi/gimodule.c | 1 + + gi/pygi-argument.c | 91 +++++++++++++++++ + gi/pygi-argument.h | 2 + + gi/pygi-private.h | 1 + gi/pygi-signal-closure.c | 245 ++++++++++++++++++++++++++++++++++++++++++++++ gi/pygi-signal-closure.h | 46 +++++++++ - gi/pygi.h | 28 +++++ - gobject/pygobject.c | 24 ++++- + gi/pygi.h | 28 +++++ + gobject/pygobject.c | 24 ++++- 9 files changed, 436 insertions(+), 4 deletions(-) -commit 36ddad6af4a579c070171fd0522d7ffd93d5d73e +commit 2e39d5e8f96be2253acb2f34a0d0b5b9c9adb8ff Author: John (J5) Palmieri -Date: Mon Feb 14 16:47:03 2011 -0500 +Date: Mon Feb 14 16:47:03 2011 -0500 [gi-demos] fix drawingarea app to use the new draw api - demos/gtk-demo/demos/drawingarea.py | 144 + demos/gtk-demo/demos/drawingarea.py | 144 ++++++++++++----------------------- 1 files changed, 50 insertions(+), 94 deletions(-) -commit ddde83ebd4dbb179aa5388057a14faf32ece26ae +commit 8385afbbc5df295d9b7cd3b5d19c90faa1f7ea8e Author: John (J5) Palmieri -Date: Mon Feb 14 16:43:35 2011 -0500 +Date: Mon Feb 14 16:43:35 2011 -0500 [gi-overrides] for Gtk 3 alias Gdk.Rectangle to cairo.RectangleInt @@ -1595,12 +3172,12 @@ Date: Mon Feb 14 16:43:35 2011 -0500 bindings * we alias this so people do not get confused - gi/overrides/Gdk.py | 5 +++++ + gi/overrides/Gdk.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) -commit 8617d0e2a63771eba04983c7319f18638aa6d81e +commit d491c369e049ab726f09002af0462391d5c2f3ec Author: John (J5) Palmieri -Date: Mon Feb 14 15:07:11 2011 -0500 +Date: Mon Feb 14 15:07:11 2011 -0500 [gi-overrides] let user set the proper property names in Gtk.Table @@ -1610,193 +3187,153 @@ Date: Mon Feb 14 15:07:11 2011 -0500 * The GTK properties are n_columns and n_rows * support both - gi/overrides/Gtk.py | 8 ++++++++ + gi/overrides/Gtk.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) -commit 09c0534e4ac673ffdbfb41bc0aa34353be3b88e2 +commit 95bc2b2b025d659725d701c3b759c0c4d9681a36 Author: John (J5) Palmieri -Date: Mon Feb 14 15:06:38 2011 -0500 +Date: Mon Feb 14 15:06:38 2011 -0500 [gi-demos] get appwindow demo working again demos/gtk-demo/demos/appwindow.py | 24 ++++-------------------- 1 files changed, 4 insertions(+), 20 deletions(-) -commit 1944349cc59ddaf4fd7308ffce10b521c885c88b +commit 015185f502c498c21cb108d3bb288c5b6dbf202f Author: John (J5) Palmieri -Date: Mon Feb 14 15:05:44 2011 -0500 +Date: Mon Feb 14 15:05:44 2011 -0500 [gi-demos] fixed use of tree_iter_get - demos/gtk-demo/gtk-demo.py | 2 +- + demos/gtk-demo/gtk-demo.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit 29efc5a31c2879cefcf31d1d9bdbab65052d3b24 -Author: John (J5) Palmieri -Date: Fri Feb 11 11:18:24 2011 -0500 +commit 0c20977e4598e5447dd07c069e91226efacb1160 +Author: Simon van der Linden +Date: Fri Feb 11 22:02:03 2011 +0100 - pre-release version bump + Remove last GIO-related bits - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=638899 -commit 5dae6386ef74b6334daa3d0baf7c2e43d93a7e40 -Author: John (J5) Palmieri -Date: Fri Feb 11 11:05:04 2011 -0500 + PKG-INFO.in | 2 +- + README | 3 +- + configure.ac | 3 -- + examples/gio/directory-async.py | 33 ----------------- + examples/gio/downloader.py | 77 + --------------------------------------- + pygobject.doap | 2 +- + 6 files changed, 3 insertions(+), 117 deletions(-) + +commit e4ebbd7de5570af1abf41bdf9469d4ce3edd48cb +Author: Simon van der Linden +Date: Fri Feb 11 18:38:27 2011 +0100 + + Remove GIO documentation - bump version and edit NEWS for release + https://bugzilla.gnome.org/show_bug.cgi?id=638899 - NEWS | 289 + docs/Makefile.am | 82 +- + docs/reference/pygio-appinfo.xml | 894 ----- + docs/reference/pygio-applaunchcontext.xml | 194 -- + docs/reference/pygio-asyncresult.xml | 117 - + docs/reference/pygio-bufferedinputstream.xml | 461 --- + docs/reference/pygio-bufferedoutputstream.xml | 275 -- + docs/reference/pygio-cancellable.xml | 290 -- + docs/reference/pygio-classes.xml | 47 - + docs/reference/pygio-constants.xml | 1540 --------- + docs/reference/pygio-datainputstream.xml | 799 ----- + docs/reference/pygio-dataoutputstream.xml | 504 --- + docs/reference/pygio-drive.xml | 546 --- + docs/reference/pygio-emblem.xml | 232 -- + docs/reference/pygio-emblemedicon.xml | 160 - + docs/reference/pygio-file.xml | 4534 + ------------------------- + docs/reference/pygio-fileattributeinfo.xml | 73 - + docs/reference/pygio-fileenumerator.xml | 488 --- + docs/reference/pygio-fileicon.xml | 109 - + docs/reference/pygio-fileinfo.xml | 346 -- + docs/reference/pygio-fileinputstream.xml | 214 -- + docs/reference/pygio-filemonitor.xml | 128 - + docs/reference/pygio-fileoutputstream.xml | 257 -- + docs/reference/pygio-filterinputstream.xml | 152 - + docs/reference/pygio-filteroutputstream.xml | 152 - + docs/reference/pygio-functions.xml | 395 --- + docs/reference/pygio-icon.xml | 217 -- + docs/reference/pygio-inputstream.xml | 730 ---- + docs/reference/pygio-loadableicon.xml | 198 -- + docs/reference/pygio-memoryinputstream.xml | 151 - + docs/reference/pygio-memoryoutputstream.xml | 175 - + docs/reference/pygio-mount.xml | 962 ------ + docs/reference/pygio-mountoperation.xml | 726 ---- + docs/reference/pygio-outputstream.xml | 140 - + docs/reference/pygio-seekable.xml | 231 -- + docs/reference/pygio-simpleasyncresult.xml | 317 -- + docs/reference/pygio-themedicon.xml | 204 -- + docs/reference/pygio-unixinputstream.xml | 202 -- + docs/reference/pygio-unixoutputstream.xml | 202 -- + docs/reference/pygio-volume.xml | 718 ---- + docs/reference/pygio-volumemonitor.xml | 844 ----- + docs/reference/pygiounix-classes.xml | 13 - + docs/reference/pygobject-ref.xml | 2 - + 42 files changed, 1 insertions(+), 19020 deletions(-) + +commit abdebc7f6515f9658812c0355d8ad0892e5371e4 +Author: John (J5) Palmieri +Date: Fri Feb 11 11:05:04 2011 -0500 + + bump version to reflect the master branch moving towards pygobject 3.0 + + * added NEWS file from branch pygobject-2-28 + * bump to 2.90.1 + * this branch will drop support for the static binding + * use the pygobject-2-28 branch for static binding fixes + + NEWS | 289 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 2 +- - 2 files changed, 290 insertions(+), 1 deletions(-) + configure.ac | 4 +- + 2 files changed, 291 insertions(+), 2 deletions(-) -commit e12097a3fc006f435ae01156e55cacd7622a6e06 +commit 16140237aa45b4f188923da9f95b9d2af971011b Author: John (J5) Palmieri -Date: Thu Feb 10 16:46:08 2011 -0500 +Date: Thu Feb 10 16:46:08 2011 -0500 fix build to correctly use python-config - autogen.sh | 3 +++ - configure.ac | 6 ------ - m4/python.m4 | 9 +++++---- - tests/runtests.py | 1 + + autogen.sh | 3 +++ + configure.ac | 6 ------ + m4/python.m4 | 9 +++++---- + tests/runtests.py | 1 + 4 files changed, 9 insertions(+), 10 deletions(-) -commit 5ec107f805e32d4183b3c1a015d411992fc46a48 -Author: Martin Pitt -Date: Wed Feb 9 18:00:34 2011 +0100 - - Run gio tests separately when enabled - - As we can't load both gio and gi.repository.Gio at the same time, - run the gio - tests separately when gio is enabled. - - tests/Makefile.am | 13 ++++++++++++- - 1 files changed, 12 insertions(+), 1 deletions(-) - -commit 02ac041ba001bdda506f749e90aebc86a414d7c1 -Author: Martin Pitt -Date: Wed Feb 2 13:33:55 2011 +0100 - - Revert "Remove gio static bindings" - - This reverts commit bca5834fc8fa342149e0eec7b396877a2abe6d33. - - We still need the static gio bindings for now. - - https://bugzilla.gnome.org/show_bug.cgi?id=638899 - - Makefile.am | 2 +- - configure.ac | 22 +- - gio/.gitignore | 3 + - gio/Makefile.am | 117 + - gio/__init__.py | 40 + - gio/gappinfo.override | 213 ++ - gio/gapplaunchcontext.override | 99 + - gio/gbufferedinputstream.override | 70 + - gio/gcancellable.override | 38 + - gio/gdatainputstream.override | 250 ++ - gio/gdrive.override | 347 ++ - gio/gfile.override | 2215 +++++++++++ - gio/gfileattribute.override | 153 + - gio/gfileenumerator.override | 184 + - gio/gfileinfo.override | 121 + - gio/gfileinputstream.override | 68 + - gio/gfileiostream.override | 68 + - gio/gfileoutputstream.override | 68 + - gio/gicon.override | 310 ++ - gio/ginputstream.override | 344 ++ - gio/gio-types.defs | 807 ++++ - gio/gio.defs | 7465 - +++++++++++++++++++++++++++++++++++++ - gio/gio.override | 409 ++ - gio/giomodule.c | 208 + - gio/giostream.override | 68 + - gio/gmemoryinputstream.override | 91 + - gio/gmemoryoutputstream.override | 45 + - gio/gmount.override | 454 +++ - gio/goutputstream.override | 292 ++ - gio/gresolver.override | 312 ++ - gio/gsocket.override | 575 +++ - gio/gvolume.override | 237 ++ - gio/gvolumemonitor.override | 94 + - gio/pygio-utils.c | 236 ++ - gio/pygio-utils.h | 49 + - gio/unix-types.defs | 55 + - gio/unix.defs | 475 +++ - gio/unix.override | 62 + - gio/unixmodule.c | 52 + - tests/Makefile.am | 9 + - tests/runtests-windows.py | 3 + - tests/test_gcancellable.py | 15 + - tests/test_gicon.py | 112 + - tests/test_gio.py | 1138 ++++++ - tests/test_gresolver.py | 68 + - tests/test_gsocket.py | 126 + - 46 files changed, 18187 insertions(+), 2 deletions(-) - -commit a535e4af7c38fd7917d804470e8c46da4c2a86ea -Author: Steve Frécinaux -Date: Wed Feb 9 17:32:03 2011 +0100 - - Decrease the refcount for GInitiallyUnowned constructors. - - This mimicks the weird legacy pygtk behaviour and makes all the tests - pass despite the proper fixes having been reverted. - - https://bugzilla.gnome.org/show_bug.cgi?id=641525 - - gi/pygi-invoke.c | 4 ++++ - 1 files changed, 4 insertions(+), 0 deletions(-) - -commit 657d113c766c5ff9c5e7285ff5309283333983e4 -Author: Steve Frécinaux -Date: Wed Feb 9 17:03:30 2011 +0100 - - Ensure the sink functions are only ran once. - - This mitigates in a not-so-clean way the leak experienced in pygobject - for wrappers created multiple times, without breaking pygtk. - - https://bugzilla.gnome.org/show_bug.cgi?id=641525 - - gobject/pygobject.c | 23 +++++++++++++++-------- - 1 files changed, 15 insertions(+), 8 deletions(-) - -commit d32c0ecc6cde743047054e65355cbbfbf808d5ce -Author: Steve Frécinaux -Date: Wed Feb 9 17:15:41 2011 +0100 - - Revert "Fix wrong refcount when calling introspected widget - constructors" - - This reverts commit 7bc4122897d9d05172a2bd5b56bded87e2afaec4. +commit c2079f415638ef892b1e51f25eaafa3e1621667f +Author: Simon van der Linden +Date: Thu Feb 10 22:26:00 2011 +0100 - https://bugzilla.gnome.org/show_bug.cgi?id=641525 + Add missing libraries to link against - gobject/pygobject.c | 4 +--- - 1 files changed, 1 insertions(+), 3 deletions(-) + glib/Makefile.am | 2 +- + gobject/Makefile.am | 1 + + 2 files changed, 2 insertions(+), 1 deletions(-) -commit 4c9715b29f8883e23027cca10157ea96013b0dbc +commit 3cca62a9e7afd3d3d302c66f4fafe253f7743d4e Author: Steve Frécinaux -Date: Wed Feb 9 16:33:42 2011 +0100 +Date: Wed Jan 19 15:00:56 2011 +0100 - Revert "Fix reference leaks for GInitiallyUnowned objects" + Make runtests.py able to run command-line provided test files - This reverts commit f0a0b6c2eda89622de2b1e5ebb6a48103ad72a42. - The test cases have been kept. + With this patch we are now able to run ./runtests.py , which + is more friendly than defining an environment variable to run some + specific tests. - https://bugzilla.gnome.org/show_bug.cgi?id=641525 + https://bugzilla.gnome.org/show_bug.cgi?id=639948 - gobject/gobjectmodule.c | 2 -- - gobject/pygobject.c | 14 +++++++------- - 2 files changed, 7 insertions(+), 9 deletions(-) + tests/runtests.py | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) commit 14c4cf8e6edae893538680964380d543bde4a14d Author: Martin Pitt -Date: Wed Feb 9 11:34:59 2011 +0100 +Date: Wed Feb 9 11:34:59 2011 +0100 Run test suite under dbus-launch @@ -1806,24 +3343,24 @@ Date: Wed Feb 9 11:34:59 2011 +0100 session D-BUS (such as distribution package builds). - tests/Makefile.am | 3 ++- + tests/Makefile.am | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) commit 0858f550e2b6f75e3f583f963f5952f5ddae4e0e Author: Martin Pitt -Date: Tue Feb 8 15:46:36 2011 +0100 +Date: Tue Feb 8 15:46:36 2011 +0100 Fix test_gdbus.py to be Python3 friendly - TestCase.assert_() has been deprecated by assertTrue(). - Exceptions don't have a message attribute any more, use str(e) - tests/test_gdbus.py | 34 +++++++++++++++------------------- + tests/test_gdbus.py | 34 +++++++++++++++------------------- 1 files changed, 15 insertions(+), 19 deletions(-) commit b7f32e4cca0cef201489b55653f96ac64a8f9ab9 Author: Martin Pitt -Date: Sat Jan 29 12:20:50 2011 +0100 +Date: Sat Jan 29 12:20:50 2011 +0100 [gi] Provide comfortable GSettings API @@ -1833,15 +3370,15 @@ Date: Sat Jan 29 12:20:50 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640838 - gi/overrides/Gio.py | 54 ++++++++++++++++++++++++++++ + gi/overrides/Gio.py | 54 ++++++++++++++++++++++++++++ tests/org.gnome.test.gschema.xml | 9 +++++ - tests/test_overrides.py | 73 + tests/test_overrides.py | 73 ++++++++++++++++++++++++++++++------- 3 files changed, 122 insertions(+), 14 deletions(-) commit 8dad0eaed60a9de26e9a729a48a1f6bc74be486e Author: Laszlo Pandy -Date: Fri Feb 4 16:36:07 2011 +0100 +Date: Fri Feb 4 16:36:07 2011 +0100 Fix vfunc search bug when using GInterfaces and a do_* method. @@ -1852,13 +3389,13 @@ Date: Fri Feb 4 16:36:07 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=641493 - gi/types.py | 4 +++- + gi/types.py | 4 +++- tests/test_gi.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) commit 2660be1f227be7a53092483bc9d8ead1bd1fb266 Author: Laszlo Pandy -Date: Thu Feb 3 15:31:42 2011 +0100 +Date: Thu Feb 3 15:31:42 2011 +0100 [GI] Add tests for Gtk.Widget.drag_* methods. @@ -1872,20 +3409,40 @@ Date: Thu Feb 3 15:31:42 2011 +0100 tests/test_overrides.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) +commit d57500537014b3da624be33b40401ba289fa22b8 +Author: John (J5) Palmieri +Date: Thu Feb 3 09:02:16 2011 -0500 + + [gi] make caller allocates work again + + gi/pygi-cache.c | 18 +++--------------- + gi/pygi-invoke.c | 37 ++++++++++++++++++++++++++++++++++--- + 2 files changed, 37 insertions(+), 18 deletions(-) + +commit 99d6e6c8d806e6f9e48c3c2380024fb3511d110a +Author: John (J5) Palmieri +Date: Wed Feb 2 19:27:40 2011 -0500 + + [gi] fix container object reffing + + gi/pygi-argument.c | 7 +++---- + gi/pygi-cache.c | 12 ++++-------- + 2 files changed, 7 insertions(+), 12 deletions(-) + commit 09acaff29dfaabc77477cffca2c7137f68991e7f Author: Ignacio Casal Quinteiro -Date: Wed Feb 2 21:00:48 2011 +0100 +Date: Wed Feb 2 21:00:48 2011 +0100 [python 3] use the right syntaxis to raise exceptions - codegen/argtypes.py | 8 ++++---- + codegen/argtypes.py | 8 ++++---- codegen/definitions.py | 14 +++++++------- - gi/overrides/Gtk.py | 2 +- + gi/overrides/Gtk.py | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) commit 36094e5982d3e05d5662843b6d401f0974f5235f Author: Ignacio Casal Quinteiro -Date: Wed Feb 2 20:50:12 2011 +0100 +Date: Wed Feb 2 20:50:12 2011 +0100 [gi] return PYGLIB_MODULE_ERROR_RETURN on error and use pygobject_init @@ -1894,7 +3451,7 @@ Date: Wed Feb 2 20:50:12 2011 +0100 commit c913c1789296310c2cf27554ce719d7f6e9c94cd Author: Ignacio Casal Quinteiro -Date: Wed Feb 2 20:37:21 2011 +0100 +Date: Wed Feb 2 20:37:21 2011 +0100 [gi] return PYGLIB_MODULE_ERROR_RETURN on error @@ -1905,7 +3462,7 @@ Date: Wed Feb 2 20:37:21 2011 +0100 commit 7bc4122897d9d05172a2bd5b56bded87e2afaec4 Author: Steve Frécinaux -Date: Sat Jan 29 00:16:50 2011 +0100 +Date: Sat Jan 29 00:16:50 2011 +0100 Fix wrong refcount when calling introspected widget constructors @@ -1921,13 +3478,13 @@ Date: Sat Jan 29 00:16:50 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640868 - gobject/pygobject.c | 4 +++- + gobject/pygobject.c | 4 +++- tests/test_everything.py | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) commit afeaaa126f7cd6556fb855ecd0facc174c0f946c Author: Simon Schampijer -Date: Wed Jan 19 16:19:46 2011 +0100 +Date: Wed Jan 19 16:19:46 2011 +0100 Gdk.Window: Map the standard constructor to the *new* constructor @@ -1939,22 +3496,117 @@ Date: Wed Jan 19 16:19:46 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639936 - gi/overrides/Gdk.py | 6 ++++++ + gi/overrides/Gdk.py | 6 ++++++ tests/test_overrides.py | 8 ++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) +commit 4a67f45880433905de33632fe0c32a13b44c0b33 +Author: John (J5) Palmieri +Date: Mon Jan 31 16:51:37 2011 -0500 + + [gi] handle hash being NULL + + gi/pygi-argument.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 2fbfe410f4b4394a2018ada0e538585c1bec23ae +Author: John (J5) Palmieri +Date: Mon Jan 31 16:50:52 2011 -0500 + + [gi] handle the situation where an aux arg comes before its parent + + gi/pygi-cache.c | 70 + ++++++++++++++++++++++++++++++++++++++--------------- + gi/pygi-invoke.c | 2 +- + 2 files changed, 51 insertions(+), 21 deletions(-) + commit 858669f92c9907dd70b4966d6a8521ed122225be Author: Martin Pitt -Date: Mon Jan 31 17:38:52 2011 +0100 +Date: Mon Jan 31 17:38:52 2011 +0100 Ship tests/org.gnome.test.gschema.xml in dist tarballs - tests/Makefile.am | 3 ++- + tests/Makefile.am | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) +commit 77d76df59606e470808085e977fb199cc76e8251 +Author: John (J5) Palmieri +Date: Sun Jan 30 18:21:24 2011 -0500 + + [gi] allow caching and marshalling of ghash out + + gi/pygi-argument.c | 155 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + gi/pygi-cache.c | 27 ++++++--- + 2 files changed, 162 insertions(+), 20 deletions(-) + +commit bd66af67f248a3ca90d2fa2626605263c2392e16 +Author: John (J5) Palmieri +Date: Sun Jan 30 17:06:44 2011 -0500 + + [gi] whitespace fixes + + gi/pygi-cache.c | 60 + +++++++++++++++++++++++++++--------------------------- + 1 files changed, 30 insertions(+), 30 deletions(-) + +commit 1cdbd4be9b015f792c2c02afa5ac7e24edbdae86 +Author: John (J5) Palmieri +Date: Sun Jan 30 17:04:13 2011 -0500 + + [gi] added ugly aux arg counters + + * we need to simplify the ffi invoke so we can simply reference args + at their position in the C parameter list + * this works for now but is fragile if new aux values are added in + the future + + gi/pygi-argument.c | 12 ++++++++- + gi/pygi-cache.c | 66 + +++++++++++++++++++++++++++++++++++---------------- + gi/pygi-cache.h | 2 + + gi/pygi-invoke.c | 12 +++++++-- + 4 files changed, 66 insertions(+), 26 deletions(-) + +commit c51447f4efde2ce4caf39c1ffac905ec428d1d64 +Author: John (J5) Palmieri +Date: Sun Jan 30 11:30:54 2011 -0500 + + [gi] make inout marshalling work + + * refactor cache generation so we can create caches and then fill + in their + values based on if they are in, out or inout + * in invoke we order the pointers based on their direction + + gi/pygi-cache.c | 1445 + ++++++++++++++++++++++++++---------------------------- + gi/pygi-invoke.c | 19 +- + 2 files changed, 711 insertions(+), 753 deletions(-) + +commit 2b185362de45f46ce0f0b8816499aef06ab1ad1e +Author: John (J5) Palmieri +Date: Sat Jan 29 13:49:36 2011 -0500 + + [gi] marshal arrays out + + gi/pygi-argument.c | 101 + ++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 99 insertions(+), 2 deletions(-) + +commit e62e7062d5cfd782eac64852f681c63e2776b8d4 +Author: John (J5) Palmieri +Date: Sat Jan 29 13:48:23 2011 -0500 + + [gi] fix sequence caching to support out + + gi/pygi-cache.c | 111 + +++++++++++++++++++++++++++++++++++++++++++------------ + 1 files changed, 87 insertions(+), 24 deletions(-) + commit 69207910209ebfe450df616aeb8fa4cc2e7eccf3 Author: Martin Pitt -Date: Fri Jan 28 17:14:19 2011 +0100 +Date: Fri Jan 28 17:14:19 2011 +0100 [gi] Add GSettings tests @@ -1962,14 +3614,14 @@ Date: Fri Jan 28 17:14:19 2011 +0100 so let's first make sure that the canonical GLib API works. - tests/Makefile.am | 7 +++++-- + tests/Makefile.am | 7 +++++-- tests/org.gnome.test.gschema.xml | 16 ++++++++++++++++ - tests/test_overrides.py | 31 +++++++++++++++++++++++++++++++ + tests/test_overrides.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) commit 488478a83640d50baee963337fcc870fec76b784 Author: Martin Pitt -Date: Fri Jan 28 07:20:26 2011 +0100 +Date: Fri Jan 28 07:20:26 2011 +0100 [gi] Provide GtkTextBuffer.insert_with_tags_by_name() @@ -1978,13 +3630,13 @@ Date: Fri Jan 28 07:20:26 2011 +0100 consistent with the actual GTK API. - gi/overrides/Gtk.py | 19 ++++++++++++++----- + gi/overrides/Gtk.py | 19 ++++++++++++++----- tests/test_overrides.py | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) commit dace1a553793fb7fb054b60760f02c9e5cf00b38 Author: Martin Pitt -Date: Thu Jan 27 13:37:18 2011 +0100 +Date: Thu Jan 27 13:37:18 2011 +0100 [gi] Support tag names in GtkTextBuffer.insert_with_tags() @@ -1993,55 +3645,55 @@ Date: Thu Jan 27 13:37:18 2011 +0100 due to using varargs. As both are useful, support both cases in the override. - gi/overrides/Gtk.py | 5 +++++ + gi/overrides/Gtk.py | 5 +++++ tests/test_overrides.py | 9 +++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) commit 91d34124b2a5128e93e13c7fee8693d5edc4e9bb Author: Ignacio Casal Quinteiro -Date: Thu Jan 27 12:23:18 2011 +0100 +Date: Thu Jan 27 12:23:18 2011 +0100 Add MAINTAINERCLEANFILES This var behaves like .gitignore and allows us to skip some specific files. - Makefile.am | 27 +++++++++++++++++++++++++++ + Makefile.am | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) commit 8a98d26981ce68809a21c64cac4962e58c927905 Author: Ignacio Casal Quinteiro -Date: Thu Jan 27 12:15:30 2011 +0100 +Date: Thu Jan 27 12:15:30 2011 +0100 Remove .gitignore files and use git.mk git.mk is a script maintained in pango. From time to time we must check if it was updated and update it here. - .gitignore | 46 ---------- - Makefile.am | 2 + - codegen/.gitignore | 2 - - codegen/Makefile.am | 2 + - docs/.gitignore | 7 -- - docs/Makefile.am | 2 + - examples/Makefile.am | 2 + - gi/.gitignore | 40 --------- - gi/Makefile.am | 2 + - gi/overrides/Makefile.am | 2 + - gi/repository/Makefile.am | 2 + - gi/tests/Makefile.am | 2 + - git.mk | 200 + .gitignore | 46 ---------- + Makefile.am | 2 + + codegen/.gitignore | 2 - + codegen/Makefile.am | 2 + + docs/.gitignore | 7 -- + docs/Makefile.am | 2 + + examples/Makefile.am | 2 + + gi/.gitignore | 40 --------- + gi/Makefile.am | 2 + + gi/overrides/Makefile.am | 2 + + gi/repository/Makefile.am | 2 + + gi/tests/Makefile.am | 2 + + git.mk | 200 +++++++++++++++++++++++++++++++++++++++++++++ - glib/Makefile.am | 2 + - gobject/.gitignore | 3 - - gobject/Makefile.am | 2 + - tests/.gitignore | 2 - - tests/Makefile.am | 2 + + glib/Makefile.am | 2 + + gobject/.gitignore | 3 - + gobject/Makefile.am | 2 + + tests/.gitignore | 2 - + tests/Makefile.am | 2 + 18 files changed, 222 insertions(+), 100 deletions(-) commit 331c42b63bc60a3b906fa21e1c0a7c1b9428f347 Author: Martin Pitt -Date: Thu Jan 27 12:04:19 2011 +0100 +Date: Thu Jan 27 12:04:19 2011 +0100 pygi-convert.sh: Convert Pango.TabAlign.* @@ -2050,7 +3702,7 @@ Date: Thu Jan 27 12:04:19 2011 +0100 commit be1a2959fa0a3d8682e0e8aef389d73dacab0689 Author: Martin Pitt -Date: Thu Jan 27 12:02:39 2011 +0100 +Date: Thu Jan 27 12:02:39 2011 +0100 pygi-convert.sh: Drop window -> get_window() conversion @@ -2062,7 +3714,7 @@ Date: Thu Jan 27 12:02:39 2011 +0100 commit dd7deb4b658c56857c26b1a278a3d688f2ea6a2a Author: Martin Pitt -Date: Thu Jan 27 11:58:26 2011 +0100 +Date: Thu Jan 27 11:58:26 2011 +0100 pygi-convert.sh: Don't convert self.window assignments @@ -2071,19 +3723,19 @@ Date: Thu Jan 27 11:58:26 2011 +0100 commit 975341a26772966d4afc87a88a6a566d61237fa0 Author: Steve Frécinaux -Date: Fri Jan 21 18:41:54 2011 +0100 +Date: Fri Jan 21 18:41:54 2011 +0100 Fix leaked python reference in python-defined subclasses https://bugzilla.gnome.org/show_bug.cgi?id=640184 gobject/gobjectmodule.c | 1 + - tests/test_gobject.py | 4 ++++ + tests/test_gobject.py | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) commit a59e2d58bdb3f31a4f415dbe14b7d9988ac28ce3 Author: Steve Frécinaux -Date: Fri Jan 21 15:54:43 2011 +0100 +Date: Fri Jan 21 15:54:43 2011 +0100 Add some tests for the number of python refs held at creation time @@ -2094,21 +3746,21 @@ Date: Fri Jan 21 15:54:43 2011 +0100 commit 7d70105eb324ea4b6a58c2d3fb3f2dda36e7ab33 Author: Steve Frécinaux -Date: Fri Jan 21 17:24:49 2011 +0100 +Date: Fri Jan 21 17:24:49 2011 +0100 Factor out parameter marshalling from construction functions. https://bugzilla.gnome.org/show_bug.cgi?id=640197 - gobject/gobjectmodule.c | 35 ++------------------- - gobject/pygobject-private.h | 5 +++ - gobject/pygobject.c | 71 + gobject/gobjectmodule.c | 35 ++------------------- + gobject/pygobject-private.h | 5 +++ + gobject/pygobject.c | 71 +++++++++++++++++++++++++----------------- 3 files changed, 50 insertions(+), 61 deletions(-) commit a3e0cfe8924887ecd1e07cedd2cfb999c853ac62 Author: John (J5) Palmieri -Date: Wed Jan 26 15:34:24 2011 -0500 +Date: Wed Jan 26 15:34:24 2011 -0500 [gi] in python 3 an array of uint8 can be bytes but not string @@ -2117,22 +3769,22 @@ Date: Wed Jan 26 15:34:24 2011 -0500 commit 843553ea958eddec185bb660851a310dc050a14b Author: John (J5) Palmieri -Date: Wed Jan 26 15:30:06 2011 -0500 +Date: Wed Jan 26 15:30:06 2011 -0500 [gi] fix Gio.FileEnumerator to reflect the Python 3 iter protocol - gi/overrides/Gio.py | 6 +++++- + gi/overrides/Gio.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) commit 6ff357839feb39930a5f3175de3d0ed35f24d3f4 Author: John (J5) Palmieri -Date: Wed Jan 26 15:17:03 2011 -0500 +Date: Wed Jan 26 15:17:03 2011 -0500 [gi] python 3 fixes Patches need to work in Python 3 - here are some of the issues I fixed up. - Patch submitters should keep this in mind. When I note to only + Patch submitters should keep this in mind. When I note to only use something in tests it means that there is a compat module that is only available to the @@ -2149,9 +3801,9 @@ Date: Wed Jan 26 15:17:03 2011 -0500 issue * callable does not exist in 3.x, use hasattr(obj, '__call__') or - if sys.version_info > (3, 0): - def callable(obj): - return hasattr(obj, '__call__') + if sys.version_info > (3, 0): + def callable(obj): + return hasattr(obj, '__call__') * using unicode in tests is tricky, you can't use u'' even in a versioned @@ -2159,43 +3811,43 @@ Date: Wed Jan 26 15:17:03 2011 -0500 (and only i in tests): - from compathelper import _unicode - unicode_string = _unicode('this is a unicode string') + from compathelper import _unicode + unicode_string = _unicode('this is a unicode string') * exception caching changed in 2.7, instead of except Exception, e we now use except Exception as e. Do this to be compatible with older versions: - except Exception: - etype, e = sys.exc_info()[:2] + except Exception: + etype, e = sys.exc_info()[:2] * Unbound methods with an im_func attribute no longer exits in 3.x. Unbound methods are now just functions so class.method in 3.x is equivalent to class.method.im_func in 2.x. If you have to go this low level do this: - func = class1.method - if sys.version_info < (3,0): - func = func.im_func + func = class1.method + if sys.version_info < (3,0): + func = func.im_func * all numbers are long in 3.x so 42L is invalid in 3.x. In tests (and only in tests) do this: - from compathelper import _long - l = _long(42) + from compathelper import _long + l = _long(42) - gi/overrides/GLib.py | 16 ++++++++-------- - gi/types.py | 5 ++++- - tests/compathelper.py | 19 +++++++++++++++++++ - tests/test_gdbus.py | 12 ++++++++---- - tests/test_gi.py | 19 ++++++++++++------- + gi/overrides/GLib.py | 16 ++++++++-------- + gi/types.py | 5 ++++- + tests/compathelper.py | 19 +++++++++++++++++++ + tests/test_gdbus.py | 12 ++++++++---- + tests/test_gi.py | 19 ++++++++++++------- tests/test_overrides.py | 8 +++++--- 6 files changed, 56 insertions(+), 23 deletions(-) commit 832d662b9f90f5762bbf28b3cca73f947c1f83ce Author: John (J5) Palmieri -Date: Wed Jan 26 14:00:08 2011 -0500 +Date: Wed Jan 26 14:00:08 2011 -0500 [gi] fix try/except blocks using depricated raise format @@ -2205,7 +3857,7 @@ Date: Wed Jan 26 14:00:08 2011 -0500 commit d3e30e240fed6ef1dd40fd29fd13dc2effc6c7b1 Author: Martin Pitt -Date: Wed Jan 26 19:03:48 2011 +0100 +Date: Wed Jan 26 19:03:48 2011 +0100 [gi] Add docstring to GLib.Variant constructor @@ -2214,16 +3866,16 @@ Date: Wed Jan 26 19:03:48 2011 +0100 commit 963cd52fec26f7a4fb34414f8ac6662932ede322 Author: Martin Pitt -Date: Wed Jan 26 18:45:38 2011 +0100 +Date: Wed Jan 26 18:45:38 2011 +0100 [gi] update gdbus test cases for previous GVariant change - tests/test_gdbus.py | 4 ++-- + tests/test_gdbus.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 27e3a6276ff5f2cdc03ddf69ee80d44c3bf2c094 Author: Martin Pitt -Date: Wed Jan 26 18:39:17 2011 +0100 +Date: Wed Jan 26 18:39:17 2011 +0100 [gi] Accept only a single object in GLib.Variant constructor @@ -2243,13 +3895,13 @@ Date: Wed Jan 26 18:39:17 2011 +0100 Thanks to Ryan Lortie for pointing this out! - gi/overrides/GLib.py | 25 ++++++++++--------------- + gi/overrides/GLib.py | 25 ++++++++++--------------- tests/test_overrides.py | 32 +++++++++++++------------------- 2 files changed, 23 insertions(+), 34 deletions(-) commit b15e8e2c0c933d0f827a70280faf875ac383d81b Author: Laszlo Pandy -Date: Wed Jan 26 00:40:49 2011 +0100 +Date: Wed Jan 26 00:40:49 2011 +0100 Speed up _setup_native_vfuncs() @@ -2271,13 +3923,13 @@ Date: Wed Jan 26 00:40:49 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640629 - gi/types.py | 26 +++++++++++++------------- + gi/types.py | 26 +++++++++++++------------- tests/test_gi.py | 13 +++++++++++++ 2 files changed, 26 insertions(+), 13 deletions(-) commit 569d42ac2f50fb706ef289ff631db743483f40ee Author: Laszlo Pandy -Date: Thu Jan 20 16:26:18 2011 +0100 +Date: Thu Jan 20 16:26:18 2011 +0100 Speed up class creation: rewrite _setup_vfuncs() to be much more efficient. @@ -2305,14 +3957,14 @@ Date: Thu Jan 20 16:26:18 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640073 - gi/types.py | 104 + gi/types.py | 104 +++++++++++++++++++++++++++++++++--------------------- tests/test_gi.py | 13 +++++++ 2 files changed, 77 insertions(+), 40 deletions(-) commit 8f4e6536f3c2edf38a45632d1c23eb7c6681c3be Author: Sebastian Pölsterl -Date: Mon Jan 24 19:23:19 2011 +0100 +Date: Mon Jan 24 19:23:19 2011 +0100 pygi-convert.sh: Convert gtk.UI_MANAGER_* @@ -2321,7 +3973,7 @@ Date: Mon Jan 24 19:23:19 2011 +0100 commit 1f473b5164407a178203eb8cc7f3c786e0d0e5c2 Author: Sebastian Pölsterl -Date: Fri Jan 21 18:41:54 2011 +0100 +Date: Fri Jan 21 18:41:54 2011 +0100 pygi-convert.sh: Convert gdk.GRAB_* @@ -2330,40 +3982,114 @@ Date: Fri Jan 21 18:41:54 2011 +0100 commit f5d0b7b9d189f65503c0bf66d8bda4186ca3223a Author: Ignacio Casal Quinteiro -Date: Fri Jan 21 16:45:07 2011 +0100 +Date: Fri Jan 21 16:45:07 2011 +0100 [gi] set the gtype GValue correctly - gi/pygi-property.c | 4 ++-- + gi/pygi-property.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit ce521011d7f6d7f082aaea76fa05c5af9f6e93f5 Author: Ignacio Casal Quinteiro -Date: Fri Jan 21 16:20:23 2011 +0100 +Date: Fri Jan 21 16:20:23 2011 +0100 [gi] use the right argument type for callback - gi/pygi-foreign-cairo.c | 8 ++++---- - gi/pygi-foreign-gvariant.c | 4 ++-- - gi/pygi-foreign-gvariant.h | 2 +- - gi/pygi-foreign.c | 2 +- - gi/pygi.h | 2 +- + gi/pygi-foreign-cairo.c | 8 ++++---- + gi/pygi-foreign-gvariant.c | 4 ++-- + gi/pygi-foreign-gvariant.h | 2 +- + gi/pygi-foreign.c | 2 +- + gi/pygi.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) +commit 9f101baaa63a75acf62f955cfc4b311ff0dd5464 +Author: John (J5) Palmieri +Date: Fri Jan 21 09:23:54 2011 -0500 + + [gi] marshal out flags and enum + + gi/pygi-argument.c | 14 +++++++++----- + gi/pygi-cache.c | 24 ++++++++++++------------ + 2 files changed, 21 insertions(+), 17 deletions(-) + +commit 4c93bdeae76830aa4029dfc86e32e6f277d5271d +Author: John (J5) Palmieri +Date: Fri Jan 21 08:18:37 2011 -0500 + + [gi] marshal unions + + gi/pygi-cache.c | 27 +++++++++++++-------------- + 1 files changed, 13 insertions(+), 14 deletions(-) + commit a060287d1a6d190acb9d344f08fd5662e3296da5 Author: Martin Pitt -Date: Fri Jan 21 11:00:27 2011 +0100 +Date: Fri Jan 21 11:00:27 2011 +0100 [gi] Add test cases for GDBus client operations - tests/Makefile.am | 1 + - tests/test_gdbus.py | 94 + tests/Makefile.am | 1 + + tests/test_gdbus.py | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 0 deletions(-) +commit e7699d9af41f8c374326b8a4ec0939ef1426e386 +Author: John (J5) Palmieri +Date: Fri Jan 21 04:28:15 2011 -0500 + + [gi] error out if the constructor returns NULL + + gi/pygi-invoke.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 58ff2b2c38c1004861083ca88633be76767229f0 +Author: John (J5) Palmieri +Date: Fri Jan 21 04:26:45 2011 -0500 + + [gi] throw error for caller allocates until we can write code to + support it + + gi/pygi-cache.c | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit 5eb779439daa8bf1e86df689377dc10ef1430eab +Author: John (J5) Palmieri +Date: Fri Jan 21 04:26:11 2011 -0500 + + [gi] support struct out + + gi/pygi-argument.c | 30 ++++++++++++++++++++++++++---- + gi/pygi-cache.c | 15 ++------------- + 2 files changed, 28 insertions(+), 17 deletions(-) + +commit 3133dc595adf44279397d30712c0f8595f0e1acc +Author: John (J5) Palmieri +Date: Fri Jan 21 04:22:06 2011 -0500 + + [gi] move to using type_info and interface_info instead of arg_info + + * only arguments have arg_infos, not return types and instances so + type_info is much better to pass. In fact most API that took an + arg_info simply converted it to a type_info + * In the case of instances for methods we don't even have a type_info. + Since all instances are interfaces, we also attach the + interface_info + to the interface cache + + gi/pygi-argument.c | 20 ++++---------------- + gi/pygi-cache.c | 43 + ++++++++++++++++++++++++++++++++----------- + gi/pygi-cache.h | 4 +++- + gi/pygi-foreign-cairo.c | 24 ++++++++++++------------ + gi/pygi-foreign-gvariant.c | 11 +++++------ + gi/pygi-foreign-gvariant.h | 10 +++++----- + gi/pygi-foreign.c | 21 +++++++++------------ + gi/pygi-foreign.h | 6 +++--- + gi/pygi.h | 8 ++++---- + 9 files changed, 77 insertions(+), 70 deletions(-) + commit e97e28048efb966ecc1a03277d36cbaa81b8db7d Author: Martin Pitt -Date: Fri Jan 21 09:54:14 2011 +0100 +Date: Fri Jan 21 09:54:14 2011 +0100 [gi] Add Variant construction/unpack support for boxed Variants @@ -2372,20 +4098,20 @@ Date: Fri Jan 21 09:54:14 2011 +0100 currently does not work (see https://bugzilla.gnome.org/show_bug.cgi?id=639952) - gi/overrides/GLib.py | 18 +++++++++++++++++- + gi/overrides/GLib.py | 18 +++++++++++++++++- tests/test_overrides.py | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletions(-) commit 71dd03261fc06b8180c14cd31b54d8e4b200be3a Merge: bc29600 bd002c7 Author: Dieter Verfaillie -Date: Fri Jan 21 09:33:16 2011 +0100 +Date: Fri Jan 21 09:33:16 2011 +0100 Merge branch 'windows-setup-fixes' commit bc29600a2a04c972ceab7ef8d3292e8633977591 Author: Thomas Hindoe Paaboel Andersen -Date: Thu Jan 20 19:48:23 2011 +0100 +Date: Thu Jan 20 19:48:23 2011 +0100 pygi-convert.sh: GdkPixbuf methods @@ -2396,7 +4122,7 @@ Date: Thu Jan 20 19:48:23 2011 +0100 commit d1b0fa501cc431baa530d96fb50f4c35590890ac Author: Thomas Hindoe Paaboel Andersen -Date: Thu Jan 20 19:45:01 2011 +0100 +Date: Thu Jan 20 19:45:01 2011 +0100 pygi-convert.sh: Gdk.COLORSPACE_RGB @@ -2407,7 +4133,7 @@ Date: Thu Jan 20 19:45:01 2011 +0100 commit 6d8ff4d5bdda5480089543869535cc3ee83da2f5 Author: Martin Pitt -Date: Wed Jan 19 11:41:11 2011 +0100 +Date: Wed Jan 19 11:41:11 2011 +0100 [gi] Support nested objects and empty sequences in GLib.Variant building @@ -2427,23 +4153,34 @@ Date: Wed Jan 19 11:41:11 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639939 - gi/overrides/GLib.py | 229 + gi/overrides/GLib.py | 229 +++++++++++++++++++++++++---------------------- tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++-- 2 files changed, 273 insertions(+), 115 deletions(-) commit ac095f5435f106e175fa3297cb273e63c85d2809 Author: Tomeu Vizoso -Date: Thu Jan 20 15:55:45 2011 +0100 +Date: Thu Jan 20 15:55:45 2011 +0100 Uncomment test_gi.TestInterfaceClash tests/test_gi.py | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) +commit 1239f3709ba257c404dda72b7067b77b19c240fa +Author: John (J5) Palmieri +Date: Thu Jan 20 09:05:02 2011 -0500 + + [gi] add support for enum and flags + + gi/pygi-argument.c | 121 + ++++++++++++++++++++++++++++++++++++++++----------- + gi/pygi-cache.c | 30 +++++++------ + 2 files changed, 111 insertions(+), 40 deletions(-) + commit f0a0b6c2eda89622de2b1e5ebb6a48103ad72a42 Author: Steve Frécinaux -Date: Thu Jan 20 14:14:15 2011 +0100 +Date: Thu Jan 20 14:14:15 2011 +0100 Fix reference leaks for GInitiallyUnowned objects @@ -2454,17 +4191,17 @@ Date: Thu Jan 20 14:14:15 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639949 gobject/gobjectmodule.c | 2 + - gobject/pygobject.c | 14 +++++----- - tests/test-floating.c | 36 ++++++++++++++++++++++++++ - tests/test-floating.h | 21 +++++++++++++++ - tests/test_gobject.py | 63 + gobject/pygobject.c | 14 +++++----- + tests/test-floating.c | 36 ++++++++++++++++++++++++++ + tests/test-floating.h | 21 +++++++++++++++ + tests/test_gobject.py | 63 ++++++++++++++++++++++++++++++++++++++++++++++ tests/testhelpermodule.c | 50 ++++++++++++++++++++++++++++++++++++ 6 files changed, 179 insertions(+), 7 deletions(-) commit cae2cf3d4fb049c94389bf8f84d7d97a544d7a3f Author: Steve Frécinaux -Date: Wed Jan 19 16:57:57 2011 +0100 +Date: Wed Jan 19 16:57:57 2011 +0100 Add tests for refcount of a GObject owned by a library @@ -2474,16 +4211,16 @@ Date: Wed Jan 19 16:57:57 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639949 - tests/test-floating.c | 30 ++++++++++++++++++++++ - tests/test-floating.h | 20 +++++++++++++++ - tests/test_gobject.py | 62 + tests/test-floating.c | 30 ++++++++++++++++++++++ + tests/test-floating.h | 20 +++++++++++++++ + tests/test_gobject.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++ tests/testhelpermodule.c | 51 +++++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 0 deletions(-) commit b6737b91938d527872eff1d645a205cacf94e15d Author: Steve Frécinaux -Date: Wed Jan 19 14:52:41 2011 +0100 +Date: Wed Jan 19 14:52:41 2011 +0100 Add a test to check for regular object reference count @@ -2494,7 +4231,7 @@ Date: Wed Jan 19 14:52:41 2011 +0100 commit 2b0f1ede820414ef1cfd6b37569fcb946d2031fc Author: Martin Pitt -Date: Thu Jan 20 14:15:52 2011 +0100 +Date: Thu Jan 20 14:15:52 2011 +0100 [gi] Update TreeView.enable_model_drag_{source,dest} to current GTK @@ -2504,12 +4241,12 @@ Date: Thu Jan 20 14:15:52 2011 +0100 Gtk.TreeView.enable_model_drag_{source,dest}(). Thus drop the explicit array length argument from the call in the override. - gi/overrides/Gtk.py | 2 -- + gi/overrides/Gtk.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) commit b59edf4f0f7cab44033f9d704d476e10ee0d0c0a Author: Steve Frécinaux -Date: Wed Jan 19 18:04:10 2011 +0100 +Date: Wed Jan 19 18:04:10 2011 +0100 Fix a typo in a private symbol name. @@ -2518,7 +4255,7 @@ Date: Wed Jan 19 18:04:10 2011 +0100 commit 6447688e283a8fb22de3ab68cbc06e34ad23d198 Author: Martin Pitt -Date: Thu Jan 20 11:49:08 2011 +0100 +Date: Thu Jan 20 11:49:08 2011 +0100 pygi-convert.sh: Convert glib.source_remove() @@ -2527,7 +4264,7 @@ Date: Thu Jan 20 11:49:08 2011 +0100 commit 84ee8de4bc00a8f901926cc6386d73c12dbd0b0b Author: Martin Pitt -Date: Thu Jan 20 11:42:34 2011 +0100 +Date: Thu Jan 20 11:42:34 2011 +0100 Fix typo in previous commit to actually convert glib.GError @@ -2536,7 +4273,7 @@ Date: Thu Jan 20 11:42:34 2011 +0100 commit b238cb614338f46e6feb7935cca0a55c7a929418 Author: Martin Pitt -Date: Thu Jan 20 11:40:14 2011 +0100 +Date: Thu Jan 20 11:40:14 2011 +0100 pygi-convert.sh: Move some glib bits which are better handled by gobject @@ -2546,7 +4283,7 @@ Date: Thu Jan 20 11:40:14 2011 +0100 commit 21c09a7ee294b59abb3eca6f64f13bf5c8a2fa0e Author: Laszlo Pandy -Date: Wed Jan 19 12:00:02 2011 +0100 +Date: Wed Jan 19 12:00:02 2011 +0100 Modify override for Gtk.Adjustment to allow position or keyword arguments in __init__(). @@ -2559,13 +4296,13 @@ Date: Wed Jan 19 12:00:02 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639934 - gi/overrides/Gtk.py | 14 ++++++++++++-- + gi/overrides/Gtk.py | 14 ++++++++++++-- tests/test_overrides.py | 34 +++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 9 deletions(-) commit d465e25297ad6589ff2cd0c00e11e8bd8ffe3f78 Author: Martin Pitt -Date: Wed Jan 19 22:52:51 2011 +0100 +Date: Wed Jan 19 22:52:51 2011 +0100 [gi] Fix small typo in previous commit @@ -2580,19 +4317,39 @@ Date: Wed Jan 19 22:52:51 2011 +0100 commit 2b8e1d0531dcb8f57dc9f2fddf25970bee3daa90 Author: Martin Pitt -Date: Wed Jan 19 20:18:19 2011 +0100 +Date: Wed Jan 19 20:18:19 2011 +0100 [gi] Add pythonic iterator and indexing for string GVariants This extends commit b1a98083c to also work for strings. - gi/overrides/GLib.py | 8 +++++++- + gi/overrides/GLib.py | 8 +++++++- tests/test_overrides.py | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletions(-) +commit 8efd14c87b35072cdd039bf223f8ced8f51be9bb +Author: John (J5) Palmieri +Date: Wed Jan 19 14:08:03 2011 -0500 + + [gi] return NULL if out_marshaller fails + + gi/pygi-invoke.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 5b1db41d60204c8021f47f43b85dac126c389c8d +Author: John (J5) Palmieri +Date: Wed Jan 19 13:57:54 2011 -0500 + + [gi] fix some transfer issues and test case failures + + gi/pygi-argument.c | 4 ++++ + gi/pygi-cache.c | 11 ++++++++--- + gi/pygi-invoke.c | 17 +++++++++-------- + 3 files changed, 21 insertions(+), 11 deletions(-) + commit 7c2f48bb6d67ec9a1ee5ac03a5aee34b54c6ebdd Author: Tomeu Vizoso -Date: Wed Jan 19 18:09:23 2011 +0100 +Date: Wed Jan 19 18:09:23 2011 +0100 Construct structs using default API constructor @@ -2603,12 +4360,12 @@ Date: Wed Jan 19 18:09:23 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=627444 gi/pygi-info.c | 37 +++++++++++++++++++++++++++++++++++++ - gi/types.py | 7 +++++++ + gi/types.py | 7 +++++++ 2 files changed, 44 insertions(+), 0 deletions(-) commit db7300e173388d9557dcd2333781bfaa6b021605 Author: Martin Pitt -Date: Wed Jan 19 18:54:39 2011 +0100 +Date: Wed Jan 19 18:54:39 2011 +0100 pygi-convert.sh: Migrate Gdk.Cursor constructor, and some cursor names @@ -2617,7 +4374,7 @@ Date: Wed Jan 19 18:54:39 2011 +0100 commit 4c1d4faddf1c9cb233c484da3eadd8e31c231f70 Author: Martin Pitt -Date: Wed Jan 19 18:43:29 2011 +0100 +Date: Wed Jan 19 18:43:29 2011 +0100 pygi-convert.sh: Handle .window attributes @@ -2630,7 +4387,7 @@ Date: Wed Jan 19 18:43:29 2011 +0100 commit b1049b947d073fb569ba900a4d5c8519482d831e Author: Tomeu Vizoso -Date: Wed Jan 19 17:35:09 2011 +0100 +Date: Wed Jan 19 17:35:09 2011 +0100 Also deal with foreign boxed structs @@ -2638,12 +4395,12 @@ Date: Wed Jan 19 17:35:09 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639967 - gi/pygi-argument.c | 4 ++-- + gi/pygi-argument.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 25b69ae257a12b6dc97ed3f2f7ea54b166ddbba1 Author: Laszlo Pandy -Date: Wed Jan 19 17:45:11 2011 +0100 +Date: Wed Jan 19 17:45:11 2011 +0100 [gi] Convert GErrors to GObject.GError exceptions, and throw them upon returning from calling the C function. @@ -2663,9 +4420,31 @@ Date: Wed Jan 19 17:45:11 2011 +0100 tests/test_gi.py | 10 ++++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) +commit 18b84767db1d66e3d6f09067ab19ffd4b82539ca +Author: John (J5) Palmieri +Date: Wed Jan 19 12:05:45 2011 -0500 + + [gi] fix out marshalling for a couple of int types + + gi/pygi-argument.c | 2 +- + gi/pygi-cache.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c5d7c730008275b2c585b2609fc2ff5e051cce47 +Author: John (J5) Palmieri +Date: Wed Jan 19 11:59:09 2011 -0500 + + [gi] fixed range checking and type conversion with unsigned and + large numbers + + gi/pygi-argument.c | 90 + +++++++++++++++++++++++++++++++++++++++++++--------- + gi/pygi-cache.c | 2 +- + 2 files changed, 76 insertions(+), 16 deletions(-) + commit e6fcafc6179e963cbae7774e7ee50415bde2c523 Author: Martin Pitt -Date: Wed Jan 19 17:03:06 2011 +0100 +Date: Wed Jan 19 17:03:06 2011 +0100 pygi-convert.sh: Don't convert glib -> GLib for now @@ -2683,7 +4462,7 @@ Date: Wed Jan 19 17:03:06 2011 +0100 commit 167261d556eab0d2e448c7ed28eef540a024ba1d Author: Tomeu Vizoso -Date: Wed Jan 19 16:47:08 2011 +0100 +Date: Wed Jan 19 16:47:08 2011 +0100 Link libregress.so to GIO_LIBS again @@ -2692,7 +4471,7 @@ Date: Wed Jan 19 16:47:08 2011 +0100 commit d143afa6da4f5b5f47be8df11fa41d7b47ab1794 Author: Laszlo Pandy -Date: Wed Jan 19 16:14:42 2011 +0100 +Date: Wed Jan 19 16:14:42 2011 +0100 Fix attributes 2BUTTON_PRESS and 3BUTTON_PRESS of Gdk.EventType. @@ -2700,30 +4479,88 @@ Date: Wed Jan 19 16:14:42 2011 +0100 because in Python attributes starting with a numeral causes a syntax error. - gi/overrides/Gdk.py | 7 +++++-- + gi/overrides/Gdk.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) +commit 4f5d20966d4a8c649e5fae584039621edab178f3 +Author: John (J5) Palmieri +Date: Wed Jan 19 10:02:40 2011 -0500 + + [gi] use correct format stings when setting errors + + gi/pygi-argument.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 7f08fd5c33ee5c9907f5becbe2f21fb7122d6e19 +Author: John (J5) Palmieri +Date: Wed Jan 19 09:45:09 2011 -0500 + + [gi] allow marshalling strings as None + + gi/pygi-argument.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 093242a9e125998cd07bf66fc4b2880f532a2e4d +Author: John (J5) Palmieri +Date: Wed Jan 19 09:41:56 2011 -0500 + + [gi] make error messages more detailed + + gi/pygi-argument.c | 2 +- + gi/pygi-cache.c | 18 +++++++++--------- + 2 files changed, 10 insertions(+), 10 deletions(-) + +commit f0b17605ed2eb917b350654b070984beb553eae3 +Author: John (J5) Palmieri +Date: Wed Jan 19 09:41:13 2011 -0500 + + [gi] allow marshalling None for hashes + + gi/pygi-argument.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 93f1b787ab8420300d1064c0237a0c2d8a2ac98f +Author: John (J5) Palmieri +Date: Wed Jan 19 09:40:37 2011 -0500 + + [gi] add marshalling to some out values + + gi/pygi-argument.c | 50 + +++++++++++++++++++++++++++++++++++++++++--------- + 1 files changed, 41 insertions(+), 9 deletions(-) + commit 614b6ca7f45c4acbee088fe74fecf279ed50cc0c Author: Sebastian Pölsterl -Date: Wed Jan 19 15:27:33 2011 +0100 +Date: Wed Jan 19 15:27:33 2011 +0100 [gi] Fixed typo in exception - gi/overrides/Gtk.py | 2 +- + gi/overrides/Gtk.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) +commit 5f16df31b5a5a9f45f702eee48c3a18899ea3f71 +Author: John (J5) Palmieri +Date: Wed Jan 19 09:13:44 2011 -0500 + + [gi] fix marshalling structs + + gi/pygi-argument.c | 47 +++++++++++++++++++++++++++++++++++------------ + gi/pygi-foreign.c | 18 ++++++++++++------ + gi/pygi-foreign.h | 8 ++++---- + 3 files changed, 51 insertions(+), 22 deletions(-) + commit b2189424f9dd6d3a4a5b9792f0d5843fc27657d1 Author: Sebastian Pölsterl -Date: Wed Jan 19 15:12:25 2011 +0100 +Date: Wed Jan 19 15:12:25 2011 +0100 [gi] Enable handling of Gdk.EventType.2BUTTON_PRESS and 3BUTTON_PRESS - gi/overrides/Gdk.py | 4 ++-- + gi/overrides/Gdk.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) commit 5eca5ff2c9509ec96158fe43b29f0fd951243efe Author: Martin Pitt -Date: Wed Jan 19 14:54:57 2011 +0100 +Date: Wed Jan 19 14:54:57 2011 +0100 Revert "Fix Pango FontDescription override" @@ -2741,91 +4578,132 @@ Date: Wed Jan 19 14:54:57 2011 +0100 This reverts commit 8878c57676091c08e66bc6cbe735d898cb420582. - gi/overrides/Pango.py | 5 ++++- + gi/overrides/Pango.py | 5 ++++- tests/test_overrides.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletions(-) commit 9e7b95b3676a1b502662523a9bd4ebe40ccb4845 Author: Tony Young -Date: Thu Dec 16 23:39:33 2010 +0000 +Date: Thu Dec 16 23:39:33 2010 +0000 Python iterator interface support for GFileEnumerator. - gi/overrides/Gio.py | 41 +++++++++++++++++++++++++++++++++++++++++ + gi/overrides/Gio.py | 41 +++++++++++++++++++++++++++++++++++++++++ gi/overrides/Makefile.am | 1 + tests/test_overrides.py | 20 ++++++++++++++++++++ 3 files changed, 62 insertions(+), 0 deletions(-) commit bca5834fc8fa342149e0eec7b396877a2abe6d33 Author: Tomeu Vizoso -Date: Fri Jan 7 12:10:37 2011 +0100 +Date: Fri Jan 7 12:10:37 2011 +0100 Remove gio static bindings https://bugzilla.gnome.org/show_bug.cgi?id=638899 - Makefile.am | 2 +- - configure.ac | 25 - - gio/.gitignore | 3 - - gio/Makefile.am | 117 - - gio/__init__.py | 40 - - gio/gappinfo.override | 213 -- + Makefile.am | 2 +- + configure.ac | 25 - + gio/.gitignore | 3 - + gio/Makefile.am | 117 - + gio/__init__.py | 40 - + gio/gappinfo.override | 213 -- gio/gapplaunchcontext.override | 99 - gio/gbufferedinputstream.override | 70 - - gio/gcancellable.override | 38 - - gio/gdatainputstream.override | 250 -- - gio/gdrive.override | 347 -- - gio/gfile.override | 2215 ----------- - gio/gfileattribute.override | 153 - - gio/gfileenumerator.override | 184 - - gio/gfileinfo.override | 121 - - gio/gfileinputstream.override | 68 - - gio/gfileiostream.override | 68 - + gio/gcancellable.override | 38 - + gio/gdatainputstream.override | 250 -- + gio/gdrive.override | 347 -- + gio/gfile.override | 2215 ----------- + gio/gfileattribute.override | 153 - + gio/gfileenumerator.override | 184 - + gio/gfileinfo.override | 121 - + gio/gfileinputstream.override | 68 - + gio/gfileiostream.override | 68 - gio/gfileoutputstream.override | 68 - - gio/gicon.override | 310 -- - gio/ginputstream.override | 344 -- - gio/gio-types.defs | 807 ---- - gio/gio.defs | 7465 + gio/gicon.override | 310 -- + gio/ginputstream.override | 344 -- + gio/gio-types.defs | 807 ---- + gio/gio.defs | 7465 ------------------------------------- - gio/gio.override | 409 -- - gio/giomodule.c | 208 - - gio/giostream.override | 68 - + gio/gio.override | 409 -- + gio/giomodule.c | 208 - + gio/giostream.override | 68 - gio/gmemoryinputstream.override | 91 - gio/gmemoryoutputstream.override | 45 - - gio/gmount.override | 454 --- - gio/goutputstream.override | 292 -- - gio/gresolver.override | 312 -- - gio/gsocket.override | 575 --- - gio/gvolume.override | 237 -- - gio/gvolumemonitor.override | 94 - - gio/pygio-utils.c | 236 -- - gio/pygio-utils.h | 49 - - gio/unix-types.defs | 55 - - gio/unix.defs | 475 --- - gio/unix.override | 62 - - gio/unixmodule.c | 52 - - tests/Makefile.am | 9 - - tests/runtests-windows.py | 3 - - tests/test_gcancellable.py | 15 - - tests/test_gicon.py | 112 - - tests/test_gio.py | 1138 ------ - tests/test_gresolver.py | 68 - - tests/test_gsocket.py | 126 - + gio/gmount.override | 454 --- + gio/goutputstream.override | 292 -- + gio/gresolver.override | 312 -- + gio/gsocket.override | 575 --- + gio/gvolume.override | 237 -- + gio/gvolumemonitor.override | 94 - + gio/pygio-utils.c | 236 -- + gio/pygio-utils.h | 49 - + gio/unix-types.defs | 55 - + gio/unix.defs | 475 --- + gio/unix.override | 62 - + gio/unixmodule.c | 52 - + tests/Makefile.am | 9 - + tests/runtests-windows.py | 3 - + tests/test_gcancellable.py | 15 - + tests/test_gicon.py | 112 - + tests/test_gio.py | 1138 ------ + tests/test_gresolver.py | 68 - + tests/test_gsocket.py | 126 - 46 files changed, 1 insertions(+), 18191 deletions(-) +commit 6ab3d8d286573289cf8e41eee31eb806621f6f43 +Author: John (J5) Palmieri +Date: Wed Jan 19 07:56:16 2011 -0500 + + [gi] switch from using (*arg). to arg-> when referencing union + memebers + + gi/pygi-argument.c | 54 + ++++++++++++++++++++++++++-------------------------- + 1 files changed, 27 insertions(+), 27 deletions(-) + +commit 762ccb3d2620ea22023446b6ae79f3a111d8b56a +Author: John (J5) Palmieri +Date: Wed Jan 19 07:49:52 2011 -0500 + + [gi] return FALSE when setting errors in the marshaller + + gi/pygi-argument.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit cbaba6357937cbed3ebd34d2db1cdd59d37df118 +Author: John (J5) Palmieri +Date: Wed Jan 19 07:14:18 2011 -0500 + + [gi] do arg counting in new invoke + + gi/pygi-cache.c | 2 ++ + gi/pygi-cache.h | 14 ++++++++------ + gi/pygi-invoke-state-struct.h | 2 +- + gi/pygi-invoke.c | 20 +++++++++++++++++++- + 4 files changed, 30 insertions(+), 8 deletions(-) + +commit f45033858bed70d7defec3f71f26aa5b3999d680 +Author: John (J5) Palmieri +Date: Wed Jan 19 06:35:45 2011 -0500 + + [gi] set length for uint8 in arrays in new invoke marshaller + + gi/pygi-argument.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + commit 09f7ca7e2378e6679002677ac3f4802f4cc7d9d5 Author: Ignacio Casal Quinteiro -Date: Wed Jan 19 12:04:15 2011 +0100 +Date: Wed Jan 19 12:04:15 2011 +0100 [gi] set length when marshalling guint8 erases - gi/pygi-argument.c | 1 + - tests/test_gi.py | 4 ++++ + gi/pygi-argument.c | 1 + + tests/test_gi.py | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) commit 22eee43e50a150ace80694213fb87be9f0c72f51 Author: Sebastian Pölsterl -Date: Wed Jan 19 10:27:47 2011 +0100 +Date: Wed Jan 19 10:27:47 2011 +0100 Convert Gdk.Pixbuf to GdkPixbuf.Pixbuf @@ -2834,7 +4712,7 @@ Date: Wed Jan 19 10:27:47 2011 +0100 commit a4b210d69c832629894090b7154ae194209b0c60 Author: Arnaud Charlet -Date: Tue Jan 18 18:31:29 2011 +0100 +Date: Tue Jan 18 18:31:29 2011 +0100 Disable calls to PyGILState_* when threads are disabled @@ -2844,13 +4722,24 @@ Date: Tue Jan 18 18:31:29 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=374603 - glib/pyglib.c | 12 ++++++++++++ - gobject/pygobject-private.h | 6 ++++++ + glib/pyglib.c | 12 ++++++++++++ + gobject/pygobject-private.h | 6 ++++++ 2 files changed, 18 insertions(+), 0 deletions(-) +commit 329afb6fb1b3c325a6a9de2b6aca91c64d51dd9f +Author: John (J5) Palmieri +Date: Tue Jan 18 12:31:57 2011 -0500 + + [gi] fix handling of garrays vs c arrays + + gi/pygi-argument.c | 9 +++++++-- + gi/pygi-cache.c | 2 ++ + gi/pygi-cache.h | 1 + + 3 files changed, 10 insertions(+), 2 deletions(-) + commit a000627ec3904b9414ce375aec8d144fc0c26248 Author: Martin Pitt -Date: Tue Jan 18 18:29:50 2011 +0100 +Date: Tue Jan 18 18:29:50 2011 +0100 pygi-convert.sh: Do not comment out set_cell_data_func() calls; these should be ported properly @@ -2860,7 +4749,7 @@ Date: Tue Jan 18 18:29:50 2011 +0100 commit 99ff4610fb5ece2fc8d2f9eba13e661968adf3f0 Author: Martin Pitt -Date: Tue Jan 18 18:26:01 2011 +0100 +Date: Tue Jan 18 18:26:01 2011 +0100 pygi-convert.sh: Fix match for adding missing imports @@ -2869,7 +4758,7 @@ Date: Tue Jan 18 18:26:01 2011 +0100 commit 3aa95011fad67df20370e92bf25236a34d7d08d3 Author: Martin Pitt -Date: Tue Jan 18 18:09:30 2011 +0100 +Date: Tue Jan 18 18:09:30 2011 +0100 pygi-convert.sh: Fix Gtk.Label handling to be idempotent @@ -2881,18 +4770,45 @@ Date: Tue Jan 18 18:09:30 2011 +0100 pygi-convert.sh | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) +commit f66051380c0432bf142774542ade2144adcd455e +Author: John (J5) Palmieri +Date: Tue Jan 18 11:44:27 2011 -0500 + + [gi] use correct union memeber when marshalling floats + + gi/pygi-argument.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + commit 36bc1c17e7d4189059337cc6a73c64edd819ec12 Author: Laszlo Pandy -Date: Tue Jan 18 17:29:52 2011 +0100 +Date: Tue Jan 18 17:29:52 2011 +0100 Remove trailing whitespace from gi/overrides/Gtk.py - gi/overrides/Gtk.py | 10 +++++----- + gi/overrides/Gtk.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) +commit 1006df1929a667716c25e74b35b8f14643358732 +Author: John (J5) Palmieri +Date: Tue Jan 18 11:24:06 2011 -0500 + + [gi] fix constructor invoking and add some support for interface + out values + + * constructors are now simplified and are treated like normal + static methods + which happen to return an instance + + gi/pygi-argument.c | 8 +-- + gi/pygi-cache.c | 132 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + gi/pygi-invoke.c | 9 ++-- + gi/types.py | 21 ++------ + 4 files changed, 142 insertions(+), 28 deletions(-) + commit 8878c57676091c08e66bc6cbe735d898cb420582 Author: Martin Pitt -Date: Tue Jan 18 16:47:10 2011 +0100 +Date: Tue Jan 18 16:47:10 2011 +0100 Fix Pango FontDescription override @@ -2907,36 +4823,50 @@ Date: Tue Jan 18 16:47:10 2011 +0100 commit efbbe71634037fa100b17327389b883b259cca54 Author: Martin Pitt -Date: Tue Jan 18 16:23:39 2011 +0100 +Date: Tue Jan 18 16:23:39 2011 +0100 tests: Respect existing $GI_TYPELIB_PATH This allows us to run the test suite against local typelibs. - tests/Makefile.am | 2 +- + tests/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) +commit c96ca383350e5b9b079d9a86464922314939c006 +Author: John (J5) Palmieri +Date: Tue Jan 18 07:16:40 2011 -0500 + + [gi] fix aux value offsets for methods and element size crashers + + * if the callable is a method we need to add 1 to the aux index + for in values so we grab the right argument cache + * use _pygi_g_type_info_size instead of _pygi_g_type_tag_size to + support all types + + gi/pygi-cache.c | 42 ++++++++++++++++++++++++------------------ + 1 files changed, 24 insertions(+), 18 deletions(-) + commit f56d85a7f39c2088bf9fd50b1b1e5b67c03104d3 Merge: 84d6142 7d997b6 Author: Sebastian Pölsterl -Date: Tue Jan 18 13:14:45 2011 +0100 +Date: Tue Jan 18 13:14:45 2011 +0100 Merge branch 'value' commit 7d997b6fe88343776c4d67a9f3437ba0c4122da0 Author: Sebastian Pölsterl -Date: Tue Jan 18 13:12:36 2011 +0100 +Date: Tue Jan 18 13:12:36 2011 +0100 GTK overrides: Do type conversion to column types of ListStore and TreeStore in set_value - gi/overrides/Gtk.py | 28 ++++++++++++++++++---------- + gi/overrides/Gtk.py | 28 ++++++++++++++++++---------- tests/test_overrides.py | 12 +++++++++++- 2 files changed, 29 insertions(+), 11 deletions(-) commit 84d6142c14a7ebfb7284d3db52e14d3393f93905 Author: Steve Frécinaux -Date: Mon Jan 17 18:57:58 2011 +0100 +Date: Mon Jan 17 18:57:58 2011 +0100 Always register a new GType when a GObject class is subclassed @@ -2954,13 +4884,13 @@ Date: Mon Jan 17 18:57:58 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=543056 - gobject/__init__.py | 6 +++--- - tests/test_gi.py | 21 ++------------------- + gobject/__init__.py | 6 +++--- + tests/test_gi.py | 21 ++------------------- 2 files changed, 5 insertions(+), 22 deletions(-) commit 30750ccef31e6c864628f418fc00e8c573d29a1b Author: Simon van der Linden -Date: Tue Jan 18 12:57:13 2011 +0100 +Date: Tue Jan 18 12:57:13 2011 +0100 Raise required versions of GLib and GObject-Introspection @@ -2971,7 +4901,7 @@ Date: Tue Jan 18 12:57:13 2011 +0100 commit 761e98d32729f5894f4c75a54c65ed11329dc9d5 Author: Martin Pitt -Date: Tue Jan 18 12:52:32 2011 +0100 +Date: Tue Jan 18 12:52:32 2011 +0100 pygi-convert.sh: Handle keysyms @@ -2980,7 +4910,7 @@ Date: Tue Jan 18 12:52:32 2011 +0100 commit d62cdfa38a675c1daf3bc12d5cd769434eea5dc8 Author: Martin Pitt -Date: Tue Jan 18 12:14:09 2011 +0100 +Date: Tue Jan 18 12:14:09 2011 +0100 GLib overrides: Add test case for array variant building @@ -2989,7 +4919,7 @@ Date: Tue Jan 18 12:14:09 2011 +0100 commit 69a78307f3762e3f54d28d98514cec7d31ff20db Author: Tomeu Vizoso -Date: Tue Jan 18 10:21:03 2011 +0100 +Date: Tue Jan 18 10:21:03 2011 +0100 Remove cairo.RectangleInt from the foreign module @@ -3001,7 +4931,7 @@ Date: Tue Jan 18 10:21:03 2011 +0100 commit 017680c9a5e163021628bf29543598861a3b600a Author: Tomeu Vizoso -Date: Tue Jan 18 10:20:25 2011 +0100 +Date: Tue Jan 18 10:20:25 2011 +0100 Dont try to guess the transfer if its a boxed @@ -3012,16 +4942,16 @@ Date: Tue Jan 18 10:20:25 2011 +0100 commit 771ef76574690eb98926249f38661d741d1ebbb0 Author: Ignacio Casal Quinteiro -Date: Tue Jan 18 12:02:01 2011 +0100 +Date: Tue Jan 18 12:02:01 2011 +0100 The tags can be Empty not None. - gi/overrides/Gtk.py | 2 +- + gi/overrides/Gtk.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) commit b1a98083cdc50653e1d7bfb809bdf089f833df3d Author: Martin Pitt -Date: Tue Jan 18 12:01:28 2011 +0100 +Date: Tue Jan 18 12:01:28 2011 +0100 Add Pythonic iterators and indexing to GVariant @@ -3031,14 +4961,14 @@ Date: Tue Jan 18 12:01:28 2011 +0100 Add corresponding test cases. - gi/overrides/GLib.py | 50 ++++++++++++++++++++++++++++++++++++++++++ + gi/overrides/GLib.py | 50 ++++++++++++++++++++++++++++++++++++++++++ tests/test_overrides.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 0 deletions(-) commit ecb9f824c503c529d43e585b4cdb4c1c9ab14593 Author: Martin Pitt -Date: Tue Jan 18 10:48:03 2011 +0100 +Date: Tue Jan 18 10:48:03 2011 +0100 Add GLib.Variant.unpack() @@ -3050,39 +4980,39 @@ Date: Tue Jan 18 10:48:03 2011 +0100 Add appropriate test case. - gi/overrides/GLib.py | 45 + gi/overrides/GLib.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/test_overrides.py | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletions(-) commit 31c73dee34a52fd22b5ff3a23adce92cea5ddc3d Author: Ignacio Casal Quinteiro -Date: Tue Jan 18 10:56:18 2011 +0100 +Date: Tue Jan 18 10:56:18 2011 +0100 Add override for gtk_text_buffer_insert_with_tags - gi/overrides/Gtk.py | 12 ++++++++++++ + gi/overrides/Gtk.py | 12 ++++++++++++ tests/test_overrides.py | 6 ++++++ 2 files changed, 18 insertions(+), 0 deletions(-) commit fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9 Author: Simon van der Linden -Date: Mon Jan 17 14:35:14 2011 +0100 +Date: Mon Jan 17 14:35:14 2011 +0100 Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES https://bugzilla.gnome.org/show_bug.cgi?id=620215 - gi/Makefile.am | 6 ++++-- - gio/Makefile.am | 2 +- - glib/Makefile.am | 2 +- - m4/python.m4 | 7 +++++-- - tests/Makefile.am | 2 +- + gi/Makefile.am | 6 ++++-- + gio/Makefile.am | 2 +- + glib/Makefile.am | 2 +- + m4/python.m4 | 7 +++++-- + tests/Makefile.am | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) commit bceec758b27e6c396d17a79424633b5dc9116f54 Author: Simon van der Linden -Date: Mon Jan 17 14:20:55 2011 +0100 +Date: Mon Jan 17 14:20:55 2011 +0100 Kill JD_CHECK_PYTHON_HEADERS @@ -3096,7 +5026,7 @@ Date: Mon Jan 17 14:20:55 2011 +0100 commit e2dea065da94d17a915abe1ce4671b1dc48e02c0 Author: Sebastian Pölsterl -Date: Mon Jan 17 19:09:27 2011 +0100 +Date: Mon Jan 17 19:09:27 2011 +0100 Revert "Override Gtk.Box.pack_start and pack_end to set default values to be compliant with pygtk" @@ -3143,6 +5073,19 @@ Date: Mon Jan 17 18:54:10 2011 +0100 pygi-convert.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) +commit 0586a83212a9f9234fe00659ae744ab04e7ccc67 +Author: John (J5) Palmieri +Date: Mon Jan 17 12:31:03 2011 -0500 + + support callbacks + + gi/pygi-argument.c | 68 ++++++++++++++++++++++++++++++++++++++++++-- + gi/pygi-cache.c | 80 + +++++++++++++++++++++++++++++++++++++++------------ + gi/pygi-cache.h | 13 +++++++- + gi/pygi-invoke.c | 2 +- + 4 files changed, 138 insertions(+), 25 deletions(-) + commit 914d3a0a29680f4d3aa0e1f8afdd625b017b013a Author: Sebastian Pölsterl Date: Mon Jan 17 16:57:53 2011 +0100 @@ -3426,6 +5369,29 @@ Date: Sat Jan 15 11:17:09 2011 -0600 pygi-convert.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) +commit 9be0f1f2dfb89150faf1827ef482feea03645149 +Author: John (J5) Palmieri +Date: Thu Jan 13 23:56:19 2011 -0500 + + [gi] implement aux arg handling for array lengths + + gi/pygi-argument.c | 8 ++++++++ + gi/pygi-cache.c | 36 ++++++++++++++++++++++++++++-------- + gi/pygi-cache.h | 1 - + gi/pygi-invoke.c | 8 ++++++-- + 4 files changed, 42 insertions(+), 11 deletions(-) + +commit cfca2f0a53a5c29f543875ca4cb83a2e18d3bc72 +Author: John (J5) Palmieri +Date: Thu Jan 13 21:07:25 2011 -0500 + + [gi] marshal in hashes + + gi/pygi-argument.c | 93 ++++++++++++++++++++++++++++++++++++++- + gi/pygi-cache.c | 122 + ++++++++++++++++++++++++++++++++++++--------------- + 2 files changed, 176 insertions(+), 39 deletions(-) + commit c36fbf4918c8557a8e274a12004a412da3b22b2c Author: Laszlo Pandy Date: Tue Jan 11 21:41:47 2011 +0100 @@ -3457,6 +5423,52 @@ Date: Thu Jan 13 00:02:20 2011 +0100 pygi-convert.sh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) +commit e9166ba5d19f2b586f65a3b83a671a5afd486d8f +Author: John (J5) Palmieri +Date: Wed Jan 12 16:50:30 2011 -0500 + + [gi] support for GList and GSList in + + gi/pygi-argument.c | 122 + +++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 116 insertions(+), 6 deletions(-) + +commit 9baf3240fbac103823ad0feaaf1c82e46d276722 +Author: John (J5) Palmieri +Date: Wed Jan 12 16:24:17 2011 -0500 + + [gi] handle allow_none for all args + + gi/pygi-cache.c | 3 ++- + gi/pygi-cache.h | 1 + + gi/pygi-invoke.c | 7 +++++++ + 3 files changed, 10 insertions(+), 1 deletions(-) + +commit d54d12c66226910952b0dc44c8d9514a7edaa6f2 +Author: John (J5) Palmieri +Date: Wed Jan 12 16:23:02 2011 -0500 + + [gi] fix marshalling fixed arrays + + * get the correct item_size and pass the GArray data not the GArray + + gi/pygi-argument.c | 39 ++++++++++++++++++++++----------------- + gi/pygi-cache.c | 3 ++- + 2 files changed, 24 insertions(+), 18 deletions(-) + +commit 3b0eff80d2ee35e0417476f0a170b9e178e3d1ee +Author: John (J5) Palmieri +Date: Tue Jan 11 17:20:43 2011 -0500 + + [gi] implement out arg handling + + gi/pygi-argument.c | 43 +++++++++-------------------------- + gi/pygi-cache.c | 22 ++++++++++++++---- + gi/pygi-invoke-state-struct.h | 13 ++++++++++ + gi/pygi-invoke.c | 50 + +++++++++++++++++++++++++++++++++++++++- + 4 files changed, 89 insertions(+), 39 deletions(-) + commit bd002c72675d35b5e60ab773181e7c36c30d2625 Author: Dieter Verfaillie Date: Tue Jan 11 22:21:18 2011 +0100 @@ -3475,6 +5487,33 @@ Date: Tue Jan 11 22:19:18 2011 +0100 setup.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) +commit c5c149be171895d292852df364541f14f0ec423a +Author: John (J5) Palmieri +Date: Tue Jan 11 15:39:09 2011 -0500 + + [gi] implemented return marshalling and started on out marshalling + + gi/pygi-argument.c | 387 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + gi/pygi-argument.h | 117 ++++++++++++++++ + gi/pygi-cache.c | 316 ++++++++++++++++++++++++++++++++++++++++++- + gi/pygi-cache.h | 8 +- + gi/pygi-invoke.c | 12 ++- + 5 files changed, 829 insertions(+), 11 deletions(-) + +commit 4fcca8518774ab89607196dfc52037e3da30ac8a +Author: John (J5) Palmieri +Date: Tue Jan 11 13:49:58 2011 -0500 + + [gi] flesh out interface in marshalling a bit more + + gi/pygi-argument.c | 74 + +++++++++++++++++++++++++++++++++++++++--------- + gi/pygi-cache.c | 79 + ++++++++++++++++++++++++++++++++++++++++----------- + gi/pygi-cache.h | 1 + + 3 files changed, 123 insertions(+), 31 deletions(-) + commit 4992dca9f5cea68d85eb2ed86105c9c6b8311d79 Author: Laszlo Pandy Date: Tue Jan 11 19:30:38 2011 +0100 @@ -3527,6 +5566,123 @@ Date: Tue Jan 11 19:26:50 2011 +0100 gi/module.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) +commit 369a75ba5fb64ff7a7c95d21f8bfe359e639e9ff +Author: John (J5) Palmieri +Date: Mon Jan 10 17:55:03 2011 -0500 + + [gi] add object and interface in marshalling + + * also remove the PyGIArgCleanup sinature as GDestroyNotify works + just fine + + gi/pygi-argument.c | 15 +++- + gi/pygi-cache.c | 182 + +++++++++++++++++++++++++++++++++++++++++++++++----- + gi/pygi-cache.h | 1 - + gi/pygi-invoke.c | 1 + + 4 files changed, 178 insertions(+), 21 deletions(-) + +commit 88531c58d0491a31dd319387237a03df5c9edc07 +Author: John (J5) Palmieri +Date: Mon Jan 10 15:33:56 2011 -0500 + + [gi] fix casting when marshaling a char to uint8 + + gi/pygi-argument.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 441da4a7346ca059630dbc820c5b46e4d0222f4b +Author: John (J5) Palmieri +Date: Mon Jan 10 15:07:16 2011 -0500 + + [gi] hook up invoke to the cache + + * We now can invoke with in values + * out, constructors and returns still don't work along with numerous + complex + in types + + gi/Makefile.am | 1 + + gi/pygi-argument.c | 60 +++++++++-------- + gi/pygi-argument.h | 60 ++++++++-------- + gi/pygi-cache.h | 6 +- + gi/pygi-invoke-state-struct.h | 26 +++++++ + gi/pygi-invoke.c | 149 + +++++++++++++++++++++++++++++++--------- + gi/pygi-invoke.h | 2 +- + gi/pygi-private.h | 1 + + 8 files changed, 208 insertions(+), 97 deletions(-) + +commit f32b1f494aa5d09b9b198f607722c819c6bbd808 +Author: John (J5) Palmieri +Date: Sun Jan 9 19:37:55 2011 -0500 + + hooked up caching stage and fixed segfaults + + * caching stage is hooked up but not used yet + * throws exceptions for everything that can not be cached yet + + gi/pygi-cache.c | 59 + ++++++++++++++++++++++++++++++++++++++++++----------- + gi/pygi-info.c | 3 ++ + gi/pygi-invoke.c | 5 ++++ + gi/pygi.h | 2 + + 4 files changed, 56 insertions(+), 13 deletions(-) + +commit c2bf1d4d9cf2e9f8e313528fe717f6279dad5da1 +Author: John (J5) Palmieri +Date: Sun Jan 9 18:05:31 2011 -0500 + + [gi] fix some function names + + gi/pygi-cache.c | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +commit 2ec4230a5180f048c26c2e4234b2a098d42f030b +Author: John (J5) Palmieri +Date: Sun Jan 9 15:58:06 2011 -0500 + + [gi] refactor cache structs so they inherit from ArgCache + + gi/pygi-argument.c | 122 ++++++++++--------- + gi/pygi-cache.c | 344 + ++++++++++++++++++++++++++++------------------------ + gi/pygi-cache.h | 50 ++++---- + 3 files changed, 273 insertions(+), 243 deletions(-) + +commit f4cdf0c0321285da015686fcb7115bd91bfd5c7c +Author: John (J5) Palmieri +Date: Sat Jan 8 20:45:11 2011 -0500 + + [gi]fix cache compile error - now compiles but cache still not + hooked up + + gi/Makefile.am | 2 + + gi/pygi-argument.c | 100 +++++++++++++++--------------- + gi/pygi-argument.h | 174 + +++++++++++++++++++++++++++++++++++++++++++--------- + gi/pygi-cache.c | 169 + ++++++++++++++++++++++++-------------------------- + gi/pygi-cache.h | 25 ++++--- + 5 files changed, 293 insertions(+), 177 deletions(-) + +commit 5f8f3044dd8085b2e8ce0bf70e9d52f05abf909d +Author: John (J5) Palmieri +Date: Sat Jan 8 19:10:29 2011 -0500 + + add sequence caching and array marshalling w/ item marshalling + + * simplify what we pass into the arg cache generators so we may + use them + for geneating marshalling caches for container items, not just + arguments + + gi/pygi-argument.c | 76 ++++++++++++++++- + gi/pygi-cache.c | 242 + ++++++++++++++++++++++------------------------------ + gi/pygi-cache.h | 4 +- + 3 files changed, 175 insertions(+), 147 deletions(-) + commit 202a268db7f98f5a3c525c6e65ec4bff1917257e Author: Emilio Pozuelo Monfort Date: Sat Jan 8 02:19:52 2011 +0000 @@ -3592,6 +5748,45 @@ Date: Fri Jan 7 09:07:35 2011 +0100 gi/pygi-argument.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) +commit 43849c51391fc9cd239697065c3d40fa02fb6783 +Author: John (J5) Palmieri +Date: Thu Jan 6 17:30:14 2011 -0500 + + whitespace fixes + + gi/pygi-cache.c | 24 ++++++++++++------------ + gi/pygi-cache.h | 42 +++++++++++++++++++++--------------------- + 2 files changed, 33 insertions(+), 33 deletions(-) + +commit 8b5b3d2bbbbdf5d26c83e9a6fe67121cbd77ebe1 +Author: John (J5) Palmieri +Date: Thu Jan 6 17:29:00 2011 -0500 + + add marshalling for basic types and add more skeleton code + + * still doesn't compile + + gi/pygi-argument.c | 708 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-argument.h | 35 +++- + gi/pygi-cache.c | 82 +++++-- + gi/pygi-cache.h | 41 +++- + 4 files changed, 832 insertions(+), 34 deletions(-) + +commit f554cf62848104d31518138ae85bc51acaafda67 +Author: John (J5) Palmieri +Date: Tue Jan 4 18:49:53 2011 -0500 + + first checkin of the new caching branch + + * this does not compile and is not hooked up to the build system + * lays out the caching data structures and some skeleton functions + + gi/pygi-cache.c | 480 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-cache.h | 104 ++++++++++++ + 2 files changed, 584 insertions(+), 0 deletions(-) + commit 8d5a7857876669f56bb03bf618bcfdcc290721c0 Author: Eitan Isaacson Date: Wed Dec 22 12:34:10 2010 -0800 diff --git a/Makefile.am b/Makefile.am index b9b9ed3..3b8b6fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,15 +1,9 @@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs codegen glib gobject gio examples +SUBDIRS = docs examples gi tests -if ENABLE_INTROSPECTION -SUBDIRS += gi -endif - -SUBDIRS += tests - -PLATFORM_VERSION = 2.0 +PLATFORM_VERSION = 3.0 CLEANFILES = EXTRA_DIST = \ @@ -20,7 +14,6 @@ EXTRA_DIST = \ PKG-INFO.in \ setup.py \ pygobject_postinstall.py \ - pygtk.py \ dsextras.py \ ChangeLog.pre-2.18 \ m4/as-ac-expand.m4 \ @@ -69,7 +62,6 @@ pkgpyexec_PYTHON = dsextras.py pkgpyexec_LTLIBRARIES = # python -pyexec_PYTHON = pygtk.py pyexec_LTLIBRARIES = # linker flags @@ -81,12 +73,9 @@ endif # install pth file. install-data-local: $(mkinstalldirs) $(DESTDIR)$(pythondir) - echo "gtk-$(PLATFORM_VERSION)" > $(DESTDIR)$(pyexecdir)/pygtk.pth install-exec-local: $(mkinstalldirs) $(DESTDIR)$(pyexecdir) - echo "gtk-$(PLATFORM_VERSION)" > $(DESTDIR)$(pyexecdir)/pygtk.pth uninstall-local: - rm -f $(DESTDIR)$(pythondir)/pygtk.pth $(DESTDIR)$(pyexecdir)/pygtk.pth EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)-$(PLATFORM).egg diff --git a/Makefile.in b/Makefile.in index e20eeca..1637831 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,14 +35,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_INTROSPECTION_TRUE@am__append_1 = gi -@PLATFORM_WIN32_TRUE@am__append_2 = -no-undefined +@PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined subdir = . DIST_COMMON = README $(am__configure_deps) $(pkgpyexec_PYTHON) \ - $(pyexec_PYTHON) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/PKG-INFO.in $(srcdir)/config.h.in \ - $(srcdir)/pygobject-2.0-uninstalled.pc.in \ - $(srcdir)/pygobject-2.0.pc.in $(top_srcdir)/configure \ + $(srcdir)/pygobject-3.0-uninstalled.pc.in \ + $(srcdir)/pygobject-3.0.pc.in $(top_srcdir)/configure \ $(top_srcdir)/docs/reference/entities.docbook.in \ $(top_srcdir)/docs/xsl/fixxref.py.in AUTHORS COPYING ChangeLog \ INSTALL NEWS compile config.guess config.sub depcomp \ @@ -59,7 +58,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = pygobject-2.0.pc pygobject-2.0-uninstalled.pc \ +CONFIG_CLEAN_FILES = pygobject-3.0.pc pygobject-3.0-uninstalled.pc \ docs/reference/entities.docbook docs/xsl/fixxref.py PKG-INFO CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -84,8 +83,7 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" \ - "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" \ - "$(DESTDIR)$(pkgconfigdir)" + "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pkgconfigdir)" LTLIBRARIES = $(pkgpyexec_LTLIBRARIES) $(pyexec_LTLIBRARIES) AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) @@ -111,7 +109,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = docs codegen glib gobject gio examples gi tests +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -178,8 +176,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ -GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GI_CFLAGS = @GI_CFLAGS@ @@ -298,7 +294,6 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ @@ -309,8 +304,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs codegen glib gobject gio examples $(am__append_1) tests -PLATFORM_VERSION = 2.0 +SUBDIRS = docs examples gi tests +PLATFORM_VERSION = 3.0 CLEANFILES = EXTRA_DIST = \ MANIFEST.in \ @@ -320,7 +315,6 @@ EXTRA_DIST = \ PKG-INFO.in \ setup.py \ pygobject_postinstall.py \ - pygtk.py \ dsextras.py \ ChangeLog.pre-2.18 \ m4/as-ac-expand.m4 \ @@ -366,11 +360,10 @@ pkgpyexec_PYTHON = dsextras.py pkgpyexec_LTLIBRARIES = # python -pyexec_PYTHON = pygtk.py pyexec_LTLIBRARIES = # linker flags -common_ldflags = -module -avoid-version $(am__append_2) +common_ldflags = -module -avoid-version $(am__append_1) EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)-$(PLATFORM).egg all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -427,9 +420,9 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -pygobject-2.0.pc: $(top_builddir)/config.status $(srcdir)/pygobject-2.0.pc.in +pygobject-3.0.pc: $(top_builddir)/config.status $(srcdir)/pygobject-3.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ -pygobject-2.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/pygobject-2.0-uninstalled.pc.in +pygobject-3.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/pygobject-3.0-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ docs/reference/entities.docbook: $(top_builddir)/config.status $(top_srcdir)/docs/reference/entities.docbook.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -546,44 +539,6 @@ uninstall-pkgpyexecPYTHON: cd "$(DESTDIR)$(pkgpyexecdir)" && rm -f $$filesc || exit $$?; \ echo " ( cd '$(DESTDIR)$(pkgpyexecdir)' && rm -f" $$fileso ")"; \ cd "$(DESTDIR)$(pkgpyexecdir)" && rm -f $$fileso -install-pyexecPYTHON: $(pyexec_PYTHON) - @$(NORMAL_INSTALL) - test -z "$(pyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" - @list='$(pyexec_PYTHON)'; dlist=; list2=; test -n "$(pyexecdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ - if test -f $$b$$p; then \ - $(am__strip_dir) \ - dlist="$$dlist $$f"; \ - list2="$$list2 $$b$$p"; \ - else :; fi; \ - done; \ - for file in $$list2; do echo $$file; done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pyexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pyexecdir)" || exit $$?; \ - done || exit $$?; \ - if test -n "$$dlist"; then \ - if test -z "$(DESTDIR)"; then \ - PYTHON=$(PYTHON) $(py_compile) --basedir "$(pyexecdir)" $$dlist; \ - else \ - PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pyexecdir)" $$dlist; \ - fi; \ - else :; fi - -uninstall-pyexecPYTHON: - @$(NORMAL_UNINSTALL) - @list='$(pyexec_PYTHON)'; test -n "$(pyexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - fileso=`echo "$$files" | sed 's|$$|o|'`; \ - echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pyexecdir)" && rm -f $$files || exit $$?; \ - echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$filesc ")"; \ - cd "$(DESTDIR)$(pyexecdir)" && rm -f $$filesc || exit $$?; \ - echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$fileso ")"; \ - cd "$(DESTDIR)$(pyexecdir)" && rm -f $$fileso install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @@ -923,7 +878,7 @@ check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -983,8 +938,7 @@ install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-pkgpyexecLTLIBRARIES \ - install-pkgpyexecPYTHON install-pyexecLTLIBRARIES \ - install-pyexecPYTHON + install-pkgpyexecPYTHON install-pyexecLTLIBRARIES install-html: install-html-recursive @@ -1026,7 +980,7 @@ ps-am: uninstall-am: uninstall-local uninstall-pkgconfigDATA \ uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ - uninstall-pyexecLTLIBRARIES uninstall-pyexecPYTHON + uninstall-pyexecLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive @@ -1046,24 +1000,21 @@ uninstall-am: uninstall-local uninstall-pkgconfigDATA \ install-pdf install-pdf-am install-pkgconfigDATA \ install-pkgpyexecLTLIBRARIES install-pkgpyexecPYTHON \ install-ps install-ps-am install-pyexecLTLIBRARIES \ - install-pyexecPYTHON install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-local uninstall-pkgconfigDATA \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-local uninstall-pkgconfigDATA \ uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ - uninstall-pyexecLTLIBRARIES uninstall-pyexecPYTHON + uninstall-pyexecLTLIBRARIES # install pth file. install-data-local: $(mkinstalldirs) $(DESTDIR)$(pythondir) - echo "gtk-$(PLATFORM_VERSION)" > $(DESTDIR)$(pyexecdir)/pygtk.pth install-exec-local: $(mkinstalldirs) $(DESTDIR)$(pyexecdir) - echo "gtk-$(PLATFORM_VERSION)" > $(DESTDIR)$(pyexecdir)/pygtk.pth uninstall-local: - rm -f $(DESTDIR)$(pythondir)/pygtk.pth $(DESTDIR)$(pyexecdir)/pygtk.pth egg: EGG_TMPDIR:=$(TMPDIR)/$(PACKAGE)-$(PACKAGE_VERSION) egg: $(top_srcdir)/gobject/gobject.la PKG-INFO diff --git a/NEWS b/NEWS index eeae929..c0ce9f3 100644 --- a/NEWS +++ b/NEWS @@ -1,77 +1,197 @@ -2.28.6 11-Jun-1011 +2.90.1 14-Aug-2011 (3.0 pre-release) + - pass exta keywords to the Box constructor (John (J5) Palmieri) + - add (Tree|List)Store set method override (John (J5) Palmieri) + - add test for object arrays (John (J5) Palmieri) + - only support C pointer arrays for structs and objects (John (J5) Palmieri) + - revert Gtk.Window override because it causes issues with subclasses (John (J5) Palmieri) + - take GIL in _pygi_invoke_closure_free (bug #647016) (Jonathan Matthew) + - Add a default parameter to GtkTreeModel.filter_new (Johan Dahlin) + - Add vbox/action_area properties (Johan Dahlin) + - Add a couple of constructors (Johan Dahlin) + - Do not always pass in user_data to callbacks. (Johan Dahlin) + - Add a default detail value for Widget.render_icon (Johan Dahlin) + - Add an override for Gdk.color_parse() (Johan Dahlin) + - Support function calling with keyword arguments in invoke. (Laszlo Pandy) + - remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN (John (J5) Palmieri) + - Fix gobject vs. gi.repository warning (Martin Pitt) + - make GObject and GLib able to take overrides (John (J5) Palmieri) + - avoid dependency issue by importing the internal gobject (John (J5) Palmieri) + - fix tests to use the new GLib module (John (J5) Palmieri) + - add DynamicGLibModule which works like DynamicGObjectModule (John (J5) Palmieri) + - refactor, add objects and types to the correct internal module (John (J5) Palmieri) + - rename the pyglib shared library so we don't load the old one (John (J5) Palmieri) + - refactor tests to only use PyGObject 3 syntax (John (J5) Palmieri) + - refactor the internal _glib module to import correct modules (John (J5) Palmieri) + - refactor to use the new internal _glib and _gobject modules (John (J5) Palmieri) + - refactor gi module to import and use internal _gobject module (John (J5) Palmieri) + - move the static bits internal to gi and refactor build files (John (J5) Palmieri) + - remove pygtk.py (John (J5) Palmieri) + - introspection is no longer optional (John (J5) Palmieri) + - up platform version to 3.0 (John (J5) Palmieri) + - [gi] Handle GVariants from callback return values (Martin Pitt) + - Handle GVariants for callback arguments (Martin Pitt) + - [gi] Fix crash: check return value of _invoke_state_init_from_callable_cache() before continuing. (Laszlo Pandy) + - [gi] Pass gtype as first parameter to vfuncs (instead of using kwargs). (Laszlo Pandy) + - remove codegen (John (J5) Palmieri) + - remove some left over ifdefs to complete merge of the invoke-rewrite branch (John (J5) Palmieri) + - rename pygi-invoke-ng to pygi-invoke (John (J5) Palmieri) + - make invoke-ng the only invoker (John (J5) Palmieri) + - Merge branch 'master' into invoke-rewrite (John (J5) Palmieri) + - Merge branch 'master' into invoke-rewrite (John (J5) Palmieri) + - split the marshalling routines into two source files (John (J5) Palmieri) + - Ship tests/te_ST@nouppera in release tarballs for tests to succeed (Martin Pitt) + - [invoke] break out caller_allocates allocating into its own function (John (J5) Palmieri) + - [invoke] missed a bit when removing constructor_class usage (John (J5) Palmieri) + - [invoke] don't hold on to the constructor class, just add a TODO (John (J5) Palmieri) + - [gi] Port test_properties from static gio to GI Gio (Martin Pitt) + - [python3] Fix maketrans import (Martin Pitt) + - [caching] remove all inline compiler flags (John (J5) Palmieri) + - [caching] refactor function names to be less confusing (John (J5) Palmieri) + - [overrides] deprecate the use of type keyword MessageDialog constructor (John (J5) Palmieri) + - gdbus tests: Fix hang if test case fails (Martin Pitt) + - use an enum instead of booleans to denote function type (John (J5) Palmieri) + - rename aux arguments to child arguments to make their purpose clearer (John (J5) Palmieri) + - Fixed the cairo example (Timo Vanwynsberghe) + - Add override binding for Gtk.ListStore.prepend(). (Adam Dingle) + - Fix crash in Gtk.TextIter overrides (Martin Pitt) + - use gssize instead of int for arg indexes (John (J5) Palmieri) + - [cache] remove refrence to default value as it is not implemented yet (John (J5) Palmieri) + - Handle arguments that are flags correctly (Sebastian Pölsterl) + - correctly initialize the _gi_cairo_functions array to be zero filled (John (J5) Palmieri) + - correctly initialize the _gi_cairo_functions array to be zero filled (John (J5) Palmieri) + - pass in the address of the gerror, not the gerror itself (John (J5) Palmieri) + - [gi] handle marshalling gerrors arguments for signals (John (J5) Palmieri) + - [gi-invoke-ng] fix NULL check to check before we access the cache struct (John (J5) Palmieri) + - [gi-tests] add test for PyGObject->PyObject TreeModel storage (John (J5) Palmieri) + - [gtk-overrides] special case TreeModel columns of PYGOBJECT types (John (J5) Palmieri) + - [gi-invoke-ng] copy structs when transfer is full for array (John (J5) Palmieri) + - [gtk-override] print warning if user imports Gtk 2.0 (John (J5) Palmieri) + - [gtk-overrides] allow the message_type keyword to be used for MessageDialogs (John (J5) Palmieri) + - Add support for enums in gobject.property (Johan Dahlin) + - Add support for enums in gobject.property (Johan Dahlin) + - [gi-invoke-ng] use g_slice for allocating GValues that are caller allocated (John (J5) Palmieri) + - [gi-invoke-ng] Convert Overflow errors to ValueErrors when marshalling integers (John (J5) Palmieri) + - [gi-invoke-ng] only cache caller allocates for interfaces as some API are broken (John (J5) Palmieri) + - [gi-invoke-ng] handle in pointer array marshalling (John (J5) Palmieri) + - Adding GPtrArray tests (Alex Eftimie) + - [gi-invoke-ng] fix array element offset calculations (John (J5) Palmieri) + - [gi] don't clean up arguments that weren't yet processed during in arg failure (John (J5) Palmieri) + - [gi-overrides] use new instead of init when constructing a GLib.VariantBuilder (John (J5) Palmieri) + - [gi-invoke-ng] actual code to import overrides (John (J5) Palmieri) + - [gi-invoke-ng] import pytypes so we get overrides (John (J5) Palmieri) + - [gi-invoke-ng] handle gvariants now that they are not foreign (John (J5) Palmieri) + - [gi-invoke-ng] do not try to clean up NULL arguments (John (J5) Palmieri) + - Merge branch 'master' into invoke-rewrite (John (J5) Palmieri) + - Merge branch 'master' into invoke-rewrite (John (J5) Palmieri) - closure: avoid double free crash (Ignacio Casal Quinteiro) - - [gi] backport of "GVariant has a GType" fe386a (John (J5) Palmieri) - - [gi] fixes to backport commit 6b5a65 - in older glib GVariants are still structs (John (J5) Palmieri) - - GVariantType is a boxed struct (Tomeu Vizoso) - - Use _gi.Struct to wrap fundamentals (Tomeu Vizoso) - Added __eq__ method for Gdk.Color and Gdk.RGBA (Jason Siefken) - - Remove useless import (Ignacio Casal Quinteiro) - - Revert "[gi] Removed hack to avoid using GLib.Variant.new_variant." (Ignacio Casal Quinteiro) - closure: Check the out arg is not null. Fixes bug #651812 (Ignacio Casal Quinteiro) + - Use constants instead of literals (Tomeu Vizoso) + - GVariant has now a GType, take that into account (Tomeu Vizoso) + - GVariantType is a boxed struct (Tomeu Vizoso) + - Use _gi.Struct to wrap fundamentals (Tomeu Vizoso) + - Merge gi/HACKING into /HACKING (Tomeu Vizoso) - Fix GC-related crash during PyGObject deallocation (Daniel Drake) + - [gi-invoke-ng] enable invoke-ng by default (John (J5) Palmieri) + - [gi-invoke-ng] add code to clean up when input values fail to marshal (John (J5) Palmieri) + - [gi-invoke-ng] add hash cleanup routines (John (J5) Palmieri) + - [gi-invoke-ng] handle arrays with transfers of GI_TRANSFER_CONTAINER (John (J5) Palmieri) + - [gi-invoke-ng] add list cleanup routines (John (J5) Palmieri) + - indentation fix (John (J5) Palmieri) + - [gi-invoke-ng] add out array cleanup (John (J5) Palmieri) + - [gi-invoke-ng] do not allocate null terminator for garray (John (J5) Palmieri) + - [gi-invoke-ng] add array cleanup for in arrays (John (J5) Palmieri) + - [gi-invoke-ng] remove remaining bits of the invoke stage state machine (John (J5) Palmieri) + - [gi-invoke-ng] revamp cleanup framework to be orthogonal to cache setup (John (J5) Palmieri) + - [gi-invoke-ng] stub out a cleaner way of cleaning up after ourselves (John (J5) Palmieri) + - Doc Extractor: Correct the logic of the --no-since option. (José Alburquerque) + - Doc Extractor: Add a --no-since option. (José Alburquerque) + - [gi-invoke-ng] tweek cleanup routines (John (J5) Palmieri) - Fix symbol names to be locale independent (Martin Pitt) - - Updated DOAP file (Sebastian Pölsterl) - -2.28.4 18-Apr-2011 - - Version bump to 2.24.4 (Sebastian Pölsterl) - - [gi] Don't create variant twice (Sebastian Pölsterl) - - pygi-convert.sh: Make sure the uppercase GObject module is imported instead of the lowercase (Sebastian Pölsterl) - - [gi] Removed hack to avoid using GLib.Variant.new_variant. (Sebastian Pölsterl) - - [gi] Added additional test case for GVariant handling (Sebastian Pölsterl) - - [gi] Added support for GVariant arguments (Sebastian Pölsterl) - - Fix ABI break in old static bindings. (Steve Frécinaux) - - fetch size from an enum type (Mike Gorse) + - [gi] pygi-convert.sh: Convert gtk.gdk.CROSSHAIR (Martin Pitt) + - [gi-invoke-ng] handle filename cleanup with the utf8 cleanup function (John (J5) Palmieri) + - [gi-invoke-ng] handle caller allocates cleanup (John (J5) Palmieri) + - [gi-invoke-ng] refactor the cleanup code and add utf8 cleanup as initial test (John (J5) Palmieri) + - use PyCapsule when importing pycairo/require pycairo 1.10.0 for python3 builds (John (J5) Palmieri) + - [python3] fix build. PYcairo_IMPORT doesn't exists anymore (Ignacio Casal Quinteiro) + - Updated DOAP file (Sebastian Pölsterl) + - [gi] Don't create variant twice (Sebastian Pölsterl) + - pygi-convert.sh: Make sure the uppercase GObject module is imported instead of the lowercase (Sebastian Pölsterl) + - [gi] Removed hack to avoid using GLib.Variant.new_variant. (Sebastian Pölsterl) + - [gi] Added additional test case for GVariant handling (Sebastian Pölsterl) + - [gi] Added support for GVariant arguments (Sebastian Pölsterl) + - fix static ABI for setting string gvalues from python objects (John (J5) Palmieri) - dsextras.py: ensure eol characters are preserved when writing template files (so \n does not become \r\n) (Dieter Verfaillie) + - dsextras.py: remove \r as wel as \n character (Dieter Verfaillie) + - use PyCapsule when importing pycairo/require pycairo 1.10.0 for python3 builds (John (J5) Palmieri) + - [python3] fix build. PYcairo_IMPORT doesn't exists anymore (Ignacio Casal Quinteiro) + - Updated DOAP file (Sebastian Pölsterl) + - [gi] Don't create variant twice (Sebastian Pölsterl) + - pygi-convert.sh: Make sure the uppercase GObject module is imported instead of the lowercase (Sebastian Pölsterl) + - [gi] Removed hack to avoid using GLib.Variant.new_variant. (Sebastian Pölsterl) + - [gi] Added additional test case for GVariant handling (Sebastian Pölsterl) + - [gi-invoke-ng] fix prototype (John (J5) Palmieri) + - [gi-invoke-ng] create new framework for cleaning up args (John (J5) Palmieri) + - [gi] Added support for GVariant arguments (Sebastian Pölsterl) + - [gi-invoke-ng] fix marshal header that is no longer part of pygi-arguments.h (John (J5) Palmieri) + - [gi-invoke-ng] code style space fixes (John (J5) Palmieri) + - [gi-invoke-ng] don't decref value taken from a dict as it is borrowed (John (J5) Palmieri) + - [gi-invoke-ng] return None when appropriate so we don't crash (John (J5) Palmieri) + - [gi-invoke-ng] fix aux value caching (John (J5) Palmieri) + - [gi-invoke-ng] backport handling flags with no gtype (John (J5) Palmieri) + - [gi-invoke-ng] backport raw gvalue handling (John (J5) Palmieri) + - [gi-invoke-ng] marshal instances seperately since they differ slightly from other args (John (J5) Palmieri) + - [gi-invoke-ng] refactor FunctionCache to be more generic CallableCache (John (J5) Palmieri) + - [gi-invoke-rewrite] backport glib error handling (John (J5) Palmieri) + - [gi-invoke-ng] backport closure passing from invoke (John (J5) Palmieri) + - [gi-invoke-ng] handle vfuncs and fix cosntrutors (John (J5) Palmieri) + - [gi-invoke-ng] handle foreign types correctly (John (J5) Palmieri) + - [gi] remove the class parameter from the argument list of constructors (John (J5) Palmieri) + - fix static ABI for setting string gvalues from python objects (John (J5) Palmieri) + - dsextras.py: ensure eol characters are preserved when writing template files (so \n does not become \r\n) (Dieter Verfaillie) + - dsextras.py: remove \r as wel as \n character (Dieter Verfaillie) + - [gi] make new invoke-ng codepath compile correctly (John (J5) Palmieri) + - [gi] conditionalize invoke code paths (John (J5) Palmieri) + - [gi] revert back to the type.py from master (John (J5) Palmieri) + - [gi] revert pygi-argument.h and move the invoke-ng code to pygi-marshal.h (John (J5) Palmieri) + - Merge branch 'master' into invoke-rewrite (John (J5) Palmieri) + - [gi] foreign types now take interface infos instead of type infos (John (J5) Palmieri) + - Fix GSchema tests for separate build tree (Martin Pitt) + - [gi] start of merge from master (John (J5) Palmieri) + - [gi] marshal raw closures (John (J5) Palmieri) + - pygi-convert.sh add GObject.xxx and webkit (John Stowers) + - pygi-convert.sh remove gobject tests, GObject works now (John Stowers) + - [gi-demos] add pickers demo (John (J5) Palmieri) + - [gi-demos] add menu demo (John (J5) Palmieri) + - [gi-overrides] fix exception block so it works in Python 2.5 (John (J5) Palmieri) + - Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" (Martin Pitt) + - setup.py: fix user_access_control option (Dieter Verfaillie) + - [gi] Respect the MessageType for Gtk.MessageDialog (Martin Pitt) + - [gi] Do not require signature for D-BUS methods without arguments (Martin Pitt) + - [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None (John Stowers) + - [gi-demos] dont try and run demos that represent directories (John Stowers) + - [gi-demos] some python 3 compat fixes (John (J5) Palmieri) + - [gi-demos] add liststore demo (John (J5) Palmieri) + - [gi-demos] catch the correct error class (John (J5) Palmieri) + - Do not leak python references when using the gobject.property() helper. (Steve Frécinaux) + - handle uchar as bytes, not strings in python 3 (John (J5) Palmieri) + - [gi-overrides] handle unichar gvalues when setting treemodels (John (J5) Palmieri) + - [gi-overrides] special case python 2 keywords that crept in (John (J5) Palmieri) + - check for the py3 _thread module in configure.ac if thread is not found (John (J5) Palmieri) + - [gi-demos] add iconview demo (John (J5) Palmieri) + - [gi] wrap the keyword argument in a dict so we don't break Python 2.5 (John (J5) Palmieri) + - [gi-demos] add the combobox with string ids section to the demos (John (J5) Palmieri) + - [gi-overrides] add an override for Gdk.RGBA (John (J5) Palmieri) + - [gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ master (John (J5) Palmieri) + - [gi-demos] add search entry demo (John (J5) Palmieri) + - [gi] wrap map in a list for Python 3 compat (John (J5) Palmieri) + - [gi-demos] fix up the validation combobox (John (J5) Palmieri) + - add overridesdir variable in the .pc file for 3rd party overrides (John (J5) Palmieri) + - setup.py: Set bdist_wininst user-access-control property (Dieter Verfaillie) + - Fix uninitialized variable in gi.require_version() (Martin Pitt) + - Run tests with LC_MESSAGES="C" (Martin Pitt) + - [gi-overrides] override Gtk.stock_lookup to not return success (John (J5) Palmieri) -2.28.3 23-Mar-2011 - - fix a typo when converting objects to strings gvalues (John (J5) Palmieri) - -2.28.2 22-Mar-2011 - - fix static ABI for setting string gvalues from python objects (John (J - - Fix GSchema tests for separate build tree (Martin Pitt) - - GIO tests: Fix remaining test case for separate build tree (Martin Pit - - GIO tests: Fix for separate build tree (Martin Pitt) - -2.28.1 21-Mar-2011 - - pygi-convert.sh remove gobject tests, GObject works now (John Stowers) - - pygi-convert.sh add GObject.xxx and webkit (John Stowers) - - [gi] marshal raw closures (John (J5) Palmieri) - - Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" (Martin Pit - - setup.py: fix user_access_control option (Dieter Verfaillie) - - [gi-overrides] fix marshalling pygobjects in treemodels (John (J5) Pal - - [gi] Respect the MessageType for Gtk.MessageDialog (Martin Pitt) - - [gi] Do not require signature for D-BUS methods without arguments (Mar - - [gi-demos] add pickers demo (John (J5) Palmieri) - - [gi-demos] add menu demo (John (J5) Palmieri) - - [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None - - [gi-demos] dont try and run demos that represent directories (John Sto - - [gi-overrides] fix exception block so it works in Python 2.5 (John (J5 - -2.28.0 08-Mar-2011 (stable) - - [gi-demos] some python 3 compat fixes (John (J5) Palmieri) - - [gi-demos] catch the correct error class (John (J5) Palmieri) - - Try not to sink objects returned by C functions. (Steve Frécinaux) - - Do not leak python references when using the gobject.property() helper. (Steve Frécinaux) - - [gi] fix try except blocks so they work in Python 2.5 (John (J5) Palmieri) - - handle uchar as bytes, not strings in python 3 (John (J5) Palmieri) - - [gi-overrides] handle unichar gvalues when setting treemodels (John (J5) Palmieri) - - [gi-overrides] special case python 2 keywords that crept in (John (J5) Palmieri) - - check for the py3 _thread module in configure.ac if thread is not found (John (J5) Palmieri) - - [gi-demos] add iconview demo (John (J5) Palmieri) - - [gi] wrap the keyword argument in a dict so we don't break Python 2.5 (John (J5) Palmieri) - - [gi-demos] add the combobox with string ids section to the demos (John (J5) Palmieri) - - [gi-overrides] add an override for Gdk.RGBA (John (J5) Palmieri) - - [gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ master (John (J5) Palmieri) - - [gi-demos] add search entry demo (John (J5) Palmieri) - - [gi] wrap map in a list for Python 3 compat (John (J5) Palmieri) - - [gi-demos] fix up the validation combobox (John (J5) Palmieri) - - add overridesdir variable in the .pc file for 3rd party overrides (John (J5) Palmieri) - - [gi] remove unref for closures since they are floating objects that get sunk (John (J5) Palmieri) - - setup.py: Set bdist_wininst user-access-control property (Dieter Verfaillie) - - Fix uninitialized variable in gi.require_version() (Martin Pitt) - - Run tests with LC_MESSAGES="C" (Martin Pitt) - - [gi-overrides] override Gtk.stock_lookup to not return success (John (J5) Palmieri) - 2.27.91 28-Feb-2011 (2.28 pre-release) - [gi-tests] use Gdk.test_simulate_button instead of emitting event ourselves (John (J5) Palmieri) - [gi-tests] tests for EventButton override. (Laszlo Pandy) diff --git a/PKG-INFO b/PKG-INFO index bfad894..9bd4bca 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 2.28.6 +Version: 2.90.1 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,8 +8,8 @@ Author-email: james@daa.com.au Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.gz -Description: Python bindings for GLib, GObject and GIO +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.90/pygobject-2.90.1.tar.gz +Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Linux diff --git a/PKG-INFO.in b/PKG-INFO.in index ac0e2e6..5cffe13 100644 --- a/PKG-INFO.in +++ b/PKG-INFO.in @@ -9,7 +9,7 @@ Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/@PYGOBJECT_MAJOR_VERSION@.@PYGOBJECT_MINOR_VERSION@/pygobject-@VERSION@.tar.gz -Description: Python bindings for GLib, GObject and GIO +Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Linux diff --git a/README b/README index c5a7089..24dae6c 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ Current maintainers: Gustavo J A M Carneiro Gian Mario Tagliaretti Tomeu Vizoso -This archive contains bindings for the GLib, GObject and GIO, +This archive contains bindings for the GLib, and GObject, to be used in Python. It is a fairly complete set of bindings, it's already rather useful, and is usable to write moderately complex programs. (see the examples directory for some examples @@ -45,7 +45,6 @@ Requirements * Python 2.3.5 or higher * Glib 2.22.4 or higher * GIO 2.22.4 or higher - * GIO-unix 2.22.4 or higher * libffi (optional) Copyright Information diff --git a/codegen/Makefile.am b/codegen/Makefile.am deleted file mode 100644 index f9886eb..0000000 --- a/codegen/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -PLATFORM_VERSION = 2.0 - -bin_SCRIPTS = pygobject-codegen-$(PLATFORM_VERSION) - -codegendir = $(pkgdatadir)/$(PLATFORM_VERSION)/codegen - -codegen_SCRIPTS = \ - code-coverage.py \ - codegen.py \ - createdefs.py \ - defsconvert.py \ - defsgen.py \ - docextract_to_xml.py \ - docgen.py \ - h2def.py \ - mergedefs.py \ - missingdefs.py \ - mkskel.py \ - scanvirtuals.py \ - scmexpr.py - -codegen_PYTHON = \ - __init__.py \ - argtypes.py \ - definitions.py \ - defsparser.py \ - docextract.py \ - override.py \ - reversewrapper.py - -EXTRA_DIST = $(codegen_SCRIPTS) README.defs pygobject-codegen-$(PLATFORM_VERSION).in - --include $(top_srcdir)/git.mk diff --git a/codegen/Makefile.in b/codegen/Makefile.in deleted file mode 100644 index 12a8cf9..0000000 --- a/codegen/Makefile.in +++ /dev/null @@ -1,576 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = codegen -DIST_COMMON = $(codegen_PYTHON) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/pygobject-codegen-2.0.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ - $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = pygobject-codegen-2.0 -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(codegendir)" \ - "$(DESTDIR)$(codegendir)" -SCRIPTS = $(bin_SCRIPTS) $(codegen_SCRIPTS) -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -py_compile = $(top_srcdir)/py-compile -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@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATADIR = @DATADIR@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FFI_CFLAGS = @FFI_CFLAGS@ -FFI_LIBS = @FFI_LIBS@ -FGREP = @FGREP@ -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@ -GLIB_MKENUMS = @GLIB_MKENUMS@ -GOBJECT_QUERY = @GOBJECT_QUERY@ -GREP = @GREP@ -INSTALL = @INSTALL@ -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@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -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@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -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@ -PYTHON = @PYTHON@ -PYTHON_BASENAME = @PYTHON_BASENAME@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -THREADING_CFLAGS = @THREADING_CFLAGS@ -VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ -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@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -PLATFORM_VERSION = 2.0 -bin_SCRIPTS = pygobject-codegen-$(PLATFORM_VERSION) -codegendir = $(pkgdatadir)/$(PLATFORM_VERSION)/codegen -codegen_SCRIPTS = \ - code-coverage.py \ - codegen.py \ - createdefs.py \ - defsconvert.py \ - defsgen.py \ - docextract_to_xml.py \ - docgen.py \ - h2def.py \ - mergedefs.py \ - missingdefs.py \ - mkskel.py \ - scanvirtuals.py \ - scmexpr.py - -codegen_PYTHON = \ - __init__.py \ - argtypes.py \ - definitions.py \ - defsparser.py \ - docextract.py \ - override.py \ - reversewrapper.py - -EXTRA_DIST = $(codegen_SCRIPTS) README.defs pygobject-codegen-$(PLATFORM_VERSION).in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign codegen/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign codegen/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -pygobject-codegen-2.0: $(top_builddir)/config.status $(srcdir)/pygobject-codegen-2.0.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files -install-codegenSCRIPTS: $(codegen_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(codegendir)" || $(MKDIR_P) "$(DESTDIR)$(codegendir)" - @list='$(codegen_SCRIPTS)'; test -n "$(codegendir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(codegendir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(codegendir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-codegenSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(codegen_SCRIPTS)'; test -n "$(codegendir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(codegendir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(codegendir)" && rm -f $$files - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-codegenPYTHON: $(codegen_PYTHON) - @$(NORMAL_INSTALL) - test -z "$(codegendir)" || $(MKDIR_P) "$(DESTDIR)$(codegendir)" - @list='$(codegen_PYTHON)'; dlist=; list2=; test -n "$(codegendir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ - if test -f $$b$$p; then \ - $(am__strip_dir) \ - dlist="$$dlist $$f"; \ - list2="$$list2 $$b$$p"; \ - else :; fi; \ - done; \ - for file in $$list2; do echo $$file; done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(codegendir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(codegendir)" || exit $$?; \ - done || exit $$?; \ - if test -n "$$dlist"; then \ - if test -z "$(DESTDIR)"; then \ - PYTHON=$(PYTHON) $(py_compile) --basedir "$(codegendir)" $$dlist; \ - else \ - PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(codegendir)" $$dlist; \ - fi; \ - else :; fi - -uninstall-codegenPYTHON: - @$(NORMAL_UNINSTALL) - @list='$(codegen_PYTHON)'; test -n "$(codegendir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - fileso=`echo "$$files" | sed 's|$$|o|'`; \ - echo " ( cd '$(DESTDIR)$(codegendir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(codegendir)" && rm -f $$files || exit $$?; \ - echo " ( cd '$(DESTDIR)$(codegendir)' && rm -f" $$filesc ")"; \ - cd "$(DESTDIR)$(codegendir)" && rm -f $$filesc || exit $$?; \ - echo " ( cd '$(DESTDIR)$(codegendir)' && rm -f" $$fileso ")"; \ - cd "$(DESTDIR)$(codegendir)" && rm -f $$fileso -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(SCRIPTS) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(codegendir)" "$(DESTDIR)$(codegendir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-codegenPYTHON install-codegenSCRIPTS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binSCRIPTS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binSCRIPTS uninstall-codegenPYTHON \ - uninstall-codegenSCRIPTS - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binSCRIPTS install-codegenPYTHON \ - install-codegenSCRIPTS install-data install-data-am \ - 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-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ - uninstall-codegenPYTHON uninstall-codegenSCRIPTS - - --include $(top_srcdir)/git.mk - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/codegen/README.defs b/codegen/README.defs deleted file mode 100644 index 5f7957e..0000000 --- a/codegen/README.defs +++ /dev/null @@ -1,351 +0,0 @@ - ChangeLog for this draft: - - caller-owns-return attribute on functions/methods - - include gtk-type-id in the type alias system - - c-name for types converted to in-c-name out-c-name inout-c-name - - merge unref-func and destroy-func for boxed types into release-func - - - split structs out of boxed types - - c-declaration field - - special "native" type alias; bail and use C declaration when - necessary - - defined objects and boxeds automatically create a module - - make constructors functions and not methods, in appropriate - object/boxed module - - Draft ========================= - - The overall syntax is: - - (type-of-thing-being-defined name-used-to-refer-to-this-thing - (attribute-name attribute-value-depending-on-the-attribute) - (attribute-name attribute-value-depending-on-the-attribute) - (attribute-name attribute-value-depending-on-the-attribute)) - - Some definitions can have a c-declaration field that gives the C code - we parsed to arrive at the definition. The c-declaration is a quoted - string because it can contain parentheses and such. - - Defined types and their attributes: - - === - (module module-name - (submodule-of module-name)) ;; submodule is optional - - Ex: (module Gtk) - Ex: (module Rgb - (submodule-of Gdk)) - - modules are later referred to with a list of module names, like - (Gdk Rgb) or (Gtk) - - Object and boxed type definitions automatically create a submodule. - For example, GtkCList creates the module (module CList (submodule-of - (Gtk))) which is referred to as module (Gtk CList). - - === - - (type - (alias some-unique-identifier) - (in-module module-name) ;; optional, gchar* is not in a module - (gtk-type-id gtk-type-system-id) ;; optional, absent if this is not - ;; in the type system - (in-c-name name-of-symbol-in-C) - (out-c-name name-of-symbol-in-C) - (inout-c-name name-of-symbol-in-C)) - - Ex: (type - (alias string) - (gtk-type-id GTK_TYPE_STRING) - (in-c-name const-gchar*) - (out-c-name gchar**) ;; actually I'm not sure how strings work - out/inout - (inout-c-name gchar*)) - - ;; This one would be implied by the (object) def for GtkWidget I - ;; think - (type) is only required for types that are not implied - ;; by other definitions, such as int/boolean/etc. - - (type - (alias GtkWidget) - (in-module (Gtk)) - (gtk-type-id GTK_TYPE_WIDGET) - (in-c-name GtkWidget*) - (inout-c-name GtkWidget*) - (out-c-name GtkWidget**)) - - "Type" bindings are automatically assumed for objects, boxed types, - etc. as defined below. - - The alias field is used to refer to the type later on. - - If the C type has spaces they are converted to hyphens after - compressing all syntactically significant whitespace to a single - space: - (type - (alias const-gchar* - (c-name const-gchar*))) - - So hyphens have to go back to spaces for binding generators that - output C code. - - Whenever a type alias can be used, it is also possible to use the - keyword "native", which implies that the type in question is too - C-specific to represent. Then a c-declaration will typically be - available for use. - - C types containing [] or () are function pointers or arrays. For - arrays that don't specify a size, we just treat them as pointers. For - function pointers, we need special (type) syntax/attributes of some - kind, but since there basically aren't any of these right now in the - libs we care about we can just ignore them. For arrays that specify a - size ditto, you would handle them by adding an (array-size) attribute - or something or using the "native" keyword and skipping the (type) - stuff. - - === - (object object-name - (in-module module-name-list) - (parent object-name optional-module-name-if-different) - (abstract boolean-is-abstract-class) ;; omit for default of #f - (c-name name-of-the-object-in-C) - (field (type-and-name type-alias-of-struct-field - name-of-struct-field) - (access read-or-write-or-readwrite))) - - - Ex: (object Widget - (in-module (Gtk)) - (parent Object) ;; could say (parent Object (Gtk)) - (abstract #t) - (c-name GtkWidget) - (field (type-and-name GdkWindow* window) (access read))) - - An "object" declaration automatically implies the type definition: - - (type - (alias concat-module-elements-and-object-name) - (in-c-name pointer-to-c-name) - (out-c-name pointer-to-pointer-to-c-name) - (inout-c-name pointer-to-c-name)) - - Ex: - (type (alias GtkWidget) - (in-c-name GtkWidget*) - (out-c-name GtkWidget**) - (inout-c-name GtkWidget*)) - - It also implies a module that is the name broken into parts: - (module CTree - (submodule-of Gtk)) - - === - - (function function-name - (in-module module-name-list) ;; "static methods" go in their - ;; object's module - (is-constructor-of object-type-alias) ;; optional, marks a - constructor - (c-name function-name) - (return-type return-value-type) ;; defaults to void - (caller-owns-return boolean-value) ;; defaults to #f - (parameter in-or-out-or-inout - (type-and-name parameter-type-alias parameter-name) - (c-declaration "c-type-and-name")) ;; c-declaration only - required - ;; if the type alias is - "native" - (varargs #t) ;; has varargs at the end - ) - - Ex: - (function init - (in-module (Gdk Rgb) - (c-name gdk_rgb_init))) - - Ex: - (function new - (in-module (Gdk Rgb Cmap)) - (is-constructor-of GdkRgbCmap) - (c-name gdk_rgb_cmap_new) - (return-type GdkRgbCmap) - (caller-owns-return #t) ;; perhaps this could be implied by - is-constructor-of - (parameter in (type-and-name array-of-guint32 colors)) - (parameter in (type-and-name gint n_colors))) - - Ex: - (function config_set_set_handler - (in-module (Gnome)) - (c-name gnome_config_set_set_handler) - (parameter in (type-and-name native func) - (c-declaration "void (*func)(void*)")) - (parameter in (type-and-name gpointer data))) - - === - (method method-name - (of-object object-name module-name) - ;; retval/arg attributes as for (function), but with first parameter - - ;; omitted for non-constructors - ) - - Ex: - (method set_text - (of-object Label (Gtk)) - (parameter (type-and-name const-gchar* str))) - - === - (object-argument arg-name - (of-object object-we-are-an-argument-of optional-objects-module) - (type argument-type) ;; not sure what to put for type - ;; flags all default to #f - (readable bool-value) - (writeable bool-value) - (run-action bool-value) - (construct-only bool-value)) - - Ex: - (object-argument label - (of-object Label (Gtk)) - (type gchar*) ;; ???? - (readable #t) - (writeable #t)) - - === - (signal signal-name - (of-object object-we-are-a-signal-of optional-objects-module) - ;; return value and parameters as for a function, omitting the - object - ;; and user data parameters - - ;; what other properties matter for a signal? - ) - - Ex: - (signal select_row - (of-object CList (Gtk)) - ;; return type defaults to void - (parameter in (type-and-name gint row)) - (parameter in (type-and-name gint column)) - (parameter in (type-and-name GdkEvent* event))) - - === - (enum enum-name - (in-module modname) - (c-name name-in-c) - (value (name value-name-noprefixes-hyphen-lowercase) (c-name - value-c-name))) - - Ex: - - (enum DirectionType - (in-module Gtk) - (c-name GtkDirectionType) - (value (name tab-forward) (c-name GTK_DIR_TAB_FORWARD)) - (value (name tab-backward) (c-name GTK_DIR_TAB_BACKWARD)) - (value (name up) (c-name GTK_DIR_UP)) - (value (name down) (c-name GTK_DIR_DOWN)) - (value (name left) (c-name GTK_DIR_LEFT)) - (value (name right) (c-name GTK_DIR_RIGHT))) - - (enum Pos - (in-module (Gtk CTree)) - (c-name GtkCTreePos) - (value (name before) (c-name GTK_CTREE_POS_BEFORE)) - (value (name as-child) (c-name GTK_CTREE_POS_AS_CHILD)) - (value (name after) (c-name GTK_CTREE_POS_AFTER))) - - === - (flags) is just like enum, but some bindings may wrap enums and flags - differently. - - === - - (boxed boxed-name - (in-module modname) - (c-name c-name) - (ref-func func-to-increase-refcount) - (copy-func func-to-copy) - (release-func func-to-destroy-or-decrement-refcount) - (field (type-and-name type-alias-of-struct-field - name-of-struct-field) (access access-rule))) - - It is never OK to use memcpy() to copy a boxed type, or use - malloc()/free() to alloc/free one. - - Ex: - - (boxed Pixmap - (in-module (Gdk)) - (c-name GdkPixmap) - (ref-func pixmap_ref) - (unref-func pixmap_unref)) - - An "object" declaration automatically implies the type definition: - - (type - (alias concat-module-elements-and-boxed-name) - (in-c-name pointer-to-c-name) - (out-c-name pointer-to-pointer-to-c-name) - (inout-c-name pointer-to-c-name)) - - Ex: - (type (alias GdkPixmap) - (in-c-name GdkPixmap*) - (out-c-name GdkPixmap**) - (inout-c-name GdkPixmap*)) - - === - - (struct struct-name - (in-module modname) - (c-name c-name) - (field (type-and-name type-alias-of-struct-field - name-of-struct-field) (access access-rule))) - - Ex: - (struct Rectangle - (in-module (Gdk)) - (c-name GdkRectangle) - (field (type-and-name gint16 x) (access readwrite)) - (field (type-and-name gint16 y) (access readwrite)) - (field (type-and-name guint16 width) (access readwrite)) - (field (type-and-name guint16 height) (access readwrite))) - - Implies GdkRectangle type alias: - - (type (alias GdkRectangle) - (in-c-name GdkRectangle*) - (out-c-name GdkRectangle*) ;; note - not the same as boxed - types - (inout-c-name GdkRectangle*)) - - === - - (user-function name - (in-module module) - (c-name c-typedef-name) - ;; return-type and parameters as for (function) - ) - - Ex: - - (user-function PrintFunc - (in-module (Gtk)) - (parameter in (type-and-name gpointer func_data)) - (parameter in (type-and-name gchar* str))) - - === - - (typedef new-name - (in-module module) - (c-name c-full-name) - (orig-type alias-of-orig-type)) - - Ex: - - (typedef Type - (in-module (Gtk)) - (c-name GtkType) - (orig-type guint)) - diff --git a/codegen/__init__.py b/codegen/__init__.py deleted file mode 100644 index 86188f9..0000000 --- a/codegen/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- - -__all__ = [ - 'argtypes', - 'codegen', - 'definitions', - 'defsparser', - 'docextract', - 'docgen', - 'h2def', - 'defsgen' - 'mergedefs', - 'mkskel', - 'override', - 'scmexpr' -] diff --git a/codegen/argtypes.py b/codegen/argtypes.py deleted file mode 100644 index 46e868e..0000000 --- a/codegen/argtypes.py +++ /dev/null @@ -1,1043 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- -import string -import keyword -import struct - -py_ssize_t_clean = False - -class ArgTypeError(Exception): - pass - -class ArgTypeNotFoundError(ArgTypeError): - pass - -class ArgTypeConfigurationError(ArgTypeError): - pass - - -class VarList: - """Nicely format a C variable list""" - def __init__(self): - self.vars = {} - def add(self, ctype, name): - if self.vars.has_key(ctype): - self.vars[ctype] = self.vars[ctype] + (name,) - else: - self.vars[ctype] = (name,) - def __str__(self): - ret = [] - for type in self.vars.keys(): - ret.append(' ') - ret.append(type) - ret.append(' ') - ret.append(string.join(self.vars[type], ', ')) - ret.append(';\n') - if ret: - ret.append('\n') - return string.join(ret, '') - return '' - -class WrapperInfo: - """A class that holds information about variable defs, code - snippets, etcd for use in writing out the function/method - wrapper.""" - def __init__(self): - self.varlist = VarList() - self.parsestr = '' - self.parselist = ['', 'kwlist'] - self.codebefore = [] - self.codeafter = [] - self.arglist = [] - self.kwlist = [] - def get_parselist(self): - return string.join(self.parselist, ', ') - def get_codebefore(self): - return string.join(self.codebefore, '') - def get_codeafter(self): - return string.join(self.codeafter, '') - def get_arglist(self): - return string.join(self.arglist, ', ') - def get_varlist(self): - return str(self.varlist) - def get_kwlist(self): - ret = ' static char *kwlist[] = { %s };\n' % \ - string.join(self.kwlist + [ 'NULL' ], ', ') - if not self.get_varlist(): - ret = ret + '\n' - return ret - - def add_parselist(self, codes, parseargs, keywords): - self.parsestr = self.parsestr + codes - for arg in parseargs: - self.parselist.append(arg) - for kw in keywords: - if keyword.iskeyword(kw): - kw = kw + '_' - self.kwlist.append('"%s"' % kw) - -class ArgType: - def write_param(self, ptype, pname, pdflt, pnull, info): - """Add code to the WrapperInfo instance to handle - parameter.""" - raise RuntimeError("write_param not implemented for %s" - % self.__class__.__name__) - def write_return(self, ptype, ownsreturn, info): - """Adds a variable named ret of the return type to - info.varlist, and add any required code to info.codeafter to - convert the return value to a python object.""" - raise RuntimeError("write_return not implemented for %s" - % self.__class__.__name__) - -class NoneArg(ArgType): - def write_return(self, ptype, ownsreturn, info): - info.codeafter.append(' Py_INCREF(Py_None);\n' + - ' return Py_None;') - -class StringArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt != None: - if pdflt != 'NULL': pdflt = '"' + pdflt + '"' - info.varlist.add('char', '*' + pname + ' = ' + pdflt) - else: - info.varlist.add('char', '*' + pname) - info.arglist.append(pname) - if pnull: - info.add_parselist('z', ['&' + pname], [pname]) - else: - info.add_parselist('s', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - if ownsreturn: - # have to free result ... - info.varlist.add('gchar', '*ret') - info.codeafter.append(' if (ret) {\n' + - ' PyObject *py_ret = PyString_FromString(ret);\n' + - ' g_free(ret);\n' + - ' return py_ret;\n' + - ' }\n' + - ' Py_INCREF(Py_None);\n' + - ' return Py_None;') - else: - info.varlist.add('const gchar', '*ret') - info.codeafter.append(' if (ret)\n' + - ' return PyString_FromString(ret);\n'+ - ' Py_INCREF(Py_None);\n' + - ' return Py_None;') - -class UCharArg(ArgType): - # allows strings with embedded NULLs. - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('guchar', '*' + pname + ' = "' + pdflt + '"') - else: - info.varlist.add('guchar', '*' + pname) - if py_ssize_t_clean: - info.varlist.add('Py_ssize_t', pname + '_len') - else: - info.varlist.add('int', pname + '_len') - info.arglist.append(pname) - if pnull: - info.add_parselist('z#', ['&' + pname, '&' + pname + '_len'], - [pname]) - else: - info.add_parselist('s#', ['&' + pname, '&' + pname + '_len'], - [pname]) - -class CharArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('char', pname + " = '" + pdflt + "'") - else: - info.varlist.add('char', pname) - info.arglist.append(pname) - info.add_parselist('c', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('gchar', 'ret') - info.codeafter.append(' return PyString_FromStringAndSize(&ret, 1);') -class GUniCharArg(ArgType): - ret_tmpl = ('#if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2\n' - ' if (ret > 0xffff) {\n' - ' PyErr_SetString(PyExc_RuntimeError, "returned character can not be represented in 16-bit unicode");\n' - ' return NULL;\n' - ' }\n' - '#endif\n' - ' py_ret = (Py_UNICODE)ret;\n' - ' return PyUnicode_FromUnicode(&py_ret, 1);\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('gunichar', pname + " = '" + pdflt + "'") - else: - info.varlist.add('gunichar', pname) - info.arglist.append(pname) - info.add_parselist('O&', ['pyg_pyobj_to_unichar_conv', '&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('gunichar', 'ret') - info.varlist.add('Py_UNICODE', 'py_ret') - info.codeafter.append(self.ret_tmpl) - - -class IntArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('int', pname + ' = ' + pdflt) - else: - info.varlist.add('int', pname) - info.arglist.append(pname) - info.add_parselist('i', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('int', 'ret') - info.codeafter.append(' return PyInt_FromLong(ret);') - -class UIntArg(ArgType): - dflt = (' if (py_%(name)s) {\n' - ' if (PyLong_Check(py_%(name)s))\n' - ' %(name)s = PyLong_AsUnsignedLong(py_%(name)s);\n' - ' else if (PyInt_Check(py_%(name)s))\n' - ' %(name)s = PyInt_AsLong(py_%(name)s);\n' - ' else\n' - ' PyErr_SetString(PyExc_TypeError, "Parameter \'%(name)s\' must be an int or a long");\n' - ' if (PyErr_Occurred())\n' - ' return NULL;\n' - ' }\n') - before = (' if (PyLong_Check(py_%(name)s))\n' - ' %(name)s = PyLong_AsUnsignedLong(py_%(name)s);\n' - ' else if (PyInt_Check(py_%(name)s))\n' - ' %(name)s = PyInt_AsLong(py_%(name)s);\n' - ' else\n' - ' PyErr_SetString(PyExc_TypeError, "Parameter \'%(name)s\' must be an int or a long");\n' - ' if (PyErr_Occurred())\n' - ' return NULL;\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - if not pdflt: - pdflt = '0'; - - info.varlist.add(ptype, pname + ' = ' + pdflt) - info.codebefore.append(self.dflt % {'name':pname}) - info.varlist.add('PyObject', "*py_" + pname + ' = NULL') - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype, 'ret') - info.codeafter.append(' return PyLong_FromUnsignedLong(ret);') - -class SizeArg(ArgType): - - if struct.calcsize('P') <= struct.calcsize('l'): - llp64 = True - else: - llp64 = False - - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add(ptype, pname + ' = ' + pdflt) - else: - info.varlist.add(ptype, pname) - info.arglist.append(pname) - if self.llp64: - info.add_parselist('k', ['&' + pname], [pname]) - else: - info.add_parselist('K', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype, 'ret') - if self.llp64: - info.codeafter.append(' return PyLong_FromUnsignedLongLong(ret);\n') - else: - info.codeafter.append(' return PyLong_FromUnsignedLong(ret);\n') - -class SSizeArg(ArgType): - - if struct.calcsize('P') <= struct.calcsize('l'): - llp64 = True - else: - llp64 = False - - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add(ptype, pname + ' = ' + pdflt) - else: - info.varlist.add(ptype, pname) - info.arglist.append(pname) - if self.llp64: - info.add_parselist('l', ['&' + pname], [pname]) - else: - info.add_parselist('L', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype, 'ret') - if self.llp64: - info.codeafter.append(' return PyLong_FromLongLong(ret);\n') - else: - info.codeafter.append(' return PyLong_FromLong(ret);\n') - -class LongArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add(ptype, pname + ' = ' + pdflt) - else: - info.varlist.add(ptype, pname) - info.arglist.append(pname) - info.add_parselist('l', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype, 'ret') - info.codeafter.append(' return PyInt_FromLong(ret);\n') - -class BoolArg(IntArg): - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('int', 'ret') - info.codeafter.append(' return PyBool_FromLong(ret);\n') - -class TimeTArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('time_t', pname + ' = ' + pdflt) - else: - info.varlist.add('time_t', pname) - info.arglist.append(pname) - info.add_parselist('i', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('time_t', 'ret') - info.codeafter.append(' return PyInt_FromLong(ret);') - -class ULongArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('unsigned long', pname + ' = ' + pdflt) - else: - info.varlist.add('unsigned long', pname) - info.arglist.append(pname) - info.add_parselist('k', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype, 'ret') - info.codeafter.append(' return PyLong_FromUnsignedLong(ret);\n') - -class UInt32Arg(ULongArg): - def write_param(self, ptype, pname, pdflt, pnull, info): - ULongArg.write_param(self, ptype, pname, pdflt, pnull, info) - ## if sizeof(unsigned long) > sizeof(unsigned int), we need to - ## check the value is within guint32 range - if struct.calcsize('L') > struct.calcsize('I'): - info.codebefore.append(( - ' if (%(pname)s > G_MAXUINT32) {\n' - ' PyErr_SetString(PyExc_ValueError,\n' - ' "Value out of range in conversion of"\n' - ' " %(pname)s parameter to unsigned 32 bit integer");\n' - ' return NULL;\n' - ' }\n') % vars()) - -class Int64Arg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('gint64', pname + ' = ' + pdflt) - else: - info.varlist.add('gint64', pname) - info.arglist.append(pname) - info.add_parselist('L', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('gint64', 'ret') - info.codeafter.append(' return PyLong_FromLongLong(ret);') - -class UInt64Arg(ArgType): - dflt = ' if (py_%(name)s)\n' \ - ' %(name)s = PyLong_AsUnsignedLongLong(py_%(name)s);\n' - before = ' %(name)s = PyLong_AsUnsignedLongLong(py_%(name)s);\n' - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('guint64', pname + ' = ' + pdflt) - info.codebefore.append(self.dflt % {'name':pname}) - else: - info.varlist.add('guint64', pname) - info.codebefore.append(self.before % {'name':pname}) - info.varlist.add('PyObject', "*py_" + pname + ' = NULL') - info.arglist.append(pname) - info.add_parselist('O!', ['&PyLong_Type', '&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('guint64', 'ret') - info.codeafter.append(' return PyLong_FromUnsignedLongLong(ret);') - - -class DoubleArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('double', pname + ' = ' + pdflt) - else: - info.varlist.add('double', pname) - info.arglist.append(pname) - info.add_parselist('d', ['&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('double', 'ret') - info.codeafter.append(' return PyFloat_FromDouble(ret);') - -class FileArg(ArgType): - nulldflt = (' if (py_%(name)s == Py_None)\n' - ' %(name)s = NULL;\n' - ' else if (py_%(name)s && PyFile_Check(py_%(name)s)\n' - ' %s = PyFile_AsFile(py_%(name)s);\n' - ' else if (py_%(name)s) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a file object or None");\n' - ' return NULL;\n' - ' }') - null = (' if (py_%(name)s && PyFile_Check(py_%(name)s)\n' - ' %(name)s = PyFile_AsFile(py_%(name)s);\n' - ' else if (py_%(name)s != Py_None) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a file object or None");\n' - ' return NULL;\n' - ' }\n') - dflt = (' if (py_%(name)s)\n' - ' %(name)s = PyFile_AsFile(py_%(name)s);\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - if pdflt: - info.varlist.add('FILE', '*' + pname + ' = ' + pdflt) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.nulldflt % {'name':pname}) - else: - info.varlist.add('FILE', '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname) - info.codebefore.append(self.null & {'name':pname}) - info.arglist.appned(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - else: - if pdflt: - info.varlist.add('FILE', '*' + pname + ' = ' + pdflt) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.dflt % {'name':pname}) - info.arglist.append(pname) - else: - info.varlist.add('PyObject', '*' + pname) - info.arglist.append('PyFile_AsFile(' + pname + ')') - info.add_parselist('O!', ['&PyFile_Type', '&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('FILE', '*ret') - info.codeafter.append(' if (ret)\n' + - ' return PyFile_FromFile(ret, "", "", fclose);\n' + - ' Py_INCREF(Py_None);\n' + - ' return Py_None;') - -class EnumArg(ArgType): - enum = (' if (pyg_enum_get_value(%(typecode)s, py_%(name)s, (gpointer)&%(name)s))\n' - ' return NULL;\n') - def __init__(self, enumname, typecode): - self.enumname = enumname - self.typecode = typecode - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add(self.enumname, pname + ' = ' + pdflt) - else: - info.varlist.add(self.enumname, pname) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.enum % { 'typecode': self.typecode, - 'name': pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]); - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('gint', 'ret') - info.codeafter.append(' return pyg_enum_from_gtype(%s, ret);' % self.typecode) - -class FlagsArg(ArgType): - flag = (' if (%(default)spyg_flags_get_value(%(typecode)s, py_%(name)s, (gpointer)&%(name)s))\n' - ' return NULL;\n') - def __init__(self, flagname, typecode): - self.flagname = flagname - self.typecode = typecode - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add(self.flagname, pname + ' = ' + pdflt) - default = "py_%s && " % (pname,) - else: - info.varlist.add(self.flagname, pname) - default = "" - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.flag % {'default':default, - 'typecode':self.typecode, - 'name':pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('guint', 'ret') - info.codeafter.append(' return pyg_flags_from_gtype(%s, ret);' % self.typecode) - -class ObjectArg(ArgType): - # should change these checks to more typesafe versions that check - # a little further down in the class heirachy. - nulldflt = (' if ((PyObject *)py_%(name)s == Py_None)\n' - ' %(name)s = NULL;\n' - ' else if (py_%(name)s && pygobject_check(py_%(name)s, &Py%(type)s_Type))\n' - ' %(name)s = %(cast)s(py_%(name)s->obj);\n' - ' else if (py_%(name)s) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(type)s or None");\n' - ' return NULL;\n' - ' }\n') - null = (' if (py_%(name)s && pygobject_check(py_%(name)s, &Py%(type)s_Type))\n' - ' %(name)s = %(cast)s(py_%(name)s->obj);\n' - ' else if ((PyObject *)py_%(name)s != Py_None) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(type)s or None");\n' - ' return NULL;\n' - ' }\n') - dflt = ' if (py_%(name)s)\n' \ - ' %(name)s = %(cast)s(py_%(name)s->obj);\n' - def __init__(self, objname, parent, typecode): - self.objname = objname - self.cast = string.replace(typecode, '_TYPE_', '_', 1) - self.parent = parent - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - if pdflt: - info.varlist.add(self.objname, '*' + pname + ' = ' + pdflt) - info.varlist.add('PyGObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.nulldflt % {'name':pname, - 'cast':self.cast, - 'type':self.objname}) - else: - info.varlist.add(self.objname, '*' + pname + ' = NULL') - info.varlist.add('PyGObject', '*py_' + pname) - info.codebefore.append(self.null % {'name':pname, - 'cast':self.cast, - 'type':self.objname}) - if ptype.endswith('*'): - typename = ptype[:-1] - try: - const, typename = typename.split('const-') - except ValueError: - const = '' - if typename != ptype: - info.arglist.append('(%s *) %s' % (ptype[:-1], pname)) - else: - info.arglist.append(pname) - - info.add_parselist('O', ['&py_' + pname], [pname]) - else: - if pdflt: - info.varlist.add(self.objname, '*' + pname + ' = ' + pdflt) - info.varlist.add('PyGObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.dflt % {'name':pname, - 'cast':self.cast}) - info.arglist.append(pname) - info.add_parselist('O!', ['&Py%s_Type' % self.objname, - '&py_' + pname], [pname]) - else: - info.varlist.add('PyGObject', '*' + pname) - info.arglist.append('%s(%s->obj)' % (self.cast, pname)) - info.add_parselist('O!', ['&Py%s_Type' % self.objname, - '&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - if ptype.endswith('*'): - typename = ptype[:-1] - try: - const, typename = typename.split('const-') - except ValueError: - const = '' - info.varlist.add(typename, '*ret') - if ownsreturn: - info.varlist.add('PyObject', '*py_ret') - info.codeafter.append(' py_ret = pygobject_new((GObject *)ret);\n' - ' if (ret != NULL)\n' - ' g_object_unref(ret);\n' - ' return py_ret;') - else: - info.codeafter.append(' /* pygobject_new handles NULL checking */\n' + - ' return pygobject_new((GObject *)ret);') - -class BoxedArg(ArgType): - # haven't done support for default args. Is it needed? - check = (' if (pyg_boxed_check(py_%(name)s, %(typecode)s))\n' - ' %(name)s = pyg_boxed_get(py_%(name)s, %(typename)s);\n' - ' else {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(typename)s");\n' - ' return NULL;\n' - ' }\n') - null = (' if (pyg_boxed_check(py_%(name)s, %(typecode)s))\n' - ' %(name)s = pyg_boxed_get(py_%(name)s, %(typename)s);\n' - ' else if (py_%(name)s != Py_None) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(typename)s or None");\n' - ' return NULL;\n' - ' }\n') - def __init__(self, ptype, typecode): - self.typename = ptype - self.typecode = typecode - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - info.varlist.add(self.typename, '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.codebefore.append(self.null % {'name': pname, - 'typename': self.typename, - 'typecode': self.typecode}) - else: - info.varlist.add(self.typename, '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname) - info.codebefore.append(self.check % {'name': pname, - 'typename': self.typename, - 'typecode': self.typecode}) - if ptype[-1] == '*': - typename = ptype[:-1] - if typename[:6] == 'const-': typename = typename[6:] - if typename != self.typename: - info.arglist.append('(%s *)%s' % (ptype[:-1], pname)) - else: - info.arglist.append(pname) - else: - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - ret_tmpl = ' /* pyg_boxed_new handles NULL checking */\n' \ - ' return pyg_boxed_new(%(typecode)s, %(ret)s, %(copy)s, TRUE);' - def write_return(self, ptype, ownsreturn, info): - if ptype[-1] == '*': - decl_type = self.typename - ret = 'ret' - if ptype[:6] == 'const-': - decl_type = 'const ' + self.typename - ret = '(%s*) ret' % (self.typename,) - info.varlist.add(decl_type, '*ret') - else: - info.varlist.add(self.typename, 'ret') - ret = '&ret' - ownsreturn = 0 # of course it can't own a ref to a local var ... - info.codeafter.append(self.ret_tmpl % - { 'typecode': self.typecode, - 'ret': ret, - 'copy': ownsreturn and 'FALSE' or 'TRUE'}) - -class CustomBoxedArg(ArgType): - # haven't done support for default args. Is it needed? - null = (' if (%(check)s(py_%(name)s))\n' - ' %(name)s = %(get)s(py_%(name)s);\n' - ' else if (py_%(name)s != Py_None) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(type)s or None");\n' - ' return NULL;\n' - ' }\n') - def __init__(self, ptype, pytype, getter, new): - self.pytype = pytype - self.getter = getter - self.checker = 'Py' + ptype + '_Check' - self.new = new - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - info.varlist.add(ptype[:-1], '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.codebefore.append(self.null % {'name': pname, - 'get': self.getter, - 'check': self.checker, - 'type': ptype[:-1]}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - else: - info.varlist.add('PyObject', '*' + pname) - info.arglist.append(self.getter + '(' + pname + ')') - info.add_parselist('O!', ['&' + self.pytype, '&' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add(ptype[:-1], '*ret') - info.codeafter.append(' if (ret)\n' + - ' return ' + self.new + '(ret);\n' + - ' Py_INCREF(Py_None);\n' + - ' return Py_None;') - -class PointerArg(ArgType): - # haven't done support for default args. Is it needed? - check = (' if (pyg_pointer_check(py_%(name)s, %(typecode)s))\n' - ' %(name)s = pyg_pointer_get(py_%(name)s, %(typename)s);\n' - ' else {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(typename)s");\n' - ' return NULL;\n' - ' }\n') - null = (' if (pyg_pointer_check(py_%(name)s, %(typecode)s))\n' - ' %(name)s = pyg_pointer_get(py_%(name)s, %(typename)s);\n' - ' else if (py_%(name)s != Py_None) {\n' - ' PyErr_SetString(PyExc_TypeError, "%(name)s should be a %(typename)s or None");\n' - ' return NULL;\n' - ' }\n') - def __init__(self, ptype, typecode): - self.typename = ptype - self.typecode = typecode - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - info.varlist.add(self.typename, '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.codebefore.append(self.null % {'name': pname, - 'typename': self.typename, - 'typecode': self.typecode}) - else: - info.varlist.add(self.typename, '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname) - info.codebefore.append(self.check % {'name': pname, - 'typename': self.typename, - 'typecode': self.typecode}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - if ptype[-1] == '*': - info.varlist.add(self.typename, '*ret') - info.codeafter.append(' /* pyg_pointer_new handles NULL checking */\n' + - ' return pyg_pointer_new(' + self.typecode + ', ret);') - else: - info.varlist.add(self.typename, 'ret') - info.codeafter.append(' /* pyg_pointer_new handles NULL checking */\n' + - ' return pyg_pointer_new(' + self.typecode + ', &ret);') - -class AtomArg(IntArg): - dflt = ' if (py_%(name)s) {\n' \ - ' %(name)s = pygdk_atom_from_pyobject(py_%(name)s);\n' \ - ' if (PyErr_Occurred())\n' \ - ' return NULL;\n' \ - ' }\n' - atom = (' %(name)s = pygdk_atom_from_pyobject(py_%(name)s);\n' - ' if (PyErr_Occurred())\n' - ' return NULL;\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - if pdflt: - info.varlist.add('GdkAtom', pname + ' = ' + pdflt) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.dflt % {'name': pname}) - else: - info.varlist.add('GdkAtom', pname) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.atom % {'name': pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('GdkAtom', 'ret') - info.varlist.add('PyObject *', 'py_ret') - info.varlist.add('gchar *', 'name') - info.codeafter.append(' name = gdk_atom_name(ret);\n' - ' py_ret = PyString_FromString(name);\n' - ' g_free(name);\n' - ' return py_ret;') - -class GTypeArg(ArgType): - gtype = (' if ((%(name)s = pyg_type_from_object(py_%(name)s)) == 0)\n' - ' return NULL;\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - info.varlist.add('GType', pname) - info.varlist.add('PyObject', '*py_' + pname + ' = NULL') - info.codebefore.append(self.gtype % {'name': pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('GType', 'ret') - info.codeafter.append(' return pyg_type_wrapper_new(ret);') - -# simple GError handler. -class GErrorArg(ArgType): - handleerror = (' if (pyg_error_check(&%(name)s))\n' - ' return NULL;\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - info.varlist.add('GError', '*' + pname + ' = NULL') - info.arglist.append('&' + pname) - info.codeafter.append(self.handleerror % { 'name': pname }) - -class GtkTreePathArg(ArgType): - # haven't done support for default args. Is it needed? - normal = (' %(name)s = pygtk_tree_path_from_pyobject(py_%(name)s);\n' - ' if (!%(name)s) {\n' - ' PyErr_SetString(PyExc_TypeError, "could not convert %(name)s to a GtkTreePath");\n' - ' return NULL;\n' - ' }\n') - null = (' if (py_%(name)s != Py_None) {\n' - ' %(name)s = pygtk_tree_path_from_pyobject(py_%(name)s);\n' - ' if (!%(name)s) {\n' - ' PyErr_SetString(PyExc_TypeError, "could not convert %(name)s to a GtkTreePath");\n' - ' return NULL;\n' - ' }\n' - ' }\n') - freepath = (' if (%(name)s)\n' - ' gtk_tree_path_free(%(name)s);\n') - def __init__(self): - pass - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - info.varlist.add('GtkTreePath', '*' + pname + ' = NULL') - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.codebefore.append(self.null % {'name': pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - else: - info.varlist.add('GtkTreePath', '*' + pname) - info.varlist.add('PyObject', '*py_' + pname) - info.codebefore.append(self.normal % {'name': pname}) - info.arglist.append(pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - info.codeafter.append(self.freepath % {'name': pname}) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('GtkTreePath', '*ret') - if ownsreturn: - info.codeafter.append(' if (ret) {\n' - ' PyObject *py_ret = pygtk_tree_path_to_pyobject(ret);\n' - ' gtk_tree_path_free(ret);\n' - ' return py_ret;\n' - ' }\n' - ' Py_INCREF(Py_None);\n' - ' return Py_None;') - else: - info.codeafter.append(' if (ret) {\n' - ' PyObject *py_ret = pygtk_tree_path_to_pyobject(ret);\n' - ' return py_ret;\n' - ' }\n' - ' Py_INCREF(Py_None);\n' - ' return Py_None;') - -class GdkRectanglePtrArg(ArgType): - normal = (' if (!pygdk_rectangle_from_pyobject(py_%(name)s, &%(name)s))\n' - ' return NULL;\n') - null = (' if (py_%(name)s == Py_None)\n' - ' %(name)s = NULL;\n' - ' else if (pygdk_rectangle_from_pyobject(py_%(name)s, &%(name)s_rect))\n' - ' %(name)s = &%(name)s_rect;\n' - ' else\n' - ' return NULL;\n') - def write_param(self, ptype, pname, pdflt, pnull, info): - if pnull: - info.varlist.add('GdkRectangle', pname + '_rect = { 0, 0, 0, 0 }') - info.varlist.add('GdkRectangle', '*' + pname) - info.varlist.add('PyObject', '*py_' + pname + ' = Py_None') - info.add_parselist('O', ['&py_' + pname], [pname]) - info.arglist.append(pname) - info.codebefore.append(self.null % {'name': pname}) - else: - info.varlist.add('GdkRectangle', pname + ' = { 0, 0, 0, 0 }') - info.varlist.add('PyObject', '*py_' + pname) - info.add_parselist('O', ['&py_' + pname], [pname]) - info.arglist.append('&' + pname) - info.codebefore.append(self.normal % {'name': pname}) - -class GdkRectangleArg(ArgType): - def write_return(self, ptype, ownsreturn, info): - info.varlist.add('GdkRectangle', 'ret') - info.codeafter.append(' return pyg_boxed_new(GDK_TYPE_RECTANGLE, &ret, TRUE, TRUE);') - -class PyObjectArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - info.varlist.add('PyObject', '*' + pname) - info.add_parselist('O', ['&' + pname], [pname]) - info.arglist.append(pname) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add("PyObject", "*ret") - if ownsreturn: - info.codeafter.append(' if (ret) {\n' - ' return ret;\n' - ' }\n' - ' Py_INCREF(Py_None);\n' - ' return Py_None;') - else: - info.codeafter.append(' if (!ret) ret = Py_None;\n' - ' Py_INCREF(ret);\n' - ' return ret;') - -class CairoArg(ArgType): - def write_param(self, ptype, pname, pdflt, pnull, info): - info.varlist.add('PycairoContext', '*' + pname) - info.add_parselist('O!', ['&PycairoContext_Type', '&' + pname], [pname]) - info.arglist.append('%s->ctx' % pname) - def write_return(self, ptype, ownsreturn, info): - info.varlist.add("cairo_t", "*ret") - if ownsreturn: - info.codeafter.append(' return PycairoContext_FromContext(ret, NULL, NULL);') - else: - info.codeafter.append(' cairo_reference(ret);\n' - ' return PycairoContext_FromContext(ret, NULL, NULL);') - - -class ArgMatcher: - def __init__(self): - self.argtypes = {} - self.reverse_argtypes = {} - self.reverse_rettypes = {} - - def register(self, ptype, handler, overwrite=False): - if not overwrite and ptype in self.argtypes: - return - self.argtypes[ptype] = handler - def register_reverse(self, ptype, handler): - self.reverse_argtypes[ptype] = handler - def register_reverse_ret(self, ptype, handler): - self.reverse_rettypes[ptype] = handler - - def register_enum(self, ptype, typecode): - if typecode is None: - self.register(ptype, IntArg()) - else: - self.register(ptype, EnumArg(ptype, typecode)) - def register_flag(self, ptype, typecode): - if typecode is None: - self.register(ptype, IntArg()) - else: - self.register(ptype, FlagsArg(ptype, typecode)) - def register_object(self, ptype, parent, typecode): - oa = ObjectArg(ptype, parent, typecode) - self.register(ptype, oa) # in case I forget the * in the .defs - self.register(ptype+'*', oa) - self.register('const-'+ptype+'*', oa) - if ptype == 'GdkPixmap': - # hack to handle GdkBitmap synonym. - self.register('GdkBitmap', oa) - self.register('GdkBitmap*', oa) - def register_boxed(self, ptype, typecode): - if self.argtypes.has_key(ptype): return - arg = BoxedArg(ptype, typecode) - self.register(ptype, arg) - self.register(ptype+'*', arg) - self.register('const-'+ptype+'*', arg) - def register_custom_boxed(self, ptype, pytype, getter, new): - arg = CustomBoxedArg(ptype, pytype, getter, new) - self.register(ptype+'*', arg) - self.register('const-'+ptype+'*', arg) - def register_pointer(self, ptype, typecode): - arg = PointerArg(ptype, typecode) - self.register(ptype, arg) - self.register(ptype+'*', arg) - self.register('const-'+ptype+'*', arg) - - def get(self, ptype): - try: - return self.argtypes[ptype] - except KeyError: - if ptype[:8] == 'GdkEvent' and ptype[-1] == '*': - return self.argtypes['GdkEvent*'] - raise ArgTypeNotFoundError("No ArgType for %s" % (ptype,)) - def _get_reverse_common(self, ptype, registry): - props = dict(c_type=ptype) - try: - return registry[ptype], props - except KeyError: - try: - handler = self.argtypes[ptype] - except KeyError: - if ptype.startswith('GdkEvent') and ptype.endswith('*'): - handler = self.argtypes['GdkEvent*'] - else: - raise ArgTypeNotFoundError("No ArgType for %s" % (ptype,)) - if isinstance(handler, ObjectArg): - return registry['GObject*'], props - elif isinstance(handler, EnumArg): - props['typecode'] = handler.typecode - props['enumname'] = handler.enumname - return registry['GEnum'], props - elif isinstance(handler, FlagsArg): - props['typecode'] = handler.typecode - props['flagname'] = handler.flagname - return registry['GFlags'], props - elif isinstance(handler, BoxedArg): - props['typecode'] = handler.typecode - props['typename'] = handler.typename - return registry['GBoxed'], props - else: - raise ArgTypeNotFoundError("No ArgType for %s" % (ptype,)) - - def get_reverse(self, ptype): - return self._get_reverse_common(ptype, self.reverse_argtypes) - - def get_reverse_ret(self, ptype): - ret, props = self._get_reverse_common(ptype, self.reverse_rettypes) - if hasattr(ptype, 'optional') and ptype.optional: - if ret.supports_optional: - props['optional'] = True - else: - raise ArgTypeNotFoundError("Unsupported 'optional' for %s" - % (ptype,)) - return ret, props - - def object_is_a(self, otype, parent): - if otype == None: return 0 - if otype == parent: return 1 - if not self.argtypes.has_key(otype): return 0 - return self.object_is_a(self.get(otype).parent, parent) - -matcher = ArgMatcher() - -arg = NoneArg() -matcher.register(None, arg) -matcher.register('none', arg) - -arg = StringArg() -matcher.register('char*', arg) -matcher.register('gchar*', arg) -matcher.register('const-char*', arg) -matcher.register('char-const*', arg) -matcher.register('const-gchar*', arg) -matcher.register('gchar-const*', arg) -matcher.register('string', arg) -matcher.register('static_string', arg) - -arg = UCharArg() -matcher.register('unsigned-char*', arg) -matcher.register('const-guchar*', arg) -matcher.register('const-guint8*', arg) -matcher.register('guchar*', arg) - -arg = CharArg() -matcher.register('char', arg) -matcher.register('gchar', arg) -matcher.register('guchar', arg) - -arg = GUniCharArg() -matcher.register('gunichar', arg) - -arg = IntArg() -matcher.register('int', arg) -matcher.register('gint', arg) -matcher.register('short', arg) -matcher.register('gshort', arg) -matcher.register('gushort', arg) -matcher.register('gsize', SizeArg()) -matcher.register('gssize', SSizeArg()) -matcher.register('guint8', arg) -matcher.register('gint8', arg) -matcher.register('guint16', arg) -matcher.register('gint16', arg) -matcher.register('gint32', arg) -matcher.register('GTime', arg) -matcher.register('GSeekType', arg) # Hack, but we have no python wrapper - -arg = LongArg() -matcher.register('long', arg) -matcher.register('glong', arg) - -arg = UIntArg() -matcher.register('guint', arg) - -arg = BoolArg() -matcher.register('gboolean', arg) - -arg = TimeTArg() -matcher.register('time_t', arg) - -matcher.register('guint32', UInt32Arg()) - -arg = ULongArg() -matcher.register('gulong', arg) - -arg = Int64Arg() -matcher.register('gint64', arg) -matcher.register('long-long', arg) -matcher.register('goffset', arg) - -arg = UInt64Arg() -matcher.register('guint64', arg) -matcher.register('unsigned-long-long', arg) - -arg = DoubleArg() -matcher.register('double', arg) -matcher.register('gdouble', arg) -matcher.register('float', arg) -matcher.register('gfloat', arg) - -arg = FileArg() -matcher.register('FILE*', arg) - -# enums, flags, objects - -matcher.register('GdkAtom', AtomArg()) - -matcher.register('GType', GTypeArg()) -matcher.register('GtkType', GTypeArg()) - -matcher.register('GError**', GErrorArg()) -matcher.register('GtkTreePath*', GtkTreePathArg()) -matcher.register('GdkRectangle*', GdkRectanglePtrArg()) -matcher.register('GtkAllocation*', GdkRectanglePtrArg()) -matcher.register('GdkRectangle', GdkRectangleArg()) -matcher.register('PyObject*', PyObjectArg()) - -matcher.register('GdkNativeWindow', ULongArg()) - -matcher.register_object('GObject', None, 'G_TYPE_OBJECT') - -del arg - -matcher.register('cairo_t*', CairoArg()) -matcher.register_boxed("GClosure", "G_TYPE_CLOSURE") diff --git a/codegen/code-coverage.py b/codegen/code-coverage.py deleted file mode 100755 index 1dc54c3..0000000 --- a/codegen/code-coverage.py +++ /dev/null @@ -1,44 +0,0 @@ -#! /usr/bin/env python - -from __future__ import generators -import sys, os - -def read_symbols(file, type=None, dynamic=0): - if dynamic: - cmd = 'nm -D %s' % file - else: - cmd = 'nm %s' % file - for line in os.popen(cmd, 'r'): - if line[0] != ' ': # has an address as first bit of line - while line[0] != ' ': - line = line[1:] - while line[0] == ' ': - line = line[1:] - # we should be up to "type symbolname" now - sym_type = line[0] - symbol = line[1:].strip() - - if not type or type == sym_type: - yield symbol - -def main(): - if len(sys.argv) != 3: - sys.stderr.write('usage: coverage-check library.so wrapper.so\n') - sys.exit(1) - library = sys.argv[1] - wrapper = sys.argv[2] - - # first create a dict with all referenced symbols in the wrapper - # should really be a set, but a dict will do ... - wrapper_symbols = {} - for symbol in read_symbols(wrapper, type='U', dynamic=1): - wrapper_symbols[symbol] = 1 - - # now go through the library looking for matches on the defined symbols: - for symbol in read_symbols(library, type='T', dynamic=1): - if symbol[0] == '_': continue - if symbol not in wrapper_symbols: - print symbol - -if __name__ == '__main__': - main() diff --git a/codegen/codegen.py b/codegen/codegen.py deleted file mode 100755 index 008f01c..0000000 --- a/codegen/codegen.py +++ /dev/null @@ -1,1722 +0,0 @@ -#! /usr/bin/env python - -import getopt -import keyword -import os -import string -import sys - -import argtypes -import definitions -import defsparser -import override -import reversewrapper -import warnings - -class Coverage(object): - def __init__(self, name): - self.name = name - self.wrapped = 0 - self.not_wrapped = 0 - - def declare_wrapped(self): - self.wrapped += 1 - - def declare_not_wrapped(self): - self.not_wrapped += 1 - - def printstats(self): - total = self.wrapped + self.not_wrapped - fd = sys.stderr - if total: - fd.write("***INFO*** The coverage of %s is %.2f%% (%i/%i)\n" % - (self.name, - float(self.wrapped*100)/total, - self.wrapped, - total)) - else: - fd.write("***INFO*** There are no declared %s.\n" % self.name) - -functions_coverage = Coverage("global functions") -methods_coverage = Coverage("methods") -vproxies_coverage = Coverage("virtual proxies") -vaccessors_coverage = Coverage("virtual accessors") -iproxies_coverage = Coverage("interface proxies") - -def exc_info(): - warnings.warn("deprecated", DeprecationWarning, stacklevel=2) - #traceback.print_exc() - etype, value, tb = sys.exc_info() - ret = "" - try: - sval = str(value) - if etype == argtypes.ArgTypeError: - ret = "No ArgType for %s" % (sval,) - else: - ret = sval - finally: - del etype, value, tb - return ret - -def fixname(name): - if keyword.iskeyword(name): - return name + '_' - return name - -class FileOutput: - '''Simple wrapper for file object, that makes writing #line - statements easier.''' # " - def __init__(self, fp, filename=None): - self.fp = fp - self.lineno = 1 - if filename: - self.filename = filename - else: - self.filename = self.fp.name - # handle writing to the file, and keep track of the line number ... - def write(self, str): - self.fp.write(str) - self.lineno = self.lineno + string.count(str, '\n') - def writelines(self, sequence): - for line in sequence: - self.write(line) - def close(self): - self.fp.close() - def flush(self): - self.fp.flush() - - def setline(self, linenum, filename): - '''writes out a #line statement, for use by the C - preprocessor.''' # " - self.write('#line %d "%s"\n' % (linenum, filename)) - def resetline(self): - '''resets line numbering to the original file''' - self.setline(self.lineno + 1, self.filename) - -class Wrapper: - type_tmpl = ( - 'PyTypeObject G_GNUC_INTERNAL Py%(typename)s_Type = {\n' - ' PyObject_HEAD_INIT(NULL)\n' - ' 0, /* ob_size */\n' - ' "%(classname)s", /* tp_name */\n' - ' sizeof(%(tp_basicsize)s), /* tp_basicsize */\n' - ' 0, /* tp_itemsize */\n' - ' /* methods */\n' - ' (destructor)%(tp_dealloc)s, /* tp_dealloc */\n' - ' (printfunc)0, /* tp_print */\n' - ' (getattrfunc)%(tp_getattr)s, /* tp_getattr */\n' - ' (setattrfunc)%(tp_setattr)s, /* tp_setattr */\n' - ' (cmpfunc)%(tp_compare)s, /* tp_compare */\n' - ' (reprfunc)%(tp_repr)s, /* tp_repr */\n' - ' (PyNumberMethods*)%(tp_as_number)s, /* tp_as_number */\n' - ' (PySequenceMethods*)%(tp_as_sequence)s, /* tp_as_sequence */\n' - ' (PyMappingMethods*)%(tp_as_mapping)s, /* tp_as_mapping */\n' - ' (hashfunc)%(tp_hash)s, /* tp_hash */\n' - ' (ternaryfunc)%(tp_call)s, /* tp_call */\n' - ' (reprfunc)%(tp_str)s, /* tp_str */\n' - ' (getattrofunc)%(tp_getattro)s, /* tp_getattro */\n' - ' (setattrofunc)%(tp_setattro)s, /* tp_setattro */\n' - ' (PyBufferProcs*)%(tp_as_buffer)s, /* tp_as_buffer */\n' - ' %(tp_flags)s, /* tp_flags */\n' - ' %(tp_doc)s, /* Documentation string */\n' - ' (traverseproc)%(tp_traverse)s, /* tp_traverse */\n' - ' (inquiry)%(tp_clear)s, /* tp_clear */\n' - ' (richcmpfunc)%(tp_richcompare)s, /* tp_richcompare */\n' - ' %(tp_weaklistoffset)s, /* tp_weaklistoffset */\n' - ' (getiterfunc)%(tp_iter)s, /* tp_iter */\n' - ' (iternextfunc)%(tp_iternext)s, /* tp_iternext */\n' - ' (struct PyMethodDef*)%(tp_methods)s, /* tp_methods */\n' - ' (struct PyMemberDef*)0, /* tp_members */\n' - ' (struct PyGetSetDef*)%(tp_getset)s, /* tp_getset */\n' - ' NULL, /* tp_base */\n' - ' NULL, /* tp_dict */\n' - ' (descrgetfunc)%(tp_descr_get)s, /* tp_descr_get */\n' - ' (descrsetfunc)%(tp_descr_set)s, /* tp_descr_set */\n' - ' %(tp_dictoffset)s, /* tp_dictoffset */\n' - ' (initproc)%(tp_init)s, /* tp_init */\n' - ' (allocfunc)%(tp_alloc)s, /* tp_alloc */\n' - ' (newfunc)%(tp_new)s, /* tp_new */\n' - ' (freefunc)%(tp_free)s, /* tp_free */\n' - ' (inquiry)%(tp_is_gc)s /* tp_is_gc */\n' - '};\n\n' - ) - - slots_list = [ - 'tp_getattr', 'tp_setattr', 'tp_getattro', 'tp_setattro', - 'tp_compare', 'tp_repr', - 'tp_as_number', 'tp_as_sequence', 'tp_as_mapping', 'tp_hash', - 'tp_call', 'tp_str', 'tp_as_buffer', 'tp_richcompare', 'tp_iter', - 'tp_iternext', 'tp_descr_get', 'tp_descr_set', 'tp_init', - 'tp_alloc', 'tp_new', 'tp_free', 'tp_is_gc', - 'tp_traverse', 'tp_clear', 'tp_dealloc', 'tp_flags', 'tp_doc' - ] - - getter_tmpl = ( - 'static PyObject *\n' - '%(funcname)s(PyObject *self, void *closure)\n' - '{\n' - '%(varlist)s' - ' ret = %(field)s;\n' - '%(codeafter)s\n' - '}\n\n' - ) - - parse_tmpl = ( - ' if (!PyArg_ParseTupleAndKeywords(args, kwargs,' - '"%(typecodes)s:%(name)s"%(parselist)s))\n' - ' return %(errorreturn)s;\n' - ) - - deprecated_tmpl = ( - ' if (PyErr_Warn(PyExc_DeprecationWarning, ' - '"%(deprecationmsg)s") < 0)\n' - ' return %(errorreturn)s;\n' - ) - - methdef_tmpl = ( - ' { "%(name)s", (PyCFunction)%(cname)s, %(flags)s,\n' - ' %(docstring)s },\n' - ) - - noconstructor = ( - 'static int\n' - 'pygobject_no_constructor(PyObject *self, PyObject *args, ' - 'PyObject *kwargs)\n' - '{\n' - ' gchar buf[512];\n' - '\n' - ' g_snprintf(buf, sizeof(buf), "%s is an abstract widget", ' - 'self->ob_type->tp_name);\n' - ' PyErr_SetString(PyExc_NotImplementedError, buf);\n' - ' return -1;\n' - '}\n\n' - ) - - function_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyObject *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' %(begin_allow_threads)s\n' - ' %(setreturn)s%(cname)s(%(arglist)s);\n' - ' %(end_allow_threads)s\n' - '%(codeafter)s\n' - '}\n\n' - ) - - virtual_accessor_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyObject *cls%(extraparams)s)\n' - '{\n' - ' gpointer klass;\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' klass = g_type_class_ref(pyg_type_from_object(cls));\n' - ' if (%(class_cast_macro)s(klass)->%(virtual)s)\n' - ' %(setreturn)s%(class_cast_macro)s(klass)->' - '%(virtual)s(%(arglist)s);\n' - ' else {\n' - ' PyErr_SetString(PyExc_NotImplementedError, ' - '"virtual method %(name)s not implemented");\n' - ' g_type_class_unref(klass);\n' - ' return NULL;\n' - ' }\n' - ' g_type_class_unref(klass);\n' - '%(codeafter)s\n' - '}\n\n' - ) - - # template for method calls - constructor_tmpl = None - method_tmpl = None - - def __init__(self, parser, objinfo, overrides, fp=FileOutput(sys.stdout)): - self.parser = parser - self.objinfo = objinfo - self.overrides = overrides - self.fp = fp - - def get_lower_name(self): - return string.lower(string.replace(self.objinfo.typecode, - '_TYPE_', '_', 1)) - - def get_field_accessor(self, fieldname): - raise NotImplementedError - - def get_initial_class_substdict(self): return {} - - def get_initial_constructor_substdict(self, constructor): - return { 'name': '%s.__init__' % self.objinfo.py_name, - 'errorreturn': '-1' } - - def get_initial_method_substdict(self, method): - substdict = { 'name': '%s.%s' % (self.objinfo.py_name, method.name) } - if method.unblock_threads: - substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;' - substdict['end_allow_threads'] = 'pyg_end_allow_threads;' - else: - substdict['begin_allow_threads'] = '' - substdict['end_allow_threads'] = '' - return substdict - - def write_class(self): - if self.overrides.is_type_ignored(self.objinfo.c_name): - return - self.fp.write('\n/* ----------- %s ----------- */\n\n' % - self.objinfo.c_name) - substdict = self.get_initial_class_substdict() - if not substdict.has_key('tp_flags'): - substdict['tp_flags'] = 'Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE' - substdict['typename'] = self.objinfo.c_name - if self.overrides.modulename: - substdict['classname'] = '%s.%s' % (self.overrides.modulename, - self.objinfo.name) - else: - substdict['classname'] = self.objinfo.name - substdict['tp_doc'] = self.objinfo.docstring - - # Maybe this could be done in a nicer way, but I'll leave it as it is - # for now: -- Johan - if not self.overrides.slot_is_overriden('%s.tp_init' % - self.objinfo.c_name): - substdict['tp_init'] = self.write_constructor() - substdict['tp_methods'] = self.write_methods() - substdict['tp_getset'] = self.write_getsets() - - # handle slots ... - for slot in self.slots_list: - - slotname = '%s.%s' % (self.objinfo.c_name, slot) - slotfunc = '_wrap_%s_%s' % (self.get_lower_name(), slot) - if slot[:6] == 'tp_as_': - slotfunc = '&' + slotfunc - if self.overrides.slot_is_overriden(slotname): - data = self.overrides.slot_override(slotname) - self.write_function(slotname, data) - substdict[slot] = slotfunc - else: - if not substdict.has_key(slot): - substdict[slot] = '0' - - self.fp.write(self.type_tmpl % substdict) - - self.write_virtuals() - - def write_function_wrapper(self, function_obj, template, - handle_return=0, is_method=0, kwargs_needed=0, - substdict=None): - '''This function is the guts of all functions that generate - wrappers for functions, methods and constructors.''' - if not substdict: substdict = {} - - info = argtypes.WrapperInfo() - - substdict.setdefault('errorreturn', 'NULL') - - # for methods, we want the leading comma - if is_method: - info.arglist.append('') - - if function_obj.varargs: - raise argtypes.ArgTypeNotFoundError("varargs functions not supported") - - for param in function_obj.params: - if param.pdflt != None and '|' not in info.parsestr: - info.add_parselist('|', [], []) - handler = argtypes.matcher.get(param.ptype) - handler.write_param(param.ptype, param.pname, param.pdflt, - param.pnull, info) - - substdict['setreturn'] = '' - if handle_return: - if function_obj.ret not in ('none', None): - substdict['setreturn'] = 'ret = ' - handler = argtypes.matcher.get(function_obj.ret) - handler.write_return(function_obj.ret, - function_obj.caller_owns_return, info) - - if function_obj.deprecated != None: - deprecated = self.deprecated_tmpl % { - 'deprecationmsg': function_obj.deprecated, - 'errorreturn': substdict['errorreturn'] } - else: - deprecated = '' - - # if name isn't set, set it to function_obj.name - substdict.setdefault('name', function_obj.name) - - if function_obj.unblock_threads: - substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;' - substdict['end_allow_threads'] = 'pyg_end_allow_threads;' - else: - substdict['begin_allow_threads'] = '' - substdict['end_allow_threads'] = '' - - if self.objinfo: - substdict['typename'] = self.objinfo.c_name - substdict.setdefault('cname', function_obj.c_name) - substdict['varlist'] = info.get_varlist() - substdict['typecodes'] = info.parsestr - substdict['parselist'] = info.get_parselist() - substdict['arglist'] = info.get_arglist() - substdict['codebefore'] = deprecated + ( - string.replace(info.get_codebefore(), - 'return NULL', 'return ' + substdict['errorreturn']) - ) - substdict['codeafter'] = ( - string.replace(info.get_codeafter(), - 'return NULL', - 'return ' + substdict['errorreturn'])) - - if info.parsestr or kwargs_needed: - substdict['parseargs'] = self.parse_tmpl % substdict - substdict['extraparams'] = ', PyObject *args, PyObject *kwargs' - flags = 'METH_VARARGS|METH_KEYWORDS' - - # prepend the keyword list to the variable list - substdict['varlist'] = info.get_kwlist() + substdict['varlist'] - else: - substdict['parseargs'] = '' - substdict['extraparams'] = '' - flags = 'METH_NOARGS' - - return template % substdict, flags - - def write_constructor(self): - initfunc = '0' - constructor = self.parser.find_constructor(self.objinfo,self.overrides) - if not constructor: - return self.write_default_constructor() - - funcname = constructor.c_name - try: - if self.overrides.is_overriden(funcname): - data = self.overrides.override(funcname) - self.write_function(funcname, data) - self.objinfo.has_new_constructor_api = ( - self.objinfo.typecode in - self.overrides.newstyle_constructors) - else: - # ok, a hack to determine if we should use - # new-style constructores :P - property_based = getattr(self, - 'write_property_based_constructor', - None) - if property_based: - if (len(constructor.params) == 0 or - isinstance(constructor.params[0], - definitions.Property)): - # write_property_based_constructor is only - # implemented in GObjectWrapper - return self.write_property_based_constructor( - constructor) - else: - sys.stderr.write( - "Warning: generating old-style constructor for:" + - constructor.c_name + '\n') - - # write constructor from template ... - code = self.write_function_wrapper(constructor, - self.constructor_tmpl, - handle_return=0, is_method=0, kwargs_needed=1, - substdict=self.get_initial_constructor_substdict( - constructor))[0] - self.fp.write(code) - initfunc = '_wrap_' + funcname - except argtypes.ArgTypeError, ex: - sys.stderr.write('Could not write constructor for %s: %s\n' - % (self.objinfo.c_name, str(ex))) - - initfunc = self.write_noconstructor() - return initfunc - - def write_noconstructor(self): - # this is a hack ... - if not hasattr(self.overrides, 'no_constructor_written'): - self.fp.write(self.noconstructor) - self.overrides.no_constructor_written = 1 - initfunc = 'pygobject_no_constructor' - return initfunc - - def write_default_constructor(self): - return self.write_noconstructor() - - def get_methflags(self, funcname): - if self.overrides.wants_kwargs(funcname): - flags = 'METH_VARARGS|METH_KEYWORDS' - elif self.overrides.wants_noargs(funcname): - flags = 'METH_NOARGS' - elif self.overrides.wants_onearg(funcname): - flags = 'METH_O' - else: - flags = 'METH_VARARGS' - if self.overrides.is_staticmethod(funcname): - flags += '|METH_STATIC' - elif self.overrides.is_classmethod(funcname): - flags += '|METH_CLASS' - return flags - - def write_function(self, funcname, data): - lineno, filename = self.overrides.getstartline(funcname) - self.fp.setline(lineno, filename) - self.fp.write(data) - self.fp.resetline() - self.fp.write('\n\n') - - def _get_class_virtual_substdict(self, meth, cname, parent): - substdict = self.get_initial_method_substdict(meth) - substdict['virtual'] = meth.name - substdict['cname'] = cname - substdict['class_cast_macro'] = parent.typecode.replace( - '_TYPE_', '_', 1) + "_CLASS" - substdict['typecode'] = self.objinfo.typecode - substdict['cast'] = string.replace(parent.typecode, '_TYPE_', '_', 1) - return substdict - - def write_methods(self): - methods = [] - klass = self.objinfo.c_name - # First, get methods from the defs files - for meth in self.parser.find_methods(self.objinfo): - method_name = meth.c_name - if self.overrides.is_ignored(method_name): - continue - try: - if self.overrides.is_overriden(method_name): - if not self.overrides.is_already_included(method_name): - data = self.overrides.override(method_name) - self.write_function(method_name, data) - - methflags = self.get_methflags(method_name) - else: - # write constructor from template ... - code, methflags = self.write_function_wrapper(meth, - self.method_tmpl, handle_return=1, is_method=1, - substdict=self.get_initial_method_substdict(meth)) - self.fp.write(code) - methods.append(self.methdef_tmpl % - { 'name': fixname(meth.name), - 'cname': '_wrap_' + method_name, - 'flags': methflags, - 'docstring': meth.docstring }) - methods_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - methods_coverage.declare_not_wrapped() - sys.stderr.write('Could not write method %s.%s: %s\n' - % (klass, meth.name, str(ex))) - - # Now try to see if there are any defined in the override - for method_name in self.overrides.get_defines_for(klass): - c_name = override.class2cname(klass, method_name) - if self.overrides.is_already_included(method_name): - continue - - try: - data = self.overrides.define(klass, method_name) - self.write_function(method_name, data) - methflags = self.get_methflags(method_name) - - methods.append(self.methdef_tmpl % - { 'name': method_name, - 'cname': '_wrap_' + c_name, - 'flags': methflags, - 'docstring': 'NULL' }) - methods_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - methods_coverage.declare_not_wrapped() - sys.stderr.write('Could not write method %s.%s: %s\n' - % (klass, method_name, str(ex))) - - # Add GObject virtual method accessors, for chaining to parent - # virtuals from subclasses - methods += self.write_virtual_accessors() - - if methods: - methoddefs = '_Py%s_methods' % self.objinfo.c_name - # write the PyMethodDef structure - methods.append(' { NULL, NULL, 0, NULL }\n') - self.fp.write('static const PyMethodDef %s[] = {\n' % methoddefs) - self.fp.write(string.join(methods, '')) - self.fp.write('};\n\n') - else: - methoddefs = 'NULL' - return methoddefs - - def write_virtual_accessors(self): - klass = self.objinfo.c_name - methods = [] - for meth in self.parser.find_virtuals(self.objinfo): - method_name = self.objinfo.c_name + "__do_" + meth.name - if self.overrides.is_ignored(method_name): - continue - try: - if self.overrides.is_overriden(method_name): - if not self.overrides.is_already_included(method_name): - data = self.overrides.override(method_name) - self.write_function(method_name, data) - methflags = self.get_methflags(method_name) - else: - # temporarily add a 'self' parameter as first argument - meth.params.insert(0, definitions.Parameter( - ptype=(self.objinfo.c_name + '*'), - pname='self', pdflt=None, pnull=None)) - try: - # write method from template ... - code, methflags = self.write_function_wrapper( - meth, self.virtual_accessor_tmpl, - handle_return=True, is_method=False, - substdict=self._get_class_virtual_substdict( - meth, method_name, self.objinfo)) - self.fp.write(code) - finally: - del meth.params[0] - methods.append(self.methdef_tmpl % - { 'name': "do_" + fixname(meth.name), - 'cname': '_wrap_' + method_name, - 'flags': methflags + '|METH_CLASS', - 'docstring': 'NULL'}) - vaccessors_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - vaccessors_coverage.declare_not_wrapped() - sys.stderr.write( - 'Could not write virtual accessor method %s.%s: %s\n' - % (klass, meth.name, str(ex))) - return methods - - def write_virtuals(self): - ''' - Write _wrap_FooBar__proxy_do_zbr() reverse wrapers for - GObject virtuals - ''' - klass = self.objinfo.c_name - virtuals = [] - for meth in self.parser.find_virtuals(self.objinfo): - method_name = self.objinfo.c_name + "__proxy_do_" + meth.name - if self.overrides.is_ignored(method_name): - continue - try: - if self.overrides.is_overriden(method_name): - if not self.overrides.is_already_included(method_name): - data = self.overrides.override(method_name) - self.write_function(method_name, data) - else: - # write virtual proxy ... - ret, props = argtypes.matcher.get_reverse_ret(meth.ret) - wrapper = reversewrapper.ReverseWrapper( - '_wrap_' + method_name, is_static=True) - wrapper.set_return_type(ret(wrapper, **props)) - wrapper.add_parameter(reversewrapper.PyGObjectMethodParam( - wrapper, "self", method_name="do_" + meth.name, - c_type=(klass + ' *'))) - for param in meth.params: - handler, props = argtypes.matcher.get_reverse( - param.ptype) - props["direction"] = param.pdir - props["nullok"] = param.pnull - wrapper.add_parameter(handler(wrapper, - param.pname, **props)) - buf = reversewrapper.MemoryCodeSink() - wrapper.generate(buf) - self.fp.write(buf.flush()) - virtuals.append((fixname(meth.name), '_wrap_' + method_name)) - vproxies_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - vproxies_coverage.declare_not_wrapped() - virtuals.append((fixname(meth.name), None)) - sys.stderr.write('Could not write virtual proxy %s.%s: %s\n' - % (klass, meth.name, str(ex))) - if virtuals: - # Write a 'pygtk class init' function for this object, - # except when the object type is explicitly ignored (like - # GtkPlug and GtkSocket on win32). - if self.overrides.is_ignored(self.objinfo.typecode): - return - class_cast_macro = self.objinfo.typecode.replace( - '_TYPE_', '_', 1) + "_CLASS" - cast_macro = self.objinfo.typecode.replace('_TYPE_', '_', 1) - funcname = "__%s_class_init" % klass - self.objinfo.class_init_func = funcname - have_implemented_virtuals = not not [True - for name, cname in virtuals - if cname is not None] - self.fp.write( - ('\nstatic int\n' - '%(funcname)s(gpointer gclass, PyTypeObject *pyclass)\n' - '{\n') % vars()) - - if have_implemented_virtuals: - self.fp.write(' PyObject *o;\n') - self.fp.write( - ' %(klass)sClass *klass = ' - '%(class_cast_macro)s(gclass);\n' - ' PyObject *gsignals = ' - 'PyDict_GetItemString(pyclass->tp_dict, "__gsignals__");\n' - % vars()) - - for name, cname in virtuals: - do_name = 'do_' + name - if cname is None: - self.fp.write('\n /* overriding %(do_name)s ' - 'is currently not supported */\n' % vars()) - else: - self.fp.write(''' - o = PyObject_GetAttrString((PyObject *) pyclass, "%(do_name)s"); - if (o == NULL) - PyErr_Clear(); - else { - if (!PyObject_TypeCheck(o, &PyCFunction_Type) - && !(gsignals && PyDict_GetItemString(gsignals, "%(name)s"))) - klass->%(name)s = %(cname)s; - Py_DECREF(o); - } -''' % vars()) - self.fp.write(' return 0;\n}\n') - - def write_getsets(self): - lower_name = self.get_lower_name() - getsets_name = lower_name + '_getsets' - getterprefix = '_wrap_' + lower_name + '__get_' - setterprefix = '_wrap_' + lower_name + '__set_' - - # no overrides for the whole function. If no fields, - # don't write a func - if not self.objinfo.fields: - return '0' - getsets = [] - for ftype, cfname in self.objinfo.fields: - fname = cfname.replace('.', '_') - gettername = '0' - settername = '0' - attrname = self.objinfo.c_name + '.' + fname - if self.overrides.attr_is_overriden(attrname): - code = self.overrides.attr_override(attrname) - self.write_function(attrname, code) - if string.find(code, getterprefix + fname) >= 0: - gettername = getterprefix + fname - if string.find(code, setterprefix + fname) >= 0: - settername = setterprefix + fname - if gettername == '0': - try: - funcname = getterprefix + fname - info = argtypes.WrapperInfo() - handler = argtypes.matcher.get(ftype) - # for attributes, we don't own the "return value" - handler.write_return(ftype, 0, info) - self.fp.write(self.getter_tmpl % - { 'funcname': funcname, - 'varlist': info.varlist, - 'field': self.get_field_accessor(cfname), - 'codeafter': info.get_codeafter() }) - gettername = funcname - except argtypes.ArgTypeError, ex: - sys.stderr.write( - "Could not write getter for %s.%s: %s\n" - % (self.objinfo.c_name, fname, str(ex))) - if gettername != '0' or settername != '0': - getsets.append(' { "%s", (getter)%s, (setter)%s },\n' % - (fixname(fname), gettername, settername)) - - if not getsets: - return '0' - self.fp.write('static const PyGetSetDef %s[] = {\n' % getsets_name) - for getset in getsets: - self.fp.write(getset) - self.fp.write(' { NULL, (getter)0, (setter)0 },\n') - self.fp.write('};\n\n') - - return getsets_name - - def _write_get_symbol_names(self, writer, functions): - self.fp.write("""static PyObject * -_wrap__get_symbol_names(PyObject *self) -{ - PyObject *pylist = PyList_New(0); - -""") - for obj, bases in writer.get_classes(): - self.fp.write(' PyList_Append(pylist, ' - 'PyString_FromString("%s"));\n' % (obj.name)) - - for name, cname, flags, docstring in functions: - self.fp.write(' PyList_Append(pylist, ' - 'PyString_FromString("%s"));\n' % (name)) - - for enum in writer.get_enums(): - self.fp.write(' PyList_Append(pylist, ' - 'PyString_FromString("%s"));\n' % (enum.name)) - for nick, value in enum.values: - name = value[len(self.overrides.modulename)+1:] - self.fp.write(' PyList_Append(pylist, ' - 'PyString_FromString("%s"));\n' % (name)) - - self.fp.write(" return pylist;\n}\n\n"); - - def _write_get_symbol(self, writer, functions): - self.fp.write("""static PyObject * -_wrap__get_symbol(PyObject *self, PyObject *args) -{ - PyObject *d; - char *name; - static PyObject *modulename = NULL; - static PyObject *module = NULL; - static char *strip_prefix = "%s"; - - if (!PyArg_ParseTuple(args, "Os", &d, &name)) - return NULL; - - if (!modulename) - modulename = PyString_FromString("%s"); - - if (!module) - module = PyDict_GetItemString(d, "__module__"); - -""" % (self.overrides.modulename.upper() + '_', - self.overrides.modulename)) - - first = True - # Classes / GObjects - for obj, bases in writer.get_classes(): - if first: - self.fp.write(' if (!strcmp(name, "%s")) {\n' % obj.name) - first = False - else: - self.fp.write(' } else if (!strcmp(name, "%s")) {\n' % obj.name) - self.fp.write( - ' return (PyObject*)pygobject_lookup_class(%s);\n' % - obj.typecode) - self.fp.write(' }\n') - - # Functions - for name, cname, flags, docstring in functions: - self.fp.write(' else if (!strcmp(name, "%s")) {\n' % name) - self.fp.write(' static PyMethodDef ml = { ' - '"%s", (PyCFunction)%s, %s, "%s"};\n' % ( - name, cname, flags, docstring)) - self.fp.write(' return PyCFunction_NewEx(&ml, NULL, modulename);\n') - self.fp.write(' }\n') - - # Enums - def write_enum(enum, returnobj=False): - if returnobj: - ret = 'return ' - else: - ret = '' - if enum.deftype == 'enum': - self.fp.write( - ' %spyg_enum_add(module, "%s", strip_prefix, %s);\n' - % (ret, enum.name, enum.typecode)) - else: - self.fp.write( - ' %spyg_flags_add(module, "%s", strip_prefix, %s);\n' - % (ret, enum.name, enum.typecode)) - - strip_len = len(self.overrides.modulename)+1 # GTK_ - for enum in writer.get_enums(): - # XXX: Implement without typecodes - self.fp.write(' else if (!strcmp(name, "%s")) {\n' % enum.name) - write_enum(enum, returnobj=True) - self.fp.write(' }\n') - - for nick, value in enum.values: - value = value[strip_len:] - self.fp.write(' else if (!strcmp(name, "%s")) {\n' % value) - write_enum(enum) - self.fp.write(' return PyObject_GetAttrString(module, "%s");\n' % - value) - self.fp.write(' }\n') - - self.fp.write(' return Py_None;\n}\n\n'); - - def _write_function_bodies(self): - functions = [] - # First, get methods from the defs files - for func in self.parser.find_functions(): - funcname = func.c_name - if self.overrides.is_ignored(funcname): - continue - try: - if self.overrides.is_overriden(funcname): - data = self.overrides.override(funcname) - self.write_function(funcname, data) - - methflags = self.get_methflags(funcname) - else: - # write constructor from template ... - code, methflags = self.write_function_wrapper(func, - self.function_tmpl, handle_return=1, is_method=0) - self.fp.write(code) - functions.append((func.name, '_wrap_' + funcname, - methflags, func.docstring)) - functions_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - functions_coverage.declare_not_wrapped() - sys.stderr.write('Could not write function %s: %s\n' - % (func.name, str(ex))) - - # Now try to see if there are any defined in the override - for funcname in self.overrides.get_functions(): - try: - data = self.overrides.function(funcname) - self.write_function(funcname, data) - methflags = self.get_methflags(funcname) - functions.append((funcname, '_wrap_' + funcname, - methflags, 'NULL')) - functions_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - functions_coverage.declare_not_wrapped() - sys.stderr.write('Could not write function %s: %s\n' - % (funcname, str(ex))) - return functions - - def write_functions(self, writer, prefix): - self.fp.write('\n/* ----------- functions ----------- */\n\n') - functions = [] - func_infos = self._write_function_bodies() - - # If we have a dynamic namespace, write symbol and attribute getter - if self.overrides.dynamicnamespace: - self._write_get_symbol_names(writer, func_infos) - self._write_get_symbol(writer, func_infos) - for obj, bases in writer.get_classes(): - self.fp.write("""static PyTypeObject * -%s_register_type(const gchar *name, PyObject *unused) -{ - PyObject *m = PyImport_ImportModule("gtk"); - PyObject *d = PyModule_GetDict(m); -""" % obj.c_name) - writer.write_class(obj, bases, indent=1) - self.fp.write( - ' return (%s)PyDict_GetItemString(d, "%s");\n' % ( - 'PyTypeObject*', obj.name)) - self.fp.write("}\n") - - functions.append(' { "_get_symbol_names", ' - '(PyCFunction)_wrap__get_symbol_names, ' - 'METH_NOARGS, NULL },\n') - functions.append(' { "_get_symbol", ' - '(PyCFunction)_wrap__get_symbol, ' - 'METH_VARARGS, NULL },\n') - else: - for name, cname, flags, docstring in func_infos: - functions.append(self.methdef_tmpl % dict(name=name, - cname=cname, - flags=flags, - docstring=docstring)) - - # write the PyMethodDef structure - functions.append(' { NULL, NULL, 0, NULL }\n') - - self.fp.write('const PyMethodDef ' + prefix + '_functions[] = {\n') - self.fp.write(string.join(functions, '')) - self.fp.write('};\n\n') - -class GObjectWrapper(Wrapper): - constructor_tmpl = ( - 'static int\n' - '_wrap_%(cname)s(PyGObject *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' self->obj = (GObject *)%(cname)s(%(arglist)s);\n' - '%(codeafter)s\n' - ' if (!self->obj) {\n' - ' PyErr_SetString(PyExc_RuntimeError, ' - '"could not create %(typename)s object");\n' - ' return -1;\n' - ' }\n' - '%(aftercreate)s' - ' pygobject_register_wrapper((PyObject *)self);\n' - ' return 0;\n' - '}\n\n' - ) - - method_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyGObject *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' %(begin_allow_threads)s\n' - ' %(setreturn)s%(cname)s(%(cast)s(self->obj)%(arglist)s);\n' - ' %(end_allow_threads)s\n' - '%(codeafter)s\n' - '}\n\n' - ) - def __init__(self, parser, objinfo, overrides, fp=FileOutput(sys.stdout)): - Wrapper.__init__(self, parser, objinfo, overrides, fp) - if self.objinfo: - self.castmacro = string.replace(self.objinfo.typecode, - '_TYPE_', '_', 1) - - def get_initial_class_substdict(self): - return { 'tp_basicsize' : 'PyGObject', - 'tp_weaklistoffset' : 'offsetof(PyGObject, weakreflist)', - 'tp_dictoffset' : 'offsetof(PyGObject, inst_dict)' } - - def get_field_accessor(self, fieldname): - castmacro = string.replace(self.objinfo.typecode, '_TYPE_', '_', 1) - return '%s(pygobject_get(self))->%s' % (castmacro, fieldname) - - def get_initial_constructor_substdict(self, constructor): - substdict = Wrapper.get_initial_constructor_substdict(self, - constructor) - if not constructor.caller_owns_return: - substdict['aftercreate'] = " g_object_ref(self->obj);\n" - else: - substdict['aftercreate'] = '' - return substdict - - def get_initial_method_substdict(self, method): - substdict = Wrapper.get_initial_method_substdict(self, method) - substdict['cast'] = string.replace(self.objinfo.typecode, - '_TYPE_', '_', 1) - return substdict - - def write_default_constructor(self): - try: - parent = self.parser.find_object(self.objinfo.parent) - except ValueError: - parent = None - if parent is not None: - ## just like the constructor is inheritted, we should - # inherit the new API compatibility flag - self.objinfo.has_new_constructor_api = ( - parent.has_new_constructor_api) - elif self.objinfo.parent == 'GObject': - self.objinfo.has_new_constructor_api = True - return '0' - - def write_property_based_constructor(self, constructor): - self.objinfo.has_new_constructor_api = True - out = self.fp - print >> out, "static int" - print >> out, '_wrap_%s(PyGObject *self, PyObject *args,' \ - ' PyObject *kwargs)\n{' % constructor.c_name - if constructor.params: - s = " GType obj_type = pyg_type_from_object((PyObject *) self);" - print >> out, s - - def py_str_list_to_c(arg): - if arg: - return "{" + ", ".join( - map(lambda s: '"' + s + '"', arg)) + ", NULL }" - else: - return "{ NULL }" - - classname = '%s.%s' % (self.overrides.modulename, - self.objinfo.name) - - if constructor.params: - mandatory_arguments = [param for param in constructor.params - if not param.optional] - optional_arguments = [param for param in constructor.params - if param.optional] - arg_names = py_str_list_to_c( - [param.argname - for param in mandatory_arguments + optional_arguments]) - - prop_names = py_str_list_to_c( - [param.pname - for param in mandatory_arguments + optional_arguments]) - - print >> out, " GParameter params[%i];" % \ - len(constructor.params) - print >> out, " PyObject *parsed_args[%i] = {NULL, };" % \ - len(constructor.params) - print >> out, " char *arg_names[] = %s;" % arg_names - print >> out, " char *prop_names[] = %s;" % prop_names - print >> out, " guint nparams, i;" - print >> out - if constructor.deprecated is not None: - out.write( - ' if (PyErr_Warn(PyExc_DeprecationWarning, ' - '"%s") < 0)\n' % - constructor.deprecated) - print >> out, ' return -1;' - print >> out - out.write(" if (!PyArg_ParseTupleAndKeywords(args, kwargs, ") - template = '"' - if mandatory_arguments: - template += "O"*len(mandatory_arguments) - if optional_arguments: - template += "|" + "O"*len(optional_arguments) - template += ':%s.__init__"' % classname - print >> out, template, ", arg_names", - for i in range(len(constructor.params)): - print >> out, ", &parsed_args[%i]" % i, - - out.write( - "))\n" - " return -1;\n" - "\n" - " memset(params, 0, sizeof(GParameter)*%i);\n" - " if (!pyg_parse_constructor_args(obj_type, arg_names,\n" - " prop_names, params, \n" - " &nparams, parsed_args))\n" - " return -1;\n" - " pygobject_constructv(self, nparams, params);\n" - " for (i = 0; i < nparams; ++i)\n" - " g_value_unset(¶ms[i].value);\n" - % len(constructor.params)) - else: - out.write( - " static char* kwlist[] = { NULL };\n" - "\n") - - if constructor.deprecated is not None: - out.write( - ' if (PyErr_Warn(PyExc_DeprecationWarning, "%s") < 0)\n' - ' return -1;\n' - '\n' % constructor.deprecated) - - out.write( - ' if (!PyArg_ParseTupleAndKeywords(args, kwargs,\n' - ' ":%s.__init__",\n' - ' kwlist))\n' - ' return -1;\n' - '\n' - ' pygobject_constructv(self, 0, NULL);\n' % classname) - out.write( - ' if (!self->obj) {\n' - ' PyErr_SetString(\n' - ' PyExc_RuntimeError, \n' - ' "could not create %s object");\n' - ' return -1;\n' - ' }\n' % classname) - - if not constructor.caller_owns_return: - print >> out, " g_object_ref(self->obj);\n" - - out.write( - ' return 0;\n' - '}\n\n') - - return "_wrap_%s" % constructor.c_name - - -class GInterfaceWrapper(GObjectWrapper): - virtual_accessor_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyObject *cls%(extraparams)s)\n' - '{\n' - ' %(vtable)s *iface;\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' iface = g_type_interface_peek(' - 'g_type_class_peek(pyg_type_from_object(cls)), %(typecode)s);\n' - ' if (iface->%(virtual)s)\n' - ' %(setreturn)siface->%(virtual)s(%(arglist)s);\n' - ' else {\n' - ' PyErr_SetString(PyExc_NotImplementedError, ' - '"interface method %(name)s not implemented");\n' - ' return NULL;\n' - ' }\n' - '%(codeafter)s\n' - '}\n\n' - ) - - def get_initial_class_substdict(self): - return { 'tp_basicsize' : 'PyObject', - 'tp_weaklistoffset' : '0', - 'tp_dictoffset' : '0'} - - def write_constructor(self): - # interfaces have no constructors ... - return '0' - def write_getsets(self): - # interfaces have no fields ... - return '0' - - def _get_class_virtual_substdict(self, meth, cname, parent): - substdict = self.get_initial_method_substdict(meth) - substdict['virtual'] = meth.name - substdict['cname'] = cname - substdict['typecode'] = self.objinfo.typecode - substdict['vtable'] = self.objinfo.vtable - return substdict - - def write_virtuals(self): - ## Now write reverse method wrappers, which let python code - ## implement interface methods. - # First, get methods from the defs files - klass = self.objinfo.c_name - proxies = [] - for meth in self.parser.find_virtuals(self.objinfo): - method_name = self.objinfo.c_name + "__proxy_do_" + meth.name - if self.overrides.is_ignored(method_name): - continue - try: - if self.overrides.is_overriden(method_name): - if not self.overrides.is_already_included(method_name): - data = self.overrides.override(method_name) - self.write_function(method_name, data) - else: - # write proxy ... - ret, props = argtypes.matcher.get_reverse_ret(meth.ret) - wrapper = reversewrapper.ReverseWrapper( - '_wrap_' + method_name, is_static=True) - wrapper.set_return_type(ret(wrapper, **props)) - wrapper.add_parameter(reversewrapper.PyGObjectMethodParam( - wrapper, "self", method_name="do_" + meth.name, - c_type=(klass + ' *'))) - for param in meth.params: - handler, props = argtypes.matcher.get_reverse( - param.ptype) - props["direction"] = param.pdir - props["nullok"] = param.pnull - wrapper.add_parameter( - handler(wrapper, param.pname, **props)) - buf = reversewrapper.MemoryCodeSink() - wrapper.generate(buf) - self.fp.write(buf.flush()) - proxies.append((fixname(meth.name), '_wrap_' + method_name)) - iproxies_coverage.declare_wrapped() - except argtypes.ArgTypeError, ex: - iproxies_coverage.declare_not_wrapped() - proxies.append((fixname(meth.name), None)) - sys.stderr.write('Could not write interface proxy %s.%s: %s\n' - % (klass, meth.name, str(ex))) - - if not proxies or not [cname for name, cname in proxies if cname]: - return - - ## Write an interface init function for this object - funcname = "__%s__interface_init" % klass - vtable = self.objinfo.vtable - self.fp.write( - '\nstatic void\n' - '%(funcname)s(%(vtable)s *iface, PyTypeObject *pytype)\n' - '{\n' - ' %(vtable)s *parent_iface = ' - 'g_type_interface_peek_parent(iface);\n' - ' PyObject *py_method;\n' - '\n' - % vars()) - - for name, cname in proxies: - do_name = 'do_' + name - if cname is None: - continue - - self.fp.write(( - ' py_method = pytype? PyObject_GetAttrString(' - '(PyObject *) pytype, "%(do_name)s") : NULL;\n' - ' if (py_method && !PyObject_TypeCheck(py_method, ' - '&PyCFunction_Type)) {\n' - ' iface->%(name)s = %(cname)s;\n' - ' } else {\n' - ' PyErr_Clear();\n' - ' if (parent_iface) {\n' - ' iface->%(name)s = parent_iface->%(name)s;\n' - ' }\n' - ' Py_XDECREF(py_method);\n' - ' }\n' - ) % vars()) - self.fp.write('}\n\n') - interface_info = "__%s__iinfo" % klass - self.fp.write(''' -static const GInterfaceInfo %s = { - (GInterfaceInitFunc) %s, - NULL, - NULL -}; -''' % (interface_info, funcname)) - self.objinfo.interface_info = interface_info - -class GBoxedWrapper(Wrapper): - constructor_tmpl = ( - 'static int\n' - '_wrap_%(cname)s(PyGBoxed *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' self->gtype = %(typecode)s;\n' - ' self->free_on_dealloc = FALSE;\n' - ' self->boxed = %(cname)s(%(arglist)s);\n' - '%(codeafter)s\n' - ' if (!self->boxed) {\n' - ' PyErr_SetString(PyExc_RuntimeError, ' - '"could not create %(typename)s object");\n' - ' return -1;\n' - ' }\n' - ' self->free_on_dealloc = TRUE;\n' - ' return 0;\n' - '}\n\n' - ) - - method_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyObject *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' %(begin_allow_threads)s\n' - ' %(setreturn)s%(cname)s(pyg_boxed_get(self, ' - '%(typename)s)%(arglist)s);\n' - ' %(end_allow_threads)s\n' - '%(codeafter)s\n' - '}\n\n' - ) - - def get_initial_class_substdict(self): - return { 'tp_basicsize' : 'PyGBoxed', - 'tp_weaklistoffset' : '0', - 'tp_dictoffset' : '0' } - - def get_field_accessor(self, fieldname): - return 'pyg_boxed_get(self, %s)->%s' % (self.objinfo.c_name, fieldname) - - def get_initial_constructor_substdict(self, constructor): - substdict = Wrapper.get_initial_constructor_substdict( - self, constructor) - substdict['typecode'] = self.objinfo.typecode - return substdict - -class GPointerWrapper(GBoxedWrapper): - constructor_tmpl = ( - 'static int\n' - '_wrap_%(cname)s(PyGPointer *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' self->gtype = %(typecode)s;\n' - ' self->pointer = %(cname)s(%(arglist)s);\n' - '%(codeafter)s\n' - ' if (!self->pointer) {\n' - ' PyErr_SetString(PyExc_RuntimeError, ' - '"could not create %(typename)s object");\n' - ' return -1;\n' - ' }\n' - ' return 0;\n' - '}\n\n' - ) - - method_tmpl = ( - 'static PyObject *\n' - '_wrap_%(cname)s(PyObject *self%(extraparams)s)\n' - '{\n' - '%(varlist)s' - '%(parseargs)s' - '%(codebefore)s' - ' %(setreturn)s%(cname)s(pyg_pointer_get(self, ' - '%(typename)s)%(arglist)s);\n' - '%(codeafter)s\n' - '}\n\n' - ) - - def get_initial_class_substdict(self): - return { 'tp_basicsize' : 'PyGPointer', - 'tp_weaklistoffset' : '0', - 'tp_dictoffset' : '0' } - - def get_field_accessor(self, fieldname): - return 'pyg_pointer_get(self, %s)->%s' % (self.objinfo.c_name, - fieldname) - - def get_initial_constructor_substdict(self, constructor): - substdict = Wrapper.get_initial_constructor_substdict( - self, constructor) - substdict['typecode'] = self.objinfo.typecode - return substdict - -class SourceWriter: - def __init__(self, parser, overrides, prefix, fp=FileOutput(sys.stdout)): - self.parser = parser - self.overrides = overrides - self.prefix = prefix - self.fp = fp - - def write(self, py_ssize_t_clean=False): - argtypes.py_ssize_t_clean = py_ssize_t_clean - - self.write_headers(py_ssize_t_clean) - self.write_imports() - self.write_type_declarations() - self.write_body() - self.write_classes() - - wrapper = Wrapper(self.parser, None, self.overrides, self.fp) - wrapper.write_functions(self, self.prefix) - - if not self.overrides.dynamicnamespace: - self.write_enums() - self.write_extension_init() - self.write_registers() - - argtypes.py_ssize_t_clean = False - - def write_headers(self, py_ssize_t_clean): - self.fp.write('/* -- THIS FILE IS GENERATED - DO NOT EDIT */') - self.fp.write('/* -*- Mode: C; c-basic-offset: 4 -*- */\n\n') - if py_ssize_t_clean: - self.fp.write('#define PY_SSIZE_T_CLEAN\n') - self.fp.write('#include \n\n\n') - if py_ssize_t_clean: - self.fp.write(''' - -#if PY_VERSION_HEX < 0x02050000 -typedef int Py_ssize_t; -#define PY_SSIZE_T_MAX INT_MAX -#define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intobjargproc ssizeobjargproc; -#endif - -''') - self.fp.write(self.overrides.get_headers()) - self.fp.resetline() - self.fp.write('\n\n') - - def write_imports(self): - self.fp.write('/* ---------- types from other modules ---------- */\n') - for module, pyname, cname, importing_for in self.overrides.get_imports(): - if importing_for is None or is_registered_object(importing_for): - self.fp.write('static PyTypeObject *_%s;\n' % cname) - self.fp.write('#define %s (*_%s)\n' % (cname, cname)) - self.fp.write('\n\n') - - def write_type_declarations(self): - #todo use 'static' if used only in one file - self.fp.write('/* ---------- forward type declarations ---------- */\n') - for obj in self.parser.boxes: - if not self.overrides.is_type_ignored(obj.c_name): - self.fp.write('PyTypeObject G_GNUC_INTERNAL Py' + obj.c_name + '_Type;\n') - for obj in self.parser.objects: - if not self.overrides.is_type_ignored(obj.c_name): - self.fp.write('PyTypeObject G_GNUC_INTERNAL Py' + obj.c_name + '_Type;\n') - for interface in self.parser.interfaces: - if not self.overrides.is_type_ignored(interface.c_name): - self.fp.write('PyTypeObject G_GNUC_INTERNAL Py' + interface.c_name + '_Type;\n') - self.fp.write('\n') - - def write_body(self): - self.fp.write(self.overrides.get_body()) - self.fp.resetline() - self.fp.write('\n\n') - - def _sort_parent_children(self, objects): - objects = list(objects) - modified = True - while modified: - modified = False - parent_index = None - child_index = None - for i, obj in enumerate(objects): - if obj.parent == 'GObject': - continue - if obj.parent not in [info.c_name for info in objects[:i]]: - for j, info in enumerate(objects[i+1:]): - if info.c_name == obj.parent: - parent_index = i + 1 + j - child_index = i - break - else: - continue - break - if child_index is not None and parent_index is not None: - if child_index != parent_index: - objects.insert(child_index, objects.pop(parent_index)) - modified = True - return objects - - def write_classes(self): - ## Sort the objects, so that we generate code for the parent types - ## before their children. - objects = self._sort_parent_children(self.parser.objects) - - for klass, items in ((GBoxedWrapper, self.parser.boxes), - (GPointerWrapper, self.parser.pointers), - (GObjectWrapper, objects), - (GInterfaceWrapper, self.parser.interfaces)): - for item in items: - instance = klass(self.parser, item, self.overrides, self.fp) - instance.write_class() - self.fp.write('\n') - - def get_enums(self): - enums = [] - for enum in self.parser.enums: - if self.overrides.is_type_ignored(enum.c_name): - continue - enums.append(enum) - return enums - - def write_enums(self): - if not self.parser.enums: - return - - self.fp.write('\n/* ----------- enums and flags ----------- */\n\n') - self.fp.write( - 'void\n' + self.prefix + - '_add_constants(PyObject *module, const gchar *strip_prefix)\n{\n') - - self.fp.write( - '#ifdef VERSION\n' - ' PyModule_AddStringConstant(module, "__version__", VERSION);\n' - '#endif\n') - - for enum in self.get_enums(): - if enum.typecode is None: - for nick, value in enum.values: - self.fp.write( - ' PyModule_AddIntConstant(module, ' - '(char *) pyg_constant_strip_prefix("%s", strip_prefix), %s);\n' - % (value, value)) - else: - if enum.deftype == 'enum': - self.fp.write(' pyg_enum_add(module, "%s", strip_prefix, %s);\n' - % (enum.name, enum.typecode)) - else: - self.fp.write(' pyg_flags_add(module, "%s", strip_prefix, %s);\n' - % (enum.name, enum.typecode)) - - self.fp.write('\n') - self.fp.write(' if (PyErr_Occurred())\n') - self.fp.write(' PyErr_Print();\n') - self.fp.write('}\n\n') - - def write_object_imports(self, retval=''): - imports = self.overrides.get_imports()[:] - if not imports: - return - - bymod = {} - for module, pyname, cname, importing_for in imports: - if importing_for is None or is_registered_object(importing_for): - bymod.setdefault(module, []).append((pyname, cname)) - self.fp.write(' PyObject *module;\n\n') - for module in bymod: - self.fp.write( - ' if ((module = PyImport_ImportModule("%s")) != NULL) {\n' - % module) - #self.fp.write( - # ' PyObject *moddict = PyModule_GetDict(module);\n\n') - for pyname, cname in bymod[module]: - #self.fp.write( - # ' _%s = (PyTypeObject *)PyDict_GetItemString(' - # 'moddict, "%s");\n' % (cname, pyname)) - self.fp.write( - ' _%s = (PyTypeObject *)PyObject_GetAttrString(' - 'module, "%s");\n' % (cname, pyname)) - self.fp.write(' if (_%s == NULL) {\n' % cname) - self.fp.write(' PyErr_SetString(PyExc_ImportError,\n') - self.fp.write(' "cannot import name %s from %s");\n' - % (pyname, module)) - self.fp.write(' return %s;\n' % retval) - self.fp.write(' }\n') - self.fp.write(' } else {\n') - self.fp.write(' PyErr_SetString(PyExc_ImportError,\n') - self.fp.write(' "could not import %s");\n' % module) - self.fp.write(' return %s;\n' % retval) - self.fp.write(' }\n') - self.fp.write('\n') - - def write_extension_init(self): - self.fp.write('/* initialise stuff extension classes */\n') - self.fp.write('void\n' + self.prefix + '_register_classes(PyObject *d)\n{\n') - self.write_object_imports() - self.fp.write(self.overrides.get_init() + '\n') - self.fp.resetline() - - def get_classes(self): - objects = self.parser.objects[:] - pos = 0 - while pos < len(objects): - parent = objects[pos].parent - for i in range(pos+1, len(objects)): - if objects[i].c_name == parent: - objects.insert(i+1, objects[pos]) - del objects[pos] - break - else: - pos = pos + 1 - - retval = [] - for obj in objects: - if self.overrides.is_type_ignored(obj.c_name): - continue - bases = [] - if obj.parent != None: - bases.append(obj.parent) - bases = bases + obj.implements - retval.append((obj, bases)) - - return retval - - def write_registers(self): - for boxed in self.parser.boxes: - if not self.overrides.is_type_ignored(boxed.c_name): - self.fp.write(' pyg_register_boxed(d, "' + boxed.name + - '", ' + boxed.typecode + - ', &Py' + boxed.c_name + - '_Type);\n') - for pointer in self.parser.pointers: - if not self.overrides.is_type_ignored(pointer.c_name): - self.fp.write(' pyg_register_pointer(d, "' + pointer.name + - '", ' + pointer.typecode + - ', &Py' + pointer.c_name + '_Type);\n') - for interface in self.parser.interfaces: - if not self.overrides.is_type_ignored(interface.c_name): - self.fp.write(' pyg_register_interface(d, "' - + interface.name + '", '+ interface.typecode - + ', &Py' + interface.c_name + '_Type);\n') - if interface.interface_info is not None: - self.fp.write(' pyg_register_interface_info(%s, &%s);\n' % - (interface.typecode, interface.interface_info)) - - if not self.overrides.dynamicnamespace: - for obj, bases in self.get_classes(): - self.write_class(obj, bases) - else: - for obj, bases in self.get_classes(): - self.fp.write( - ' pyg_type_register_custom_callback("%s", ' - '(PyGTypeRegistrationFunction)%s_register_type, d);\n' % - (obj.c_name, obj.c_name)) - - self.fp.write('}\n') - - def _can_direct_ref(self, base): - if not self.overrides.dynamicnamespace: - return True - if base == 'GObject': - return True - obj = get_object_by_name(base) - if obj.module.lower() != self.overrides.modulename: - return True - return False - - def write_class(self, obj, bases, indent=1): - indent_str = ' ' * (indent * 4) - if bases: - bases_str = 'Py_BuildValue("(%s)"' % (len(bases) * 'O') - - for base in bases: - if self._can_direct_ref(base): - bases_str += ', &Py%s_Type' % base - else: - baseobj = get_object_by_name(base) - bases_str += ', PyObject_GetAttrString(m, "%s")' % baseobj.name - bases_str += ')' - else: - bases_str = 'NULL' - - self.fp.write( - '%(indent)spygobject_register_class(d, "%(c_name)s", %(typecode)s, &Py%(c_name)s_Type, %(bases)s);\n' - % dict(indent=indent_str, c_name=obj.c_name, typecode=obj.typecode, bases=bases_str)) - - if obj.has_new_constructor_api: - self.fp.write( - indent_str + 'pyg_set_object_has_new_constructor(%s);\n' % - obj.typecode) - else: - print >> sys.stderr, ( - "Warning: Constructor for %s needs to be updated to new API\n" - " See http://live.gnome.org/PyGTK_2fWhatsNew28" - "#update-constructors") % obj.c_name - - if obj.class_init_func is not None: - self.fp.write( - indent_str + 'pyg_register_class_init(%s, %s);\n' % - (obj.typecode, obj.class_init_func)) - -_objects = {} - -def is_registered_object(c_name): - return c_name in _objects - -def get_object_by_name(c_name): - global _objects - return _objects[c_name] - -def register_types(parser): - global _objects - for boxed in parser.boxes: - argtypes.matcher.register_boxed(boxed.c_name, boxed.typecode) - _objects[boxed.c_name] = boxed - for pointer in parser.pointers: - argtypes.matcher.register_pointer(pointer.c_name, pointer.typecode) - for obj in parser.objects: - argtypes.matcher.register_object(obj.c_name, obj.parent, obj.typecode) - _objects[obj.c_name] = obj - for iface in parser.interfaces: - argtypes.matcher.register_object(iface.c_name, None, iface.typecode) - _objects[iface.c_name] = iface - for enum in parser.enums: - if enum.deftype == 'flags': - argtypes.matcher.register_flag(enum.c_name, enum.typecode) - else: - argtypes.matcher.register_enum(enum.c_name, enum.typecode) - -usage = 'usage: codegen.py [-o overridesfile] [-p prefix] defsfile' -def main(argv): - o = override.Overrides() - prefix = 'pygtk' - outfilename = None - errorfilename = None - opts, args = getopt.getopt(argv[1:], "o:p:r:t:D:I:", - ["override=", "prefix=", "register=", "outfilename=", - "load-types=", "errorfilename=", "py_ssize_t-clean"]) - defines = {} # -Dkey[=val] options - py_ssize_t_clean = False - for opt, arg in opts: - if opt in ('-o', '--override'): - o = override.Overrides(arg) - elif opt in ('-p', '--prefix'): - prefix = arg - elif opt in ('-r', '--register'): - # Warning: user has to make sure all -D options appear before -r - p = defsparser.DefsParser(arg, defines) - p.startParsing() - register_types(p) - del p - elif opt == '--outfilename': - outfilename = arg - elif opt == '--errorfilename': - errorfilename = arg - elif opt in ('-t', '--load-types'): - globals = {} - execfile(arg, globals) - elif opt == '-D': - nameval = arg.split('=') - try: - defines[nameval[0]] = nameval[1] - except IndexError: - defines[nameval[0]] = None - elif opt == '-I': - defsparser.include_path.insert(0, arg) - elif opt == '--py_ssize_t-clean': - py_ssize_t_clean = True - if len(args) < 1: - print >> sys.stderr, usage - return 1 - if errorfilename: - sys.stderr = open(errorfilename, "w") - p = defsparser.DefsParser(args[0], defines) - if not outfilename: - outfilename = os.path.splitext(args[0])[0] + '.c' - - p.startParsing() - - register_types(p) - sw = SourceWriter(p, o, prefix, FileOutput(sys.stdout, outfilename)) - sw.write(py_ssize_t_clean) - - functions_coverage.printstats() - methods_coverage.printstats() - vproxies_coverage.printstats() - vaccessors_coverage.printstats() - iproxies_coverage.printstats() - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/codegen/createdefs.py b/codegen/createdefs.py deleted file mode 100755 index 84d50b1..0000000 --- a/codegen/createdefs.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -import sys - -def main(args): - output = args[1] - input = args[2:] - outfd = open(output, 'w') - outfd.write(';; -*- scheme -*-\n') - outfd.write(';; THIS FILE IS GENERATED - DO NOT EDIT\n') - for filename in input: - outfd.write('(include "%s")\n' % filename) - outfd.close() - - return 0 - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/codegen/definitions.py b/codegen/definitions.py deleted file mode 100644 index bfb6faf..0000000 --- a/codegen/definitions.py +++ /dev/null @@ -1,575 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- -import copy -import sys - -def get_valid_scheme_definitions(defs): - return [x for x in defs if isinstance(x, tuple) and len(x) >= 2] - -def unescape(s): - s = s.replace('\r\n', '\\r\\n').replace('\t', '\\t') - return s.replace('\r', '\\r').replace('\n', '\\n') - -def make_docstring(lines): - return "(char *) " + '\n'.join(['"%s"' % unescape(s) for s in lines]) - -# New Parameter class, wich emulates a tuple for compatibility reasons -class Parameter(object): - def __init__(self, ptype, pname, pdflt, pnull, pdir=None): - self.ptype = ptype - self.pname = pname - self.pdflt = pdflt - self.pnull = pnull - self.pdir = pdir - - def __len__(self): return 4 - def __getitem__(self, i): - return (self.ptype, self.pname, self.pdflt, self.pnull)[i] - - def merge(self, old): - if old.pdflt is not None: - self.pdflt = old.pdflt - if old.pnull is not None: - self.pnull = old.pnull - -# We currently subclass 'str' to make impact on the rest of codegen as -# little as possible. Later we can subclass 'object' instead, but -# then we must find and adapt all places which expect return types to -# be strings. -class ReturnType(str): - def __new__(cls, *args, **kwds): - return str.__new__(cls, *args[:1]) - def __init__(self, type_name, optional=False): - str.__init__(self) - self.optional = optional - -# Parameter for property based constructors -class Property(object): - def __init__(self, pname, optional, argname): - self.pname = pname - self.optional = optional - self.argname = argname - - def __len__(self): return 4 - def __getitem__(self, i): - return ('', self.pname, self.optional, self.argname)[i] - - def merge(self, old): - if old.optional is not None: - self.optional = old.optional - if old.argname is not None: - self.argname = old.argname - - -class Definition(object): - docstring = "NULL" - - def py_name(self): - return '%s.%s' % (self.module, self.name) - - py_name = property(py_name) - - def __init__(self, *args): - """Create a new defs object of this type. The arguments are the - components of the definition""" - raise RuntimeError("this is an abstract class") - - def merge(self, old): - """Merge in customisations from older version of definition""" - raise RuntimeError("this is an abstract class") - - def write_defs(self, fp=sys.stdout): - """write out this definition in defs file format""" - raise RuntimeError("this is an abstract class") - - def guess_return_value_ownership(self): - "return 1 if caller owns return value" - if getattr(self, 'is_constructor_of', False): - self.caller_owns_return = True - elif self.ret in ('char*', 'gchar*', 'string'): - self.caller_owns_return = True - else: - self.caller_owns_return = False - - -class ObjectDef(Definition): - def __init__(self, name, *args): - self.name = name - self.module = None - self.parent = None - self.c_name = None - self.typecode = None - self.fields = [] - self.implements = [] - self.class_init_func = None - self.has_new_constructor_api = False - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.module = arg[1] - elif arg[0] == 'docstring': - self.docstring = make_docstring(arg[1:]) - elif arg[0] == 'parent': - self.parent = arg[1] - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'fields': - for parg in arg[1:]: - self.fields.append((parg[0], parg[1])) - elif arg[0] == 'implements': - self.implements.append(arg[1]) - def merge(self, old): - # currently the .h parser doesn't try to work out what fields of - # an object structure should be public, so we just copy the list - # from the old version ... - self.fields = old.fields - self.implements = old.implements - def write_defs(self, fp=sys.stdout): - fp.write('(define-object ' + self.name + '\n') - if self.module: - fp.write(' (in-module "' + self.module + '")\n') - if self.parent != (None, None): - fp.write(' (parent "' + self.parent + '")\n') - for interface in self.implements: - fp.write(' (implements "' + interface + '")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.fields: - fp.write(' (fields\n') - for (ftype, fname) in self.fields: - fp.write(' \'("' + ftype + '" "' + fname + '")\n') - fp.write(' )\n') - fp.write(')\n\n') - -class InterfaceDef(Definition): - def __init__(self, name, *args): - self.name = name - self.module = None - self.c_name = None - self.typecode = None - self.vtable = None - self.fields = [] - self.interface_info = None - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.module = arg[1] - elif arg[0] == 'docstring': - self.docstring = make_docstring(arg[1:]) - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'vtable': - self.vtable = arg[1] - if self.vtable is None: - self.vtable = self.c_name + "Iface" - def write_defs(self, fp=sys.stdout): - fp.write('(define-interface ' + self.name + '\n') - if self.module: - fp.write(' (in-module "' + self.module + '")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - fp.write(')\n\n') - -class EnumDef(Definition): - def __init__(self, name, *args): - self.deftype = 'enum' - self.name = name - self.in_module = None - self.c_name = None - self.typecode = None - self.values = [] - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.in_module = arg[1] - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'values': - for varg in arg[1:]: - self.values.append((varg[0], varg[1])) - def merge(self, old): - pass - def write_defs(self, fp=sys.stdout): - fp.write('(define-' + self.deftype + ' ' + self.name + '\n') - if self.in_module: - fp.write(' (in-module "' + self.in_module + '")\n') - fp.write(' (c-name "' + self.c_name + '")\n') - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.values: - fp.write(' (values\n') - for name, val in self.values: - fp.write(' \'("' + name + '" "' + val + '")\n') - fp.write(' )\n') - fp.write(')\n\n') - -class FlagsDef(EnumDef): - def __init__(self, *args): - apply(EnumDef.__init__, (self,) + args) - self.deftype = 'flags' - -class BoxedDef(Definition): - def __init__(self, name, *args): - self.name = name - self.module = None - self.c_name = None - self.typecode = None - self.copy = None - self.release = None - self.fields = [] - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.module = arg[1] - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'copy-func': - self.copy = arg[1] - elif arg[0] == 'release-func': - self.release = arg[1] - elif arg[0] == 'fields': - for parg in arg[1:]: - self.fields.append((parg[0], parg[1])) - def merge(self, old): - # currently the .h parser doesn't try to work out what fields of - # an object structure should be public, so we just copy the list - # from the old version ... - self.fields = old.fields - def write_defs(self, fp=sys.stdout): - fp.write('(define-boxed ' + self.name + '\n') - if self.module: - fp.write(' (in-module "' + self.module + '")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.copy: - fp.write(' (copy-func "' + self.copy + '")\n') - if self.release: - fp.write(' (release-func "' + self.release + '")\n') - if self.fields: - fp.write(' (fields\n') - for (ftype, fname) in self.fields: - fp.write(' \'("' + ftype + '" "' + fname + '")\n') - fp.write(' )\n') - fp.write(')\n\n') - -class PointerDef(Definition): - def __init__(self, name, *args): - self.name = name - self.module = None - self.c_name = None - self.typecode = None - self.fields = [] - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.module = arg[1] - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'fields': - for parg in arg[1:]: - self.fields.append((parg[0], parg[1])) - def merge(self, old): - # currently the .h parser doesn't try to work out what fields of - # an object structure should be public, so we just copy the list - # from the old version ... - self.fields = old.fields - def write_defs(self, fp=sys.stdout): - fp.write('(define-pointer ' + self.name + '\n') - if self.module: - fp.write(' (in-module "' + self.module + '")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.fields: - fp.write(' (fields\n') - for (ftype, fname) in self.fields: - fp.write(' \'("' + ftype + '" "' + fname + '")\n') - fp.write(' )\n') - fp.write(')\n\n') - -class MethodDefBase(Definition): - def __init__(self, name, *args): - dump = 0 - self.name = name - self.ret = None - self.caller_owns_return = None - self.unblock_threads = None - self.c_name = None - self.typecode = None - self.of_object = None - self.params = [] # of form (type, name, default, nullok) - self.varargs = 0 - self.deprecated = None - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'of-object': - self.of_object = arg[1] - elif arg[0] == 'docstring': - self.docstring = make_docstring(arg[1:]) - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'return-type': - type_name = arg[1] - optional = False - for prop in arg[2:]: - if prop[0] == 'optional': - optional = True - self.ret = ReturnType(type_name, optional) - elif arg[0] == 'caller-owns-return': - self.caller_owns_return = arg[1] in ('t', '#t') - elif arg[0] == 'unblock-threads': - self.unblock_threads = arg[1] in ('t', '#t') - elif arg[0] == 'parameters': - for parg in arg[1:]: - ptype = parg[0] - pname = parg[1] - pdflt = None - pnull = 0 - pdir = None - for farg in parg[2:]: - assert isinstance(farg, tuple) - if farg[0] == 'default': - pdflt = farg[1] - elif farg[0] == 'null-ok': - pnull = 1 - elif farg[0] == 'direction': - pdir = farg[1] - self.params.append(Parameter(ptype, pname, pdflt, pnull, pdir)) - elif arg[0] == 'varargs': - self.varargs = arg[1] in ('t', '#t') - elif arg[0] == 'deprecated': - self.deprecated = arg[1] - else: - sys.stderr.write("Warning: %s argument unsupported.\n" - % (arg[0])) - dump = 1 - if dump: - self.write_defs(sys.stderr) - - if self.caller_owns_return is None and self.ret is not None: - self.guess_return_value_ownership() - - def merge(self, old, parmerge): - self.caller_owns_return = old.caller_owns_return - self.varargs = old.varargs - # here we merge extra parameter flags accross to the new object. - if not parmerge: - self.params = copy.deepcopy(old.params) - return - for i in range(len(self.params)): - ptype, pname, pdflt, pnull = self.params[i] - for p2 in old.params: - if p2[1] == pname: - self.params[i] = (ptype, pname, p2[2], p2[3]) - break - def _write_defs(self, fp=sys.stdout): - if self.of_object != (None, None): - fp.write(' (of-object "' + self.of_object + '")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.caller_owns_return: - fp.write(' (caller-owns-return #t)\n') - if self.unblock_threads: - fp.write(' (unblock_threads #t)\n') - if self.ret: - fp.write(' (return-type "' + self.ret + '")\n') - if self.deprecated: - fp.write(' (deprecated "' + self.deprecated + '")\n') - if self.params: - fp.write(' (parameters\n') - for ptype, pname, pdflt, pnull in self.params: - fp.write(' \'("' + ptype + '" "' + pname +'"') - if pdflt: fp.write(' (default "' + pdflt + '")') - if pnull: fp.write(' (null-ok)') - fp.write(')\n') - fp.write(' )\n') - if self.varargs: - fp.write(' (varargs #t)\n') - fp.write(')\n\n') - - -class MethodDef(MethodDefBase): - def __init__(self, name, *args): - MethodDefBase.__init__(self, name, *args) - for item in ('c_name', 'of_object'): - if self.__dict__[item] == None: - self.write_defs(sys.stderr) - raise RuntimeError("definition missing required %s" % (item,)) - - def write_defs(self, fp=sys.stdout): - fp.write('(define-method ' + self.name + '\n') - self._write_defs(fp) - -class VirtualDef(MethodDefBase): - def write_defs(self, fp=sys.stdout): - fp.write('(define-virtual ' + self.name + '\n') - self._write_defs(fp) - -class FunctionDef(Definition): - def __init__(self, name, *args): - dump = 0 - self.name = name - self.in_module = None - self.is_constructor_of = None - self.ret = None - self.caller_owns_return = None - self.unblock_threads = None - self.c_name = None - self.typecode = None - self.params = [] # of form (type, name, default, nullok) - self.varargs = 0 - self.deprecated = None - for arg in get_valid_scheme_definitions(args): - if arg[0] == 'in-module': - self.in_module = arg[1] - elif arg[0] == 'docstring': - self.docstring = make_docstring(arg[1:]) - elif arg[0] == 'is-constructor-of': - self.is_constructor_of = arg[1] - elif arg[0] == 'c-name': - self.c_name = arg[1] - elif arg[0] == 'gtype-id': - self.typecode = arg[1] - elif arg[0] == 'return-type': - self.ret = arg[1] - elif arg[0] == 'caller-owns-return': - self.caller_owns_return = arg[1] in ('t', '#t') - elif arg[0] == 'unblock-threads': - self.unblock_threads = arg[1] in ('t', '#t') - elif arg[0] == 'parameters': - for parg in arg[1:]: - ptype = parg[0] - pname = parg[1] - pdflt = None - pnull = 0 - for farg in parg[2:]: - if farg[0] == 'default': - pdflt = farg[1] - elif farg[0] == 'null-ok': - pnull = 1 - self.params.append(Parameter(ptype, pname, pdflt, pnull)) - elif arg[0] == 'properties': - if self.is_constructor_of is None: - print >> sys.stderr, "Warning: (properties ...) "\ - "is only valid for constructors" - for prop in arg[1:]: - pname = prop[0] - optional = False - argname = pname - for farg in prop[1:]: - if farg[0] == 'optional': - optional = True - elif farg[0] == 'argname': - argname = farg[1] - self.params.append(Property(pname, optional, argname)) - elif arg[0] == 'varargs': - self.varargs = arg[1] in ('t', '#t') - elif arg[0] == 'deprecated': - self.deprecated = arg[1] - else: - sys.stderr.write("Warning: %s argument unsupported\n" - % (arg[0],)) - dump = 1 - if dump: - self.write_defs(sys.stderr) - - if self.caller_owns_return is None and self.ret is not None: - self.guess_return_value_ownership() - for item in ('c_name',): - if self.__dict__[item] == None: - self.write_defs(sys.stderr) - raise RuntimeError("definition missing required %s" % (item,)) - - _method_write_defs = MethodDef.__dict__['write_defs'] - - def merge(self, old, parmerge): - self.caller_owns_return = old.caller_owns_return - self.varargs = old.varargs - if not parmerge: - self.params = copy.deepcopy(old.params) - return - # here we merge extra parameter flags accross to the new object. - def merge_param(param): - for old_param in old.params: - if old_param.pname == param.pname: - if isinstance(old_param, Property): - # h2def never scans Property's, therefore if - # we have one it was manually written, so we - # keep it. - return copy.deepcopy(old_param) - else: - param.merge(old_param) - return param - raise RuntimeError("could not find %s in old_parameters %r" % ( - param.pname, [p.pname for p in old.params])) - try: - self.params = map(merge_param, self.params) - except RuntimeError: - # parameter names changed and we can't find a match; it's - # safer to keep the old parameter list untouched. - self.params = copy.deepcopy(old.params) - - if not self.is_constructor_of: - try: - self.is_constructor_of = old.is_constructor_of - except AttributeError: - pass - if isinstance(old, MethodDef): - self.name = old.name - # transmogrify from function into method ... - self.write_defs = self._method_write_defs - self.of_object = old.of_object - del self.params[0] - def write_defs(self, fp=sys.stdout): - fp.write('(define-function ' + self.name + '\n') - if self.in_module: - fp.write(' (in-module "' + self.in_module + '")\n') - if self.is_constructor_of: - fp.write(' (is-constructor-of "' + self.is_constructor_of +'")\n') - if self.c_name: - fp.write(' (c-name "' + self.c_name + '")\n') - if self.typecode: - fp.write(' (gtype-id "' + self.typecode + '")\n') - if self.caller_owns_return: - fp.write(' (caller-owns-return #t)\n') - if self.unblock_threads: - fp.write(' (unblock-threads #t)\n') - if self.ret: - fp.write(' (return-type "' + self.ret + '")\n') - if self.deprecated: - fp.write(' (deprecated "' + self.deprecated + '")\n') - if self.params: - if isinstance(self.params[0], Parameter): - fp.write(' (parameters\n') - for ptype, pname, pdflt, pnull in self.params: - fp.write(' \'("' + ptype + '" "' + pname +'"') - if pdflt: fp.write(' (default "' + pdflt + '")') - if pnull: fp.write(' (null-ok)') - fp.write(')\n') - fp.write(' )\n') - elif isinstance(self.params[0], Property): - fp.write(' (properties\n') - for prop in self.params: - fp.write(' \'("' + prop.pname +'"') - if prop.optional: fp.write(' (optional)') - fp.write(')\n') - fp.write(' )\n') - else: - assert False, "strange parameter list %r" % self.params[0] - if self.varargs: - fp.write(' (varargs #t)\n') - - fp.write(')\n\n') diff --git a/codegen/defsconvert.py b/codegen/defsconvert.py deleted file mode 100755 index c3c2324..0000000 --- a/codegen/defsconvert.py +++ /dev/null @@ -1,132 +0,0 @@ -#! /usr/bin/env python - -import sys -import string, re - -# ------------------ Create typecodes from typenames --------- - -_upperstr_pat1 = re.compile(r'([^A-Z])([A-Z])') -_upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])') -_upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])') - -def to_upper_str(name): - """Converts a typename to the equivalent upercase and underscores - name. This is used to form the type conversion macros and enum/flag - name variables""" - name = _upperstr_pat1.sub(r'\1_\2', name) - name = _upperstr_pat2.sub(r'\1_\2', name) - name = _upperstr_pat3.sub(r'\1_\2', name, count=1) - return string.upper(name) - -def typecode(typename): - """create a typecode (eg. GTK_TYPE_WIDGET) from a typename""" - return string.replace(to_upper_str(typename), '_', '_TYPE_', 1) - - -STATE_START = 0 -STATE_OBJECT = 1 -STATE_INTERFACE = 2 -STATE_BOXED = 3 -STATE_ENUM = 4 -STATE_FLAGS = 5 -STATE_METHOD = 6 -STATE_FUNCTION = 7 - -def convert(infp=sys.stdin, outfp=sys.stdout): - state = STATE_START - seen_params = 0 - - line = infp.readline() - while line: - if line[:8] == '(object ': - state = STATE_OBJECT - seen_params = 0 - outfp.write('(define-object ' + line[8:]) - elif line[:11] == '(interface ': - state = STATE_INTERFACE - seen_params = 0 - outfp.write('(define-interface ' + line[11:]) - elif line[:7] == '(boxed ': - state = STATE_BOXED - seen_params = 0 - outfp.write('(define-boxed ' + line[7:]) - elif line[:6] == '(enum ': - state = STATE_ENUM - seen_params = 0 - outfp.write('(define-enum ' + line[6:]) - elif line[:7] == '(flags ': - state = STATE_FLAGS - seen_params = 0 - outfp.write('(define-flags ' + line[7:]) - elif line[:8] == '(method ': - state = STATE_METHOD - seen_params = 0 - outfp.write('(define-method ' + line[8:]) - elif line[:10] == '(function ': - state = STATE_FUNCTION - seen_params = 0 - outfp.write('(define-function ' + line[10:]) - elif line[:13] == ' (in-module ': - outfp.write(re.sub(r'^(\s+\(in-module\s+)(\w+)(.*)$', - r'\1"\2"\3', line)) - elif line[:10] == ' (parent ': - outfp.write(re.sub(r'^(\s+\(parent\s+)(\w+)(\s+\((\w+)\))?(.*)$', - r'\1"\4\2"\5', line)) - elif line[:14] == ' (implements ': - outfp.write(re.sub(r'^(\s+\(implements\s+)([^\s]+)(\s*\))$', - r'\1"\2"\3', line)) - elif line[:13] == ' (of-object ': - outfp.write(re.sub(r'^(\s+\(of-object\s+)(\w+)(\s+\((\w+)\))?(.*)$', - r'\1"\4\2"\5', line)) - elif line[:10] == ' (c-name ': - outfp.write(re.sub(r'^(\s+\(c-name\s+)([^\s]+)(\s*\))$', - r'\1"\2"\3', line)) - if state in (STATE_OBJECT, STATE_INTERFACE, STATE_BOXED, - STATE_ENUM, STATE_FLAGS): - c_name = re.match(r'^\s+\(c-name\s+([^\s]+)\s*\)$', - line).group(1) - outfp.write(' (gtype-id "%s")\n' % typecode(c_name)) - elif line[:15] == ' (return-type ': - outfp.write(re.sub(r'^(\s+\(return-type\s+)([^\s]+)(\s*\))$', - r'\1"\2"\3', line)) - elif line[:13] == ' (copy-func ': - outfp.write(re.sub(r'^(\s+\(copy-func\s+)(\w+)(.*)$', - r'\1"\2"\3', line)) - elif line[:16] == ' (release-func ': - outfp.write(re.sub(r'^(\s+\(release-func\s+)(\w+)(.*)$', - r'\1"\2"\3', line)) - elif line[:9] == ' (field ': - if not seen_params: - outfp.write(' (fields\n') - seen_params = 1 - outfp.write(re.sub(r'^\s+\(field\s+\(type-and-name\s+([^\s]+)\s+([^\s]+)\s*\)\s*\)$', - ' \'("\\1" "\\2")', line)) - elif line[:9] == ' (value ': - if not seen_params: - outfp.write(' (values\n') - seen_params = 1 - outfp.write(re.sub(r'^\s+\(value\s+\(name\s+([^\s]+)\)\s+\(c-name\s+([^\s]+)\s*\)\s*\)$', - ' \'("\\1" "\\2")', line)) - elif line[:13] == ' (parameter ': - if not seen_params: - outfp.write(' (parameters\n') - seen_params = 1 - outfp.write(re.sub(r'^\s+\(parameter\s+\(type-and-name\s+([^\s]+)\s+([^\s]+)\s*\)(\s*.*)\)$', - ' \'("\\1" "\\2"\\3)', line)) - elif line[:11] == ' (varargs ': - if seen_params: - outfp.write(' )\n') - seen_params = 0 - outfp.write(' (varargs #t)\n') - elif line[0] == ')': - if seen_params: - outfp.write(' )\n') - seen_params = 0 - state = STATE_START - outfp.write(line) - else: - outfp.write(line) - line = infp.readline() - -if __name__ == '__main__': - convert() diff --git a/codegen/defsgen.py b/codegen/defsgen.py deleted file mode 100755 index 6c2e63d..0000000 --- a/codegen/defsgen.py +++ /dev/null @@ -1,737 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- -# -# Copyright (C) 2006-2009 John Finlay. -# -# Scan the given public .h files of a GTK module (or module using -# GTK object conventions) and generates a set of scheme defs. -# -# defsgen uses the ctypes module to extract information from the installed -# module library (or libraries) to generate the object, interface, function, -# method, virtual, enum and flags defs. defsgen uses the gobject library -# g_type_* functions. defsgen will try to open the "libgobject-2.0.so" library -# if one is not specified on the command line. -# -# Basically the operation of defsgen is: -# -# - open and initialize the gobject and module libraries -# - read each .h file into a buffer which is scrubbed of extraneous data -# - find all *_get_type() functions prototypes -# - look in the module libraries for the get_type symbols -# - if found run the get_type() function to retrieve the GType -# - find the parent type name and save the object info -# - find each function prototypes in the file and check if it has a symbol in -# the module libraries - save the info if found -# - extract the virtual prototypes from the Class or Iface structs and save -# - write out the various defs. -# -# The command line options are: -# -# -l --modulelib Adds the given module library name to the list to be used -# for finding symbols. Mor ethan one modulefile may be -# specified. (required) -# -L --libgobject Specifies the name of the gobject library (optional but -# must be specified if "libgobject-2.0.so" is not availble) -# -s --separate Create separate files for objects and function/method defs -# using the given name as the base name (optional). If this -# is not specified the combined object and function defs -# will be output to sys.stdout. -# -f --defsfile Extract defs from the given file to filter the output defs -# that is don't output defs that are defined in the -# defsfile. More than one deffile may be specified. -# -D --defines Include portions of the defsfile defs that are conditional -# on the given define, for example GDK_TARGET_X11. Only -# useful with the --defsfile option -# -m --modulename The prefix to be stripped from the front of function names -# for the given module -# -p --useprefix Use the modulename prefix as a hint to split names into -# module and name for object and enum defs. Also used for -# generating type codes. -# --onlyenums Only produce defs for enums and flags -# --onlyobjdefs Only produce defs for objects -# --onlyvirtuals Only produce defs for virtuals -# --genpropgetsets Experimental option to generate prop-getset annotations. -# Not supported by codegen.py and friends. -# -# Examples: -# -# python defsgen.py -m pango -l libpango-1.0.so \ -# /usr/local/include/pango-1.0/pango/*.h >/tmp/pango.defs -# -# - Outputs all defs for the pango module.using the library module -# libpango-1.0.so. -# -# python defsgen.py -m gdk -DGDK_TARGET_X11 -l libgdk-x11-2.0.so \ -# -l libgdk_pixbuf-2.0.so -s /tmp/gdk-2.10 \ -# -f /usr/tmp/pygtk/gtk/gdk-base.defs \ -# /usr/local/include/gtk-2.0/gdk/*.h \ -# /usr/local/include/gtk-2.0/gdk-pixbuf/*.h -# -# - Outputs the gdk module defs that are not contained in the defs file -# /usr/tmp/pygtk/gtk/gdk-base.defs. Two output files are created: -# /tmp/gdk-2.10-types.defs and /tmp/gdk-2.10.defs. -# -# Based on the original h2def.py program by -# Toby D. Reeves and -# modified by James Henstridge to output stuff in -# Havoc's new defs format. Info on this format can be seen at: -# http://www.gnome.org/mailing-lists/archives/gtk-devel-list/2000-January/0085.shtml -# Updated to be PEP-8 compatible and refactored to use OOP -# Extensively modified by John Finlay to use ctypes module to extract GType -# info from the given library and to create virtual defines. -# - -import getopt -import os -import re, string -import sys -import ctypes -import defsparser - -#------------------ utility defs ----------------- - -_upperstr_pat1 = re.compile(r'([^A-Z])([A-Z])') -_upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])') -_upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])') - -def to_upper_str(name): - """Converts a typename to the equivalent uppercase and underscores - name. This is used to form the type conversion macros and enum/flag - name variables""" - name = _upperstr_pat1.sub(r'\1_\2', name) - name = _upperstr_pat2.sub(r'\1_\2', name) - name = _upperstr_pat3.sub(r'\1_\2', name, count=1) - return name.upper() - -def typecode(typename, prefix, use_prefix): - """create a typecode (eg. GTK_TYPE_WIDGET) from a typename""" - tcode = to_upper_str(typename) - if (use_prefix and prefix and tcode.lower() != prefix - and tcode.lower().startswith(prefix)): - l = len(prefix) - tcode = tcode[:l] + '_TYPE' + tcode[l:] - else: - tcode = tcode.replace('_', '_TYPE_', 1) - return tcode - -_class_iface_pat = re.compile(r'\w+(Class|Iface)') - -def class_iface_sub(mobj): - '''Returns matched string if it matches a Class or Iface struct - otherwise returns the empty string''' - if not _class_iface_pat.match(mobj.group(1)): - return '' - return mobj.group(0) - -clean_patterns = [ - # strip comments - (re.compile(r'/\*.*?\*/', re.DOTALL), ''), - # compact continued lines - (re.compile(r"\\\n", re.MULTILINE), ''), - # remove preprocess directives - (re.compile(r"""^[#].*?$""", re.MULTILINE), ''), - # strip DECLS macros and Windows DLL API macros - (re.compile(r"""G_BEGIN_DECLS|BEGIN_LIBGTOP_DECLS|G_END_DECLS|[A-Z]+_API """, - re.MULTILINE), ''), - # remove extern "C" - (re.compile(r'^\s*(extern)\s+"C"\s+{', re.MULTILINE), ''), - # remove singleline typedefs of stucts - (re.compile(r'^typedef\s+struct\s*[^{;\n]*;\s*$', re.MULTILINE), ''), - # remove all struct definitons but those for object classes and interfaces - (re.compile(r'^struct\s+(\w+)\s+{[^}]+}\s*;\s*$', re.MULTILINE), - class_iface_sub), - # compress multiple whitespace - (re.compile(r'\s+', re.MULTILINE), ' '), - # clean up line ends - (re.compile(r';\s*', re.MULTILINE), '\n'), - (re.compile(r'^\s*', re.MULTILINE), ''), - # associate *, &, and [] with type instead of variable - (re.compile(r' \s* ([*|&]+) \s* ([(\w]+)', re.VERBOSE), r'\1 \2'), - (re.compile(r'\s+ (\w+) \[ \s* \]', re.VERBOSE), r'[] \1'), - # make return types that are const work. - (re.compile(r'\s*\*\s*G_CONST_RETURN\s*\*\s*'), '** '), - (re.compile(r'G_CONST_RETURN |const '), 'const-'), - # remove typedefs of callback types - (re.compile(r'^typedef\s+\w+\s*\*?\s*\(\s*\*\s*\w+\)\s*\([^(]*\)\n', - re.MULTILINE), ''), - #strip GSEAL macros from the middle of function declarations: - (re.compile(r"""GSEAL""", re.VERBOSE), '') - ] - -def clean_buffer(buf): - """Cleans out extraneous data leaving function prototypes, Class and Iface - structs.""" - for pat, subst in clean_patterns: - buf = pat.sub(subst, buf) - return buf - -# ------------------ utility classes ------------------------- - -class ObjDef(object): - def __init__(self, name, type_id, parent_name, parent_type, base_name): - self.name = name - self.type = type_id - self.parent_name = parent_name - self.parent_type = parent_type - self.base_name = base_name - self.props = [] - return - def __cmp__(self, other): - try: - res = cmp(self.name, other.name) - except AttributeError: - res = cmp(id(self), id(other)) - return res - def set_properties(self, gobj): - if self.base_name == 'GObject': - self.props = self._get_gobject_properties(gobj) - elif self.base_name == 'GInterface': - self.props = self._get_ginterface_properties(gobj) - - def _get_gobject_properties(self, gobj): - klass = gobj.g_type_class_ref(self.type) - num = ctypes.c_uint() - plist = gobj.g_object_class_list_properties(klass, ctypes.byref(num)) - props = [plist[i][0].name for i in range(num.value) - if self.name == gobj.g_type_name(plist[i][0].owner_type)] - return props - def _get_ginterface_properties(self, gobj): - iface = gobj.g_type_default_interface_ref(self.type) - num = ctypes.c_uint() - plist = gobj.g_object_interface_list_properties(iface, - ctypes.byref(num)) - props = [plist[i][0].name for i in range(num.value)] - return props - -# ------------------ Find object definitions ----------------- - -split_prefix_pat = re.compile('([A-Z]+[a-z]*)([A-Za-z0-9]+)') - -get_type_pat = re.compile(r'''^\s*(GType|GtkType)\s+ -([a-z]\w+_get_type)\s*(\(void\)|\(\)).*$''', re.VERBOSE | re.MULTILINE) - -defkeys = 'GBoxed GInterface GObject gpointer GEnum GFlags' - -def find_defs(buf, gobj, modlib, defs): - """Find possible gobject, gboxed, interface, gpointer, enum and flags - definitions in header files.and find parent type.""" - # find all *_get_type() functions that may represent a GObject - for m in get_type_pat.findall(buf): - func_name = m[1] - for lib in modlib: - if hasattr(lib, func_name): - objtype = apply(getattr(lib, func_name)) - obj_name = gobj.g_type_name(objtype) - parent = gobj.g_type_parent(objtype) - parent_name = gobj.g_type_name(parent) - base_name = gobj.g_type_name(gobj.g_type_fundamental(parent)) - #if gobj.g_type_is_a(parent, gobj.GObject): - # base_name = 'GObject' - if base_name in defkeys: - obj = ObjDef(obj_name, objtype, parent_name, parent, - base_name) - obj.set_properties(gobj) - defs[obj.base_name].append(obj) - break - return - -# ------------------ Find function definitions ----------------- - -arg_split_pat = re.compile("\s*,\s*") - -proto_pat=re.compile(r"""^ -\s*((?:-|\w|\&|\*)+) # return type -\s+ # skip whitespace -([a-z]\w+)\s*[(] # match the function name until the opening ( -\s*(.*?)\s*[)].* # group the function arguments -$""", re.IGNORECASE|re.VERBOSE|re.MULTILINE) - -def find_func_defs(buf, modlib, deffile, defs, verbose): - '''Find function prototypes in buf that have symbols in modlib - and save in defs.''' - funcs = defs['funcs'][deffile] = [] - for m in proto_pat.findall(buf): - ret, func, args = m - if not True in [hasattr(lib, func) for lib in modlib]: - if verbose: - sys.stderr.write('no symbol for function: ' + func - + ' from file' + deffile + '\n') - else: - args = arg_split_pat.split(args) - args = [a.replace(' ','-', a.count(' ')-1) for a in args] - funcs.append((func, ret, args)) - return - -virtual_pat = re.compile(r'''^ -\s*((?:-|\w|\&|\*)+) # return type -\s* # skip whitespace -\(\s*\*\s* # opening ( -([a-z]\w+)\) # match the function name until the closing ) -\s*\(\s*([^)]*)\).* # group the function arguments -$''', re.VERBOSE|re.MULTILINE) - -class_iface_struct_pat = re.compile( - r'^struct\s+_(\w+)(?:Class|Iface)\s+{([^}]+)}\s*$', re.MULTILINE) - -def find_virt_defs(buf, deffile, defs): - '''Find virtual function prototypes in buf and save in defs.''' - virts = defs['virts'][deffile] = [] - # get the Class or Iface structs - for m in class_iface_struct_pat.findall(buf): - objname, virtuals = m - for v in virtual_pat.findall(virtuals): - ret, func, args = v - if 'reserved' in func or args == 'void': - continue - args = arg_split_pat.split(args) - args = [a.replace(' ','-', a.count(' ')-1) for a in args] - virts.append((func, ret, args, objname)) - return - -enum_pat = re.compile(r'^\s*typedef enum\s+{\s*([^}]*)}\s*([^\s]*)$', - re.MULTILINE) -values_splitter = re.compile(r'\s*,\s', re.MULTILINE) - -def find_enums(buf, defs): - for vals, name in enum_pat.findall(buf): - if name != 'GdkCursorType': - isflags = '<<' in vals - entries = [val.split()[0] for val in values_splitter.split(vals) - if val.strip()] - if entries: - defs['untypedenums'][name] = (isflags, entries) - return - -# ------------------ write definitions ----------------- - -type_pat = re.compile(r'(?:const-)?([A-Za-z0-9]+)\*?\s+') -pointer_pat = re.compile('(.*)\*$') -func_new_pat = re.compile('(\w+)_new$') -getset_pat = re.compile(r'^(?:get|set)_(.*)$') - -def split_prefix(cname, prefix, use_prefix): - # use the module prefix to split the cname - pre = prefix.replace('_', '') - if use_prefix and cname.lower().startswith(pre): - l = len(pre) - module = cname[:l] - name = cname[l:] - else: - m = split_prefix_pat.match(cname) - if m: - module = m.group(1) - name = m.group(2) - return module, name - -class DefsWriter: - def __init__(self, defs, fp=None, prefix=None, verbose=False, - defsfiles=None, defines={}, genpropgetsets=False, - useprefix=False): - self.defs = defs - self.use_prefix = useprefix - self.objnames = reduce(list.__add__, - [[o.name for o in defs[base]] - for base in defkeys.split()[:3]]) - self.othernames = reduce(list.__add__, - [[o.name for o in defs[base]] - for base in defkeys.split()[3:]]) - self.objifacedefs = dict(reduce(list.__add__, - [[(o.name, o) for o in defs[base]] - for base in defkeys.split()[1:3]])) - self.fp = (fp, sys.stdout)[not fp] - self.prefix = prefix - self.verbose = verbose - self.genpropgetsets = genpropgetsets - self._c_names={} - for defsfile in defsfiles: - filter = defsparser.DefsParser(defsfile, defines) - filter.startParsing() - self._c_names.update(filter.c_name) - for vdef in filter.virtuals: - self._c_names[vdef.of_object + '.' + vdef.name] = None - return - - def write_func_defs(self, deffiles, onlyvirts=False): - filter = self._c_names - for deffile in deffiles: - self.fp.write('\n;; From %s\n\n' % os.path.basename(deffile)) - if not onlyvirts: - for func, ret, args in self.defs['funcs'][deffile]: - if not func in filter: - self._write_func(func, ret, args) - for virt, ret, args, objname in self.defs['virts'][deffile]: - if not objname + '.' + virt in filter: - self._write_virt(objname, virt, ret, args) - self.fp.write('\n') - return - - def write_enum_defs(self, fp=None): - fp = (fp, self.fp)[not fp] - klassptrs = {'GEnum':ctypes.POINTER(EnumClass), - 'GFlags':ctypes.POINTER(FlagsClass)} - filter = self._c_names - objs = self.defs['GEnum'] + self.defs ['GFlags'] - #objs.sort() - fp.write(';; Enumerations and Flags ...\n\n') - for obj in objs: - cname = name = obj.name - tcode = typecode(cname, self.prefix, self.use_prefix) - if cname in filter: - continue - if cname in self.defs['untypedenums']: - if tcode not in self.defs['typedefines']: - # no type define so skip and print as untyped enum - continue - self.defs['untypedenums'].pop(cname, None) - parent_name = obj.parent_name - klassptr = klassptrs[parent_name] - typename = parent_name.lower()[1:] - module = None - module, name = split_prefix(cname, self.prefix, self.use_prefix) - fp.write('(define-' + typename + ' ' + name + '\n') - if module: - fp.write(' (in-module "' + module + '")\n') - fp.write(' (c-name "' + cname + '")\n') - fp.write(' (gtype-id "' + tcode + '")\n') - fp.write(' (values\n') - classref = self.gobj.g_type_class_ref(obj.type) - itemclass = ctypes.cast(classref, klassptr).contents - for i in range(itemclass.n_values): - val = itemclass.values[i] - fp.write(' \'("%s" "%s")\n' % (val.value_nick, - val.value_name)) - fp.write(' )\n') - fp.write(')\n\n') - if self.defs['untypedenums']: - self.write_untyped_enum_defs(fp) - return - - def write_untyped_enum_defs(self, fp): - fp.write(';; Untyped enumerations and flags ...\n\n') - filter = self._c_names - for cname, (isflags, entries) in self.defs['untypedenums'].items(): - if filter and cname in filter: continue - module, name = split_prefix(cname, self.prefix, self.use_prefix) - if isflags: - fp.write('(define-flags ' + name + '\n') - else: - fp.write('(define-enum ' + name + '\n') - if module: - fp.write(' (in-module "' + module + '")\n') - fp.write(' (c-name "' + cname + '")\n') - preindex = entries[0].rfind('_') - for ent in entries[1:]: - while (preindex > 0 - and ent[:preindex] != entries[0][:preindex]): - preindex = ent[:preindex].rfind('_') - fp.write(' (values\n') - for ent in entries: - fp.write(' \'("%s" "%s")\n' % - (ent[preindex+1:].lower().replace('_', '-'), ent)) - fp.write(' )\n') - fp.write(')\n\n') - - - def _write_obj_helper(self, obj, fp): - base_name = obj.base_name.lower()[1:] - cmodule = None - cname = name = obj.name - type_id = obj.type - parent_name = obj.parent_name - cmodule, name = split_prefix(cname, self.prefix, self.use_prefix) - fp.write('(define-' + base_name + ' ' + name + '\n') - if cmodule: - fp.write(' (in-module "' + cmodule + '")\n') - if base_name == 'object': - fp.write(' (parent "' + parent_name + '")\n') - fp.write(' (c-name "' + cname + '")\n') - fp.write(' (gtype-id "' - + typecode(cname, self.prefix, self.use_prefix) + '")\n') - n = ctypes.c_uint() - ifaces = self.gobj.g_type_interfaces(type_id, ctypes.byref(n)) - for i in range(n.value): - iface_name = self.gobj.g_type_name(ifaces[i]) - if iface_name in self.interfaces: - fp.write(' (implements "%s")\n' % iface_name) - if base_name == 'interface': - prereq = self.gobj.g_type_interface_prerequisites(type_id, - ctypes.byref(n)) - for i in range(n.value): - fp.write(' (prerequisite "%s")\n' - % self.gobj.g_type_name(prereq[i])) - # should do something about accessible fields - fp.write(')\n\n') - return - - def write_obj_defs(self, fp=None): - fp = (fp, self.fp)[not fp] - fp.write(';; -*- scheme -*-\n') - filter = self._c_names - for base in defkeys.split()[:4]: - base_name = base.lower()[1:] - fp.write('; %s definitions ...\n\n' % base_name) - for obj in self.defs[base]: - if not obj.name in filter: - self._write_obj_helper(obj, fp) - return - - def _write_func(self, name, ret, args): - if len(args) >= 1: - # methods must have at least one argument - munged_name = name.replace('_', '') - m = type_pat.match(args[0]) - if m: - obj = m.group(1) - if munged_name.startswith(obj.lower()): - if obj not in self.othernames: - self._write_method(obj, name, ret, args) - return - fname = name - if self.prefix: - fname = re.sub('^'+self.prefix+'_', '', fname) - - # it is either a constructor or normal function - self.fp.write('(define-function ' + fname + '\n') - self.fp.write(' (c-name "' + name + '")\n') - - # Asume that a constructor function name - # ends with '_new' and it returns an object pointer. - m = func_new_pat.match(name) - r = pointer_pat.match(ret) - if m and r: - cname = '' - # get the type name by using the _get_type function - func = m.group(1) + '_get_type' - lib = [l for l in self.modlib if hasattr(l, func)] - if lib: - cname = self.gobj.g_type_name(apply(getattr(lib[0], func))) - if cname and self.gobj.g_type_from_name(r.group(1)): - self.fp.write(' (is-constructor-of "' + cname + '")\n') - self._write_return(ret) - self._write_arguments(args) - return - - def _write_method(self, obj, name, ret, args): - regex = ''.join([c+'_?' for c in obj.lower()]) - mname, count = re.subn(regex, '', name, 1) - if not count and self.prefix: - mname = re.sub('^'+self.prefix+'_', '', mname) - self.fp.write('(define-method ' + mname + '\n') - self.fp.write(' (of-object "' + obj + '")\n') - self.fp.write(' (c-name "' + name + '")\n') - m = getset_pat.match(mname) - if self.genpropgetsets and m and len(args[1:]) <= 1: - prop = m.group(1) - if obj in self.objifacedefs: - oidef = self.objifacedefs[obj] - if prop.replace('_', '-') in oidef.props: - self.fp.write(' (prop-getset "' + prop + '")\n') - self._write_return(ret) - self._write_arguments(args[1:]) - return - - def _write_virt(self, obj, name, ret, args): - self.fp.write('(define-virtual ' + name + '\n') - self.fp.write(' (of-object "' + obj + '")\n') - self._write_return(ret) - self._write_arguments(args[1:]) - return - - def _write_return(self, ret): - if ret == 'void': - ret = 'none' - self.fp.write(' (return-type "' + ret + '")\n') - return - - def _write_arguments(self, args): - if args and not 'void' in args: - varargs = '' - self.fp.write(' (parameters\n') - for arg in args: - if arg == '...': - varargs = ' (varargs #t)\n' - else: - tupleArg = tuple(arg.split()) - if len(tupleArg) == 2: - self.fp.write(' \'("%s" "%s")\n' % tupleArg) - self.fp.write(' )\n' + varargs) - self.fp.write(')\n\n') - -# ---------- ctypes support classes for gobject library functions ---------- - -GType = ctypes.c_uint - -class GTypeClass(ctypes.Structure): - _fields_ = [('g_type', GType)] - -class GTypeInstance(ctypes.Structure): - _fields_ = [('g_class', ctypes.POINTER(GTypeClass))] - -class EnumValue(ctypes.Structure): - _fields_ = [('value', ctypes.c_int), - ('value_name', ctypes.c_char_p), - ('value_nick', ctypes.c_char_p)] - -class FlagsValue(ctypes.Structure): - _fields_ = [('value', ctypes.c_uint), - ('value_name', ctypes.c_char_p), - ('value_nick', ctypes.c_char_p)] - -class EnumClass(ctypes.Structure): - _fields_ = [('g_type_class', GTypeClass), - ('minimum', ctypes.c_int), - ('maximum', ctypes.c_int), - ('n_values', ctypes.c_uint), - ('values', ctypes.POINTER(EnumValue))] - -class FlagsClass(ctypes.Structure): - _fields_ = [('g_type_class', GTypeClass), - ('mask', ctypes.c_uint), - ('n_values', ctypes.c_uint), - ('values', ctypes.POINTER(FlagsValue))] - -class GTypeInterface(ctypes.Structure): - _fields_ = [('g_type', GType), - ('g_instance_type', GType)] - -class GParamSpec(ctypes.Structure): - _fields_ = [('g_type_instance', GTypeInstance), - ('name', ctypes.c_char_p), - ('flags', ctypes.c_uint), - ('value_type', GType), - ('owner_type', GType)] - -# ------------------ Main function ----------------- - -def main(args): - verbose = False - all = True - onlyenums = False - onlyobjdefs = False - onlyvirtuals = False - separate = False - modulename = None - defsfiles = [] - libgobject = None - modulelibs = [] - defines = {} - genpropgetsets = False - use_prefix = False - opts, args = getopt.getopt(args[1:], 'vs:m:f:D:L:l:p', - ['onlyenums', 'onlyobjdefs', 'onlyvirtuals', - 'modulename=', 'separate=', - 'defsfile=', 'defines=', 'genpropgetsets', - 'libgobject-', 'modulelib=', 'useprefix']) - for o, v in opts: - if o == '-v': - verbose = True - if o == '--onlyenums': - onlyenums = True - all = False - if o == '--onlyvirtuals': - onlyvirtuals = True - all = False - if o == '--onlyobjdefs': - onlyobjdefs = True - all = False - if o in ('-p', '--useprefix'): - use_prefix = True - if o == '--genpropgetsets': - genpropgetsets = True - if o in ('-s', '--separate'): - separate = v - if o in ('-m', '--modulename'): - modulename = v - if o in ('-L', '--libgobject'): - libgobject = v - if o in ('-l', '--modulelib'): - modulelibs.append(v) - if o in ('-f', '--defsfile'): - defsfiles.append(v) - if o in ('-D', '--defines'): - nameval = v.split('=') - try: - defines[nameval[0]] = nameval[1] - except IndexError: - defines[nameval[0]] = None - - if not args[0:1]: - print 'Must specify at least one input file name' - return -1 - if not modulelibs: - print 'Must specify one or more modulelib names' - return -1 - - # load the gobject and module libraries and init the gtype system - if not libgobject: - if verbose: - sys.stderr.write('Using "libgobject-2.0.so" as the libobject' \ - 'library name by default\n') - gobj = ctypes.cdll.LoadLibrary('libgobject-2.0.so') - else: - gobj = ctypes.cdll.LoadLibrary(libgobject) - - modlib = [ctypes.cdll.LoadLibrary(lib) for lib in modulelibs] - - gobj.g_type_init() - gobj.g_type_name.restype = ctypes.c_char_p - gobj.g_type_from_name.argtypes = [ctypes.c_char_p] - gobj.g_type_interfaces.restype = ctypes.POINTER(ctypes.c_int) - gobj.g_type_interface_prerequisites.restype = ctypes.POINTER(ctypes.c_int) - gobj.g_object_class_list_properties.restype = ctypes.POINTER(ctypes.POINTER(GParamSpec)) - gobj.g_object_interface_list_properties.restype = ctypes.POINTER(ctypes.POINTER(GParamSpec)) - gobj.GObject = gobj.g_type_from_name('GObject') - gobj.g_object_new(gobj.GObject, None) - - defs = {} - for key in defkeys.split(): - defs[key] = [] - defs['funcs'] = {} - defs['virts'] = {} - defs['untypedenums'] = {} - defs['typedefines'] = [] - - # read in all the object and function definitions - args.sort() - type_define_pat = re.compile( - r'^#define\s+([A-Z]\S+_TYPE_\S+)\s+.*[a-z]\w+_get_type.*$', - re.MULTILINE) - for filename in args: - buf = open(filename).read() - defs['typedefines'] += type_define_pat.findall(buf) - buf = clean_buffer(buf) - find_enums(buf, defs) - find_defs(buf, gobj, modlib, defs) - find_func_defs(buf, modlib, filename, defs, verbose) - find_virt_defs(buf, filename, defs) - - for key in defkeys.split(): - defs[key].sort() - - methods = types = None - if separate: - methods = file(separate + '.defs', 'w') - types = file(separate + '-types.defs', 'w') - - dw = DefsWriter(defs, methods, prefix=modulename, verbose=verbose, - defsfiles=defsfiles, defines=defines, - genpropgetsets=genpropgetsets, useprefix=use_prefix) - dw.interfaces = [i.name for i in defs['GInterface']] - dw.gobj = gobj - dw.modlib = modlib - - if onlyobjdefs or all: - dw.write_obj_defs(types) - if separate: - print "Wrote object defs to %s-types.defs" % separate - if onlyenums or all: - dw.write_enum_defs(types) - if separate: - print "Wrote enum and flags defs to %s-types.defs" % separate - if onlyvirtuals or all: - dw.write_func_defs(args, onlyvirtuals) - if separate: - print "Wrote function and virtual defs to %s.defs" % separate - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/codegen/defsparser.py b/codegen/defsparser.py deleted file mode 100644 index 37ba0a2..0000000 --- a/codegen/defsparser.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- -import os, sys -import scmexpr -from definitions import BoxedDef, EnumDef, FlagsDef, FunctionDef, \ - InterfaceDef, MethodDef, ObjectDef, PointerDef, VirtualDef - -include_path = ['.'] - -class IncludeParser(scmexpr.Parser): - """A simple parser that follows include statements automatically""" - def include(self, input_filename): - global include_path - if os.path.isabs(input_filename): - filename = input_filename - # set self.filename to the include name, to handle recursive includes - oldfile = self.filename - self.filename = filename - self.startParsing() - self.filename = oldfile - else: - inc_path = [os.path.dirname(self.filename)] + include_path - for filename in [os.path.join(path_entry, input_filename) - for path_entry in inc_path]: - if not os.path.exists(filename): - continue - # set self.filename to the include name, to handle recursive includes - oldfile = self.filename - self.filename = filename - self.startParsing() - self.filename = oldfile - break - else: - raise IOError("%s not found in include path %s" % (input_filename, inc_path)) - -class DefsParser(IncludeParser): - def __init__(self, arg, defines={}): - IncludeParser.__init__(self, arg) - self.objects = [] - self.interfaces = [] - self.enums = [] # enums and flags - self.boxes = [] # boxed types - self.pointers = [] # pointer types - self.functions = [] # functions and methods - self.virtuals = [] # virtual methods - self.c_name = {} # hash of c names of functions - self.methods = {} # hash of methods of particular objects - self.defines = defines # -Dfoo=bar options, as dictionary - - def define_object(self, *args): - odef = apply(ObjectDef, args) - self.objects.append(odef) - self.c_name[odef.c_name] = odef - def define_interface(self, *args): - idef = apply(InterfaceDef, args) - self.interfaces.append(idef) - self.c_name[idef.c_name] = idef - def define_enum(self, *args): - edef = apply(EnumDef, args) - self.enums.append(edef) - self.c_name[edef.c_name] = edef - def define_flags(self, *args): - fdef = apply(FlagsDef, args) - self.enums.append(fdef) - self.c_name[fdef.c_name] = fdef - def define_boxed(self, *args): - bdef = apply(BoxedDef, args) - self.boxes.append(bdef) - self.c_name[bdef.c_name] = bdef - def define_pointer(self, *args): - pdef = apply(PointerDef, args) - self.pointers.append(pdef) - self.c_name[pdef.c_name] = pdef - def define_function(self, *args): - fdef = apply(FunctionDef, args) - self.functions.append(fdef) - self.c_name[fdef.c_name] = fdef - def define_method(self, *args): - mdef = apply(MethodDef, args) - self.functions.append(mdef) - self.c_name[mdef.c_name] = mdef - def define_virtual(self, *args): - vdef = apply(VirtualDef, args) - self.virtuals.append(vdef) - def merge(self, old, parmerge): - for obj in self.objects: - if old.c_name.has_key(obj.c_name): - obj.merge(old.c_name[obj.c_name]) - for f in self.functions: - if old.c_name.has_key(f.c_name): - f.merge(old.c_name[f.c_name], parmerge) - - def printMissing(self, old): - for obj in self.objects: - if not old.c_name.has_key(obj.c_name): - obj.write_defs() - for f in self.functions: - if not old.c_name.has_key(f.c_name): - f.write_defs() - - def write_defs(self, fp=sys.stdout): - for obj in self.objects: - obj.write_defs(fp) - for enum in self.enums: - enum.write_defs(fp) - for boxed in self.boxes: - boxed.write_defs(fp) - for pointer in self.pointers: - pointer.write_defs(fp) - for func in self.functions: - func.write_defs(fp) - - def find_object(self, c_name): - for obj in self.objects: - if obj.c_name == c_name: - return obj - else: - raise ValueError('object %r not found' % c_name) - - def find_constructor(self, obj, overrides): - for func in self.functions: - if isinstance(func, FunctionDef) and \ - func.is_constructor_of == obj.c_name and \ - not overrides.is_ignored(func.c_name): - return func - - def find_methods(self, obj): - objname = obj.c_name - return filter(lambda func, on=objname: isinstance(func, MethodDef) and - func.of_object == on, self.functions) - - def find_virtuals(self, obj): - objname = obj.c_name - retval = filter(lambda func, on=objname: isinstance(func, VirtualDef) and - func.of_object == on, self.virtuals) - return retval - - def find_functions(self): - return filter(lambda func: isinstance(func, FunctionDef) and - not func.is_constructor_of, self.functions) - - def ifdef(self, *args): - if args[0] in self.defines: - for arg in args[1:]: - #print >> sys.stderr, "-----> Handling conditional definition (%s): %s" % (args[0], arg) - self.handle(arg) - else: - pass - #print >> sys.stderr, "-----> Conditional %s is not true" % (args[0],) - - def ifndef(self, *args): - if args[0] not in self.defines: - for arg in args[1:]: - self.handle(arg) diff --git a/codegen/docextract.py b/codegen/docextract.py deleted file mode 100644 index eff8c5e..0000000 --- a/codegen/docextract.py +++ /dev/null @@ -1,448 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- -'''Simple module for extracting GNOME style doc comments from C -sources, so I can use them for other purposes.''' - -import sys, os, string, re - -__all__ = ['extract'] - -class GtkDoc: - def __init__(self): - self.name = None - self.block_type = '' # The block type ('function', 'signal', 'property') - self.params = [] - self.annotations = [] - self.description = '' - self.ret = ('', []) # (return, annotations) - def set_name(self, name): - self.name = name - def set_type(self, block_type): - self.block_type = block_type - def get_type(self): - return self.block_type - def add_param(self, name, description, annotations=[]): - if name == '...': - name = 'Varargs' - self.params.append((name, description, annotations)) - def append_to_last_param(self, extra): - self.params[-1] = (self.params[-1][0], self.params[-1][1] + extra, - self.params[-1][2]) - def append_to_named_param(self, name, extra): - for i in range(len(self.params)): - if self.params[i][0] == name: - self.params[i] = (name, self.params[i][1] + extra, - self.params[i][2]) - return - # fall through to adding extra parameter ... - self.add_param(name, extra) - def add_annotation(self, annotation): - self.annotations.append(annotation) - def get_annotations(self): - return self.annotations - def append_to_description(self, extra): - self.description = self.description + extra - def get_description(self): - return self.description - def add_return(self, first_line, annotations=[]): - self.ret = (first_line, annotations) - def append_to_return(self, extra): - self.ret = (self.ret[0] + extra, self.ret[1]) - -comment_start_pattern = re.compile(r'^\s*/\*\*\s') -comment_end_pattern = re.compile(r'^\s*\*+/') -comment_line_lead_pattern = re.compile(r'^\s*\*\s*') -comment_empty_line_pattern = re.compile(r'^\s*\**\s*$') -function_name_pattern = re.compile(r'^([a-z]\w*)\s*:?(\s*\(.*\)\s*){0,2}\s*$') -signal_name_pattern = re.compile(r'^([A-Z]\w+::[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') -property_name_pattern = re.compile(r'^([A-Z]\w+:[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') -return_pattern = re.compile(r'^@?(returns:|return\s+value:)(.*\n?)$', re.IGNORECASE) -deprecated_pattern = re.compile(r'^(deprecated\s*:\s*.*\n?)$', re.IGNORECASE) -rename_to_pattern = re.compile(r'^(rename\s+to)\s*:\s*(.*\n?)$', re.IGNORECASE) -param_pattern = re.compile(r'^@(\S+)\s*:(.*\n?)$') -# Used to extract the annotations in the parameter and return descriptions -# extracted using above [param|return]_pattern patterns. -annotations_pattern = re.compile(r'^(?:(\s*\(.*\)\s*)*:)') -# Used to construct the annotation lists. -annotation_lead_pattern = re.compile(r'^\s*\(\s*(.*?)\s*\)\s*') - -# These patterns determine the identifier of the current comment block. They -# are grouped in a list for easy determination of block identifiers (in -# skip_to_identifier). The function_name_pattern should be tested for last -# because it always matches signal and property identifiers. -identifier_patterns = [ signal_name_pattern, property_name_pattern, function_name_pattern ] - -# This pattern is to match return sections that forget to have a colon (':') -# after the initial 'Return' phrase. It is not included by default in the list -# of final sections below because a lot of function descriptions begin with -# 'Returns ...' and the process_description() function would stop right at that -# first line, thinking it is a return section. -no_colon_return_pattern = re.compile(r'^@?(returns|return\s+value)\s*(.*\n?)$', re.IGNORECASE) -since_pattern = re.compile(r'^(since\s*:\s*.*\n?)$', re.IGNORECASE) - -# These patterns normally will be encountered after the description. Knowing -# the order of their appearance is difficult so this list is used to test when -# one begins and the other ends when processing the rest of the sections after -# the description. -final_section_patterns = [ return_pattern, since_pattern, deprecated_pattern, rename_to_pattern ] - -def parse_file(fp, doc_dict): - line = fp.readline() - while line: - cur_doc = GtkDoc() - line = skip_to_comment_block(fp, line) - line = skip_to_identifier(fp, line, cur_doc) - # See if the identifier is found (stored in the current GtkDoc by - # skip_to_identifier). If so, continue reading the rest of the comment - # block. - if cur_doc.name: - line = process_params(fp, line, cur_doc) - line = process_description(fp, line, cur_doc) - line = process_final_sections(fp, line, cur_doc) - # Add the current doc block to the dictionary of doc blocks. - doc_dict[cur_doc.name] = cur_doc - -# Given a list of annotations as string of the form -# '(annotation1) (annotation2) ...' return a list of annotations of the form -# [ (name1, value1), (name2, value2) ... ]. Not all annotations have values so -# the values in the list of tuples could be empty (''). -def get_annotation_list(annotations): - annotation_list = [] - while annotations: - match = annotation_lead_pattern.match(annotations) - if match: - annotation_contents = match.group(1) - name, split, value = annotation_contents.strip().partition(' ') - annotation_list.append((name, value)) - # Remove first occurrence to continue processing. - annotations = annotation_lead_pattern.sub('', annotations) - else: - break - return annotation_list - -# Given a currently read line, test that line and continue reading until the -# beginning of a comment block is found or eof is reached. Return the last -# read line. -def skip_to_comment_block(fp, line): - while line: - if comment_start_pattern.match(line): - break - line = fp.readline() - return line - -# Given the current line in a comment block, continue skipping lines until a -# non-blank line in the comment block is found or until the end of the block -# (or eof) is reached. Returns the line where reading stopped. -def skip_to_nonblank(fp, line): - while line: - if not comment_empty_line_pattern.match(line): - break - line = fp.readline() - # Stop processing if eof or end of comment block is reached. - if not line or comment_end_pattern.match(line): - break - return line - -# Given the first line of a comment block (the '/**'), see if the next -# non-blank line is the identifier of the comment block. Stop processing if -# the end of the block or eof is reached. Store the identifier (if there is -# one) and its type ('function', 'signal' or 'property') in the given GtkDoc. -# Return the line where the identifier is found or the line that stops the -# processing (if eof or the end of the comment block is found first). -def skip_to_identifier(fp, line, cur_doc): - # Skip the initial comment block line ('/**') if not eof. - if line: line = fp.readline() - - # Now skip empty lines. - line = skip_to_nonblank(fp, line) - - # See if the first non-blank line is the identifier. - if line and not comment_end_pattern.match(line): - # Remove the initial ' * ' in comment block line and see if there is an - # identifier. - line = comment_line_lead_pattern.sub('', line) - for pattern in identifier_patterns: - match = pattern.match(line) - if match: - # Set the GtkDoc name. - cur_doc.set_name(match.group(1)) - # Get annotations and add them to the GtkDoc. - annotations = get_annotation_list(match.group(2)) - for annotation in annotations: - cur_doc.add_annotation(annotation) - # Set the GtkDoc type. - if pattern == signal_name_pattern: - cur_doc.set_type('signal') - elif pattern == property_name_pattern: - cur_doc.set_type('property') - elif pattern == function_name_pattern: - cur_doc.set_type('function') - return line - return line - -# Given a currently read line (presumably the identifier line), read the next -# lines, testing to see if the lines are part of parameter descriptions. If -# so, store the parameter descriptions in the given doc block. Stop on eof and -# return the last line that stops the processing. -def process_params(fp, line, cur_doc): - # Skip the identifier line if not eof. Also skip any blank lines in the - # comment block. Return if eof or the end of the comment block are - # encountered. - if line: line = fp.readline() - line = skip_to_nonblank(fp, line) - if not line or comment_end_pattern.match(line): - return line - - # Remove initial ' * ' in first non-empty comment block line. - line = comment_line_lead_pattern.sub('', line) - - # Now process possible parameters as long as no eof or the end of the - # param section is not reached (which could be triggered by anything that - # doesn't match a '@param:..." line, even the end of the comment block). - match = param_pattern.match(line) - while line and match: - description = match.group(2) - - # First extract the annotations from the description and save them. - annotations = [] - annotation_match = annotations_pattern.match(description) - if annotation_match: - annotations = get_annotation_list(annotation_match.group(1)) - # Remove the annotations from the description - description = annotations_pattern.sub('', description) - - # Default to appending lines to current parameter. - append_func = cur_doc.append_to_last_param - - # See if the return has been included as part of the parameter - # section and make sure that lines are added to the GtkDoc return if - # so. - if match.group(1).lower() == "returns": - cur_doc.add_return(description, annotations) - append_func = cur_doc.append_to_return - # If not, just add it as a regular parameter. - else: - cur_doc.add_param(match.group(1), description, annotations) - - # Now read lines and append them until next parameter, beginning of - # description (an empty line), the end of the comment block or eof. - line = fp.readline() - while line: - # Stop processing if end of comment block or a blank comment line - # is encountered. - if comment_empty_line_pattern.match(line) or \ - comment_end_pattern.match(line): - break - - # Remove initial ' * ' in comment block line. - line = comment_line_lead_pattern.sub('', line) - - # Break from current param processing if a new one is - # encountered. - if param_pattern.match(line): break; - - # Otherwise, just append the current line and get the next line. - append_func(line) - line = fp.readline() - - # Re-evaluate match for while condition - match = param_pattern.match(line) - - # End by returning the current line. - return line - -# Having processed parameters, read the following lines into the description of -# the current doc block until the end of the comment block, the end of file or -# a return section is encountered. -def process_description(fp, line, cur_doc): - # First skip empty lines returning on eof or end of comment block. - line = skip_to_nonblank(fp, line) - if not line or comment_end_pattern.match(line): - return line - - # Remove initial ' * ' in non-empty comment block line. - line = comment_line_lead_pattern.sub('', line) - - # Also remove possible 'Description:' prefix. - if line[:12] == 'Description:': line = line[12:] - - # Used to tell if the previous line was blank and a return section - # uncommonly marked with 'Returns ...' instead of 'Returns: ...' has - # started (assume it is non-empty to begin with). - prev_line = 'non-empty' - - # Now read lines until a new section (like a return or a since section) is - # encountered. - while line: - # See if the description section has ended (if the line begins with - # 'Returns ...' and the previous line was empty -- this loop replaces - # empty lines with a newline). - if no_colon_return_pattern.match(line) and prev_line == '\n': - return line - # Or if one of the patterns of the final sections match - for pattern in final_section_patterns: - if pattern.match(line): - return line - - # If not, append lines to description in the doc comment block. - cur_doc.append_to_description(line) - - prev_line = line - line = fp.readline() - - # Stop processing on eof or at the end of comment block. - if not line or comment_end_pattern.match(line): - return line - - # Remove initial ' * ' in line so that the text can be appended to the - # description of the comment block and make sure that if the line is - # empty it be interpreted as a newline. - line = comment_line_lead_pattern.sub('', line) - if not line: line = '\n' - -# Given the line that ended the description (the first line of one of the final -# sections) process the final sections ('Returns:', 'Since:', etc.) until the -# end of the comment block or eof. Return the line that ends the processing. -def process_final_sections(fp, line, cur_doc): - while line and not comment_end_pattern.match(line): - # Remove leading ' * ' from current non-empty comment line. - line = comment_line_lead_pattern.sub('', line) - # Temporarily append the no colon return pattern to the final section - # patterns now that the description has been processed. It will be - # removed after the for loop below executes so that future descriptions - # that begin with 'Returns ...' are not interpreted as a return - # section. - final_section_patterns.append(no_colon_return_pattern) - for pattern in final_section_patterns: - match = pattern.match(line) - if match: - if pattern == return_pattern or \ - pattern == no_colon_return_pattern: - # Dealing with a 'Returns:' so first extract the - # annotations from the description and save them. - description = match.group(2) - annotations = [] - annotation_match = \ - annotations_pattern.match(description) - if annotation_match: - annotations = \ - get_annotation_list(annotation_match.group(1)) - # Remove the annotations from the description - description = annotations_pattern.sub('', description) - - # Now add the return. - cur_doc.add_return(description, annotations) - # In case more lines need to be appended. - append_func = cur_doc.append_to_return - elif pattern == rename_to_pattern: - # Dealing with a 'Rename to:' section (GObjectIntrospection - # annotation) so no further lines will be appended but this - # single one (and only to the annotations). - append_func = None - cur_doc.add_annotation((match.group(1), - match.group(2))) - else: - # For all others ('Since:' and 'Deprecated:') just append - # the line to the description for now. - cur_doc.append_to_description(line) - # In case more lines need to be appended. - append_func = cur_doc.append_to_description - - # Stop final section pattern matching for loop since a match - # has already been found. - break - - # Remove the no colon return pattern (which was temporarily added in - # the just executed loop) from the list of final section patterns. - final_section_patterns.pop() - - line = fp.readline() - - # Now continue appending lines to current section until a new one is - # found or an eof or the end of the comment block is encountered. - finished = False - while not finished and line and \ - not comment_end_pattern.match(line): - # Remove leading ' * ' from line and make sure that if it is empty, - # it be interpreted as a newline. - line = comment_line_lead_pattern.sub('', line) - if not line: line = '\n' - - for pattern in final_section_patterns: - if pattern.match(line): - finished = True - break - - # Break out of loop if a new section is found (determined in above - # inner loop). - if finished: break - - # Now it's safe to append line. - if append_func: append_func(line) - - # Get the next line to continue processing. - line = fp.readline() - - return line - -def parse_dir(dir, doc_dict): - for file in os.listdir(dir): - if file in ('.', '..'): continue - path = os.path.join(dir, file) - if os.path.isdir(path): - parse_dir(path, doc_dict) - if len(file) > 2 and file[-2:] == '.c': - sys.stderr.write("Processing " + path + '\n') - parse_file(open(path, 'r'), doc_dict) - -def extract(dirs, doc_dict=None): - if not doc_dict: doc_dict = {} - for dir in dirs: - parse_dir(dir, doc_dict) - return doc_dict - -tmpl_section_pattern = re.compile(r'^$') -def parse_tmpl(fp, doc_dict): - cur_doc = None - - line = fp.readline() - while line: - match = tmpl_section_pattern.match(line) - if match: - cur_doc = None # new input shouldn't affect the old doc dict - sect_type = match.group(1) - sect_name = match.group(2) - - if sect_type == 'FUNCTION': - cur_doc = doc_dict.get(sect_name) - if not cur_doc: - cur_doc = GtkDoc() - cur_doc.set_name(sect_name) - doc_dict[sect_name] = cur_doc - elif line == '\n': - cur_doc = None # don't worry about unused params. - elif cur_doc: - if line[:10] == '@Returns: ': - if string.strip(line[10:]): - cur_doc.append_to_return(line[10:]) - elif line[0] == '@': - pos = string.find(line, ':') - if pos >= 0: - cur_doc.append_to_named_param(line[1:pos], line[pos+1:]) - else: - cur_doc.append_to_description(line) - else: - cur_doc.append_to_description(line) - - line = fp.readline() - -def extract_tmpl(dirs, doc_dict=None): - if not doc_dict: doc_dict = {} - for dir in dirs: - for file in os.listdir(dir): - if file in ('.', '..'): continue - path = os.path.join(dir, file) - if os.path.isdir(path): - continue - if len(file) > 2 and file[-2:] == '.sgml': - parse_tmpl(open(path, 'r'), doc_dict) - return doc_dict diff --git a/codegen/docextract_to_xml.py b/codegen/docextract_to_xml.py deleted file mode 100755 index f41c839..0000000 --- a/codegen/docextract_to_xml.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- -# -# This litte script outputs the C doc comments to an XML format. -# So far it's only used by gtkmm (The C++ bindings). Murray Cumming. -# Usage example: -# # ./docextract_to_xml.py -s /gnome/head/cvs/gtk+/gtk/ -s /gnome/head/cvs/gtk+/docs/reference/gtk/tmpl/ > gtk_docs.xml - -import getopt -import re -import string -import sys - -import docextract - -def usage(): - sys.stderr.write('usage: docextract_to_xml.py ' + - '[-s /src/dir | --source-dir=/src/dir] ' + - '[-a | --with-annotations] [-p | --with-properties] ' + - '[-i | --with-signals ]\n') - sys.exit(1) - -# Translates special texts to &... HTML acceptable format. Also replace -# occurrences of '/*' and '*/' with '/ *' and '* /' respectively to avoid -# comment errors (note the spaces). Some function descriptions include C++ -# multi-line comments which cause errors when the description is included in a -# C++ Doxygen comment block. -def escape_text(unescaped_text): - # Escape every "&" not part of an entity reference - escaped_text = re.sub(r'&(?![A-Za-z]+;)', '&', unescaped_text) - - # These weird entities turn up in the output... - escaped_text = string.replace(escaped_text, '—', '—') - escaped_text = string.replace(escaped_text, '*', '*') - escaped_text = string.replace(escaped_text, '%', '%') - escaped_text = string.replace(escaped_text, '@', '@') - escaped_text = string.replace(escaped_text, '#', '#') - escaped_text = string.replace(escaped_text, ' ', ' ') - # This represents a '/' before or after an '*' so replace with slash but - # with spaces. - escaped_text = string.replace(escaped_text, '/', ' / ') - - # Escape for both tag contents and attribute values - escaped_text = string.replace(escaped_text, '<', '<') - escaped_text = string.replace(escaped_text, '>', '>') - escaped_text = string.replace(escaped_text, '"', '"') - - # Replace C++ comment begin and ends to ones that don't affect Doxygen. - escaped_text = string.replace(escaped_text, '/*', '/ *') - escaped_text = string.replace(escaped_text, '*/', '* /') - - return escaped_text - -def print_annotations(annotations): - for annotation in annotations: - print "" + \ - escape_text(annotation[1]) + "" - -if __name__ == '__main__': - try: - opts, args = getopt.getopt(sys.argv[1:], "d:s:o:api", - ["source-dir=", "with-annotations", - "with-properties", "with-signals"]) - except getopt.error, e: - sys.stderr.write('docextract_to_xml.py: %s\n' % e) - usage() - source_dirs = [] - with_annotations = False - with_signals = False - with_properties = False - for opt, arg in opts: - if opt in ('-s', '--source-dir'): - source_dirs.append(arg) - if opt in ('-a', '--with-annotations'): - with_annotations = True - if opt in ('-p', '--with-properties'): - with_properties = True - if opt in ('-i', '--with-signals'): - with_signals = True - if len(args) != 0: - usage() - - docs = docextract.extract(source_dirs); - docextract.extract_tmpl(source_dirs, docs); #Try the tmpl sgml files too. - - # print d.docs - - if docs: - - print "" - - for name, value in sorted(docs.items()): - # Get the type of comment block ('function', 'signal' or - # 'property') (the value is a GtkDoc). - block_type = value.get_type() - - # Skip signals if the option was not specified. - if block_type == 'signal' and not with_signals: - continue - # Likewise for properties. - elif block_type == 'property' and not with_properties: - continue - - print "<" + block_type + " name=\"" + escape_text(name) + "\">" - - print "" - print escape_text(value.get_description()) - print "" - - # Loop through the parameters if not dealing with a property: - if block_type != 'property': - print "" - for name, description, annotations in value.params: - print "" - print "" + escape_text(description) + "" - - if with_annotations: - print_annotations(annotations) - - print "" - - print "" - - # Show the return-type (also if not dealing with a property): - if with_annotations: - print "" - print "" + escape_text(value.ret[0]) + \ - "" - print_annotations(value.ret[1]) - print "" - else: - print "" + escape_text(value.ret[0]) + "" - - if with_annotations: - print_annotations(value.get_annotations()) - - print "\n" - - print "" diff --git a/codegen/docgen.py b/codegen/docgen.py deleted file mode 100755 index b9e2f67..0000000 --- a/codegen/docgen.py +++ /dev/null @@ -1,766 +0,0 @@ -#!/usr/bin/env python -import getopt -import os -import re -import sys - -import definitions -import defsparser -import docextract -import override - - -class Node: - - def __init__(self, name, interfaces=[]): - self.name = name - self.interfaces = interfaces - self.subclasses = [] - - def add_child(self, node): - self.subclasses.append(node) - - -def build_object_tree(parser): - # reorder objects so that parent classes come first ... - objects = parser.objects[:] - pos = 0 - while pos < len(objects): - parent = objects[pos].parent - for i in range(pos+1, len(objects)): - if objects[i].c_name == parent: - objects.insert(i+1, objects[pos]) - del objects[pos] - break - else: - pos = pos + 1 - - root = Node(None) - nodes = {None: root} - for obj_def in objects: - parent_name = obj_def.parent - if parent_name == 'GObject': - parent_name = None - parent_node = nodes[parent_name] - node = Node(obj_def.c_name, obj_def.implements) - parent_node.add_child(node) - nodes[node.name] = node - - if parser.interfaces: - interfaces = Node('gobject.GInterface') - root.add_child(interfaces) - nodes[interfaces.name] = interfaces - for obj_def in parser.interfaces: - node = Node(obj_def.c_name) - interfaces.add_child(node) - nodes[node.name] = node - - if parser.boxes: - boxed = Node('gobject.GBoxed') - root.add_child(boxed) - nodes[boxed.name] = boxed - for obj_def in parser.boxes: - node = Node(obj_def.c_name) - boxed.add_child(node) - nodes[node.name] = node - - if parser.pointers: - pointers = Node('gobject.GPointer') - root.add_child(pointers) - nodes[pointers.name] = pointers - for obj_def in parser.pointers: - node = Node(obj_def.c_name) - pointers.add_child(node) - nodes[node.name] = node - - return root - - -class DocWriter: - - def __init__(self): - self._fp = None - # parse the defs file - self.parser = defsparser.DefsParser(()) - self.overrides = override.Overrides() - self.classmap = {} - self.docs = {} - - def add_sourcedirs(self, source_dirs): - self.docs = docextract.extract(source_dirs, self.docs) - - def add_tmpldirs(self, tmpl_dirs): - self.docs = docextract.extract_tmpl(tmpl_dirs, self.docs) - - def add_docs(self, defs_file, overrides_file, module_name): - '''parse information about a given defs file''' - self.parser.filename = defs_file - self.parser.startParsing(defs_file) - if overrides_file: - self.overrides.handle_file(overrides_file) - - for obj in (self.parser.objects + self.parser.interfaces + - self.parser.boxes + self.parser.pointers): - if not obj.c_name in self.classmap: - self.classmap[obj.c_name] = '%s.%s' % ( - module_name, obj.name) - - def pyname(self, name): - return self.classmap.get(name, name) - - def _compare(self, obja, objb): - return cmp(self.pyname(obja.c_name), self.pyname(objb.c_name)) - - def output_docs(self, output_prefix): - files = {} - - # class hierarchy - hierarchy = build_object_tree(self.parser) - filename = self.create_filename('hierarchy', output_prefix) - self._fp = open(filename, 'w') - self.write_full_hierarchy(hierarchy) - self._fp.close() - - obj_defs = (self.parser.objects + self.parser.interfaces + - self.parser.boxes + self.parser.pointers) - obj_defs.sort(self._compare) - - for obj_def in obj_defs: - filename = self.create_filename(obj_def.c_name, output_prefix) - self._fp = open(filename, 'w') - if isinstance(obj_def, definitions.ObjectDef): - self.output_object_docs(obj_def) - elif isinstance(obj_def, definitions.InterfaceDef): - self.output_interface_docs(obj_def) - elif isinstance(obj_def, definitions.BoxedDef): - self.output_boxed_docs(obj_def) - elif isinstance(obj_def, definitions.PointerDef): - self.output_boxed_docs(obj_def) - self._fp.close() - files[os.path.basename(filename)] = obj_def - - if not files: - return - - output_filename = self.create_toc_filename(output_prefix) - self._fp = open(output_filename, 'w') - self.output_toc(files) - self._fp.close() - - def output_object_docs(self, obj_def): - self.write_class_header(obj_def.c_name) - - self.write_heading('Synopsis') - self.write_synopsis(obj_def) - self.close_section() - - # construct the inheritence hierarchy ... - ancestry = [(obj_def.c_name, obj_def.implements)] - try: - parent = obj_def.parent - while parent != None: - if parent == 'GObject': - ancestry.append(('GObject', [])) - parent = None - else: - parent_def = self.parser.find_object(parent) - ancestry.append((parent_def.c_name, parent_def.implements)) - parent = parent_def.parent - except ValueError: - pass - ancestry.reverse() - self.write_heading('Ancestry') - self.write_hierarchy(obj_def.c_name, ancestry) - self.close_section() - - constructor = self.parser.find_constructor(obj_def, self.overrides) - if constructor: - self.write_heading('Constructor') - self.write_constructor(constructor, - self.docs.get(constructor.c_name, None)) - self.close_section() - - methods = self.parser.find_methods(obj_def) - methods = filter(lambda meth, self=self: - not self.overrides.is_ignored(meth.c_name), methods) - if methods: - self.write_heading('Methods') - for method in methods: - self.write_method(method, self.docs.get(method.c_name, None)) - self.close_section() - - self.write_class_footer(obj_def.c_name) - - def get_methods_for_object(self, obj_def): - methods = [] - for method in self.parser.find_methods(obj_def): - if not self.overrides.is_ignored(method.c_name): - methods.append(method) - return methods - - def output_interface_docs(self, int_def): - self.write_class_header(int_def.c_name) - - self.write_heading('Synopsis') - self.write_synopsis(int_def) - self.close_section() - - methods = self.get_methods_for_object(int_def) - if methods: - self.write_heading('Methods') - for method in methods: - self.write_method(method, self.docs.get(method.c_name, None)) - self.close_section() - self.write_class_footer(int_def.c_name) - - def output_boxed_docs(self, box_def): - self.write_class_header(box_def.c_name) - - self.write_heading('Synopsis') - self.write_synopsis(box_def) - self.close_section() - - constructor = self.parser.find_constructor(box_def, self.overrides) - if constructor: - self.write_heading('Constructor') - self.write_constructor(constructor, - self.docs.get(constructor.c_name, None)) - self.close_section() - - methods = self.get_methods_for_object(box_def) - if methods: - self.write_heading('Methods') - for method in methods: - self.write_method(method, self.docs.get(method.c_name, None)) - self.close_section() - - self.write_class_footer(box_def.c_name) - - def output_toc(self, files): - self._fp.write('TOC\n\n') - for filename in sorted(files): - obj_def = files[filename] - self._fp.write(obj_def.c_name + ' - ' + filename + '\n') - - # override the following to create a more complex output format - - def create_filename(self, obj_name, output_prefix): - '''Create output filename for this particular object''' - return output_prefix + '-' + obj_name.lower() + '.txt' - - def create_toc_filename(self, output_prefix): - return self.create_filename(self, 'docs', output_prefix) - - def write_full_hierarchy(self, hierarchy): - - def handle_node(node, indent=''): - for child in node.subclasses: - self._fp.write(indent + node.name) - if node.interfaces: - self._fp.write(' (implements ') - self._fp.write(', '.join(node.interfaces)) - self._fp.write(')\n') - else: - self._fp.write('\n') - handle_node(child, indent + ' ') - handle_node(hierarchy) - - def serialize_params(self, func_def): - params = [] - for param in func_def.params: - params.append(param[1]) - return ', '.join(params) - - # these need to handle default args ... - - def create_constructor_prototype(self, func_def): - return '%s(%s)' % (func_def.is_constructor_of, - self.serialize_params(func_def)) - - def create_function_prototype(self, func_def): - return '%s(%s)' % (func_def.name, - self.serialize_params(func_def)) - - def create_method_prototype(self, meth_def): - return '%s.%s(%s)' % (meth_def.of_object, - meth_def.name, - self.serialize_params(meth_def)) - - def write_class_header(self, obj_name): - self._fp.write('Class %s\n' % obj_name) - self._fp.write('======%s\n\n' % ('=' * len(obj_name))) - - def write_class_footer(self, obj_name): - pass - - def write_heading(self, text): - self._fp.write('\n' + text + '\n' + ('-' * len(text)) + '\n') - - def close_section(self): - pass - - def write_synopsis(self, obj_def): - self._fp.write('class %s' % obj_def.c_name) - if isinstance(obj_def, definitions.ObjectDef): - bases = [] - if obj_def.parent: - bases.append(obj_def.parent) - bases = bases = obj_def.implements - if bases: - self._fp.write('(%s)' % ', '.join(bases, )) - self._fp.write(':\n') - - constructor = self.parser.find_constructor(obj_def, self.overrides) - if constructor: - prototype = self.create_constructor_prototype(constructor) - self._fp.write(' def %s\n' % prototype) - - for method in self.get_methods_for_object(obj_def): - prototype = self.create_method_prototype(method) - self._fp.write(' def %s\n' % prototype) - - def write_hierarchy(self, obj_name, ancestry): - indent = '' - for name, interfaces in ancestry: - self._fp.write(indent + '+-- ' + name) - if interfaces: - self._fp.write(' (implements ') - self._fp.write(', '.join(interfaces)) - self._fp.write(')\n') - else: - self._fp.write('\n') - indent = indent + ' ' - self._fp.write('\n') - - def write_constructor(self, func_def, func_doc): - prototype = self.create_constructor_prototype(func_def) - self._fp.write(prototype + '\n\n') - for type, name, dflt, null in func_def.params: - self.write_parameter(name, func_doc) - self.write_return_value(func_def, func_doc) - if func_doc and func_doc.description: - self._fp.write(func_doc.description) - self._fp.write('\n\n\n') - - def write_method(self, meth_def, func_doc): - prototype = self.create_method_prototype(meth_def) - self._fp.write(prototype + '\n\n') - for type, name, dflt, null in meth_def.params: - self.write_parameter(name, func_doc) - self.write_return_value(meth_def, func_doc) - if func_doc and func_doc.description: - self._fp.write('\n') - self._fp.write(func_doc.description) - self._fp.write('\n\n') - - def write_parameter(self, param_name, func_doc): - if func_doc: - descr = func_doc.get_param_description(param_name) - else: - descr = 'a ' + type - self._fp.write(' ' + param_name + ': ' + descr + '\n') - - def write_return_value(self, meth_def, func_doc): - if meth_def.ret and meth_def.ret != 'none': - if func_doc and func_doc.ret: - descr = func_doc.ret - else: - descr = 'a ' + meth_def.ret - self._fp.write(' Returns: ' + descr + '\n') - -CLASS_HEADER_TEMPLATE = """ - - %(name)s - 3 - %(miscinfo)s - - - - %(name)s - - -""" -VARIABLE_TEMPLATE = """ - %(parameter)s : - %(description)s - -""" - -DOCBOOK_HEADER = """ - -""" - - -class DocbookDocWriter(DocWriter): - - def __init__(self): - DocWriter.__init__(self) - - self._function_pat = re.compile(r'(\w+)\s*\(\)') - self._parameter_pat = re.compile(r'\@(\w+)') - self._constant_pat = re.compile(r'\%(-?\w+)') - self._symbol_pat = re.compile(r'#([\w-]+)') - - self._transtable = ['-'] * 256 - # make string -> reference translation func - for digit in '0123456789': - self._transtable[ord(digit)] = digit - - for letter in 'abcdefghijklmnopqrstuvwxyz': - self._transtable[ord(letter)] = letter - self._transtable[ord(letter.upper())] = letter - self._transtable = ''.join(self._transtable) - - def create_filename(self, obj_name, output_prefix): - '''Create output filename for this particular object''' - stem = output_prefix + '-' + obj_name.lower() - return stem + '.xml' - - def create_toc_filename(self, output_prefix): - return self.create_filename('classes', output_prefix) - - def make_class_ref(self, obj_name): - return 'class-' + obj_name.translate(self._transtable) - - def make_method_ref(self, meth_def): - return 'method-%s--%s' % ( - meth_def.of_object.translate(self._transtable), - meth_def.name.translate(self._transtable)) - - def _format_function(self, match): - info = self.parser.c_name.get(match.group(1), None) - if info: - if isinstance(info, defsparser.FunctionDef): - return self._format_funcdef(info) - if isinstance(info, defsparser.MethodDef): - return self._format_method(info) - - # fall through through - return '%s()' % (match.group(1), ) - - def _format_funcdef(self, info): - if info.is_constructor_of is not None: - # should have a link here - return '%s()' % ( - self.pyname(info.is_constructor_of), ) - else: - return '%s()' % (info.name, ) - - def _format_param(self, match): - return '%s' % (match.group(1), ) - - def _format_const(self, match): - return '%s' % (match.group(1), ) - - def _format_method(self, info): - return ('' - '%s.%s' - '') % (self.make_method_ref(info), - self.pyname(info.of_object), - info.name) - - def _format_object(self, info): - return ('' - '%s' - '') % (self.make_class_ref(info.c_name), - self.pyname(info.c_name)) - - def _format_symbol(self, match): - info = self.parser.c_name.get(match.group(1), None) - if info: - if isinstance(info, defsparser.FunctionDef): - return self._format_funcdef(info) - elif isinstance(info, defsparser.MethodDef): - return self._format_method(info) - elif isinstance(info, (defsparser.ObjectDef, - defsparser.InterfaceDef, - defsparser.BoxedDef, - defsparser.PointerDef)): - return self._format_object(info) - - # fall through through - return '%s' % (match.group(1), ) - - def reformat_text(self, text, singleline=0): - # replace special strings ... - text = self._function_pat.sub(self._format_function, text) - text = self._parameter_pat.sub(self._format_param, text) - text = self._constant_pat.sub(self._format_const, text) - text = self._symbol_pat.sub(self._format_symbol, text) - - # don't bother with expansion for single line text. - if singleline: - return text - - lines = text.strip().split('\n') - for index in range(len(lines)): - if lines[index].strip() == '': - lines[index] = '\n' - continue - return '%s' % ('\n'.join(lines), ) - - # write out hierarchy - - def write_full_hierarchy(self, hierarchy): - - def handle_node(node, indent=''): - if node.name: - self._fp.write('%s%s' % - (indent, self.make_class_ref(node.name), - self.pyname(node.name))) - if node.interfaces: - self._fp.write(' (implements ') - for i in range(len(node.interfaces)): - self._fp.write('%s' % - (self.make_class_ref(node.interfaces[i]), - self.pyname(node.interfaces[i]))) - if i != len(node.interfaces) - 1: - self._fp.write(', ') - self._fp.write(')\n') - else: - self._fp.write('\n') - - indent = indent + ' ' - node.subclasses.sort(lambda a, b: - cmp(self.pyname(a.name), self.pyname(b.name))) - for child in node.subclasses: - handle_node(child, indent) - - self._fp.write(DOCBOOK_HEADER) - self._fp.write('') - handle_node(hierarchy) - self._fp.write('\n') - - # these need to handle default args ... - - def create_constructor_prototype(self, func_def): - xml = ['\n'] - xml.append(' __init__\n') - for type, name, dflt, null in func_def.params: - xml.append(' ') - xml.append(name) - xml.append('') - if dflt: - xml.append('') - xml.append(dflt) - xml.append('') - xml.append('\n') - if not func_def.params: - xml.append(' ') - xml.append(' ') - return ''.join(xml) - - def create_function_prototype(self, func_def): - xml = ['\n \n'] - xml.append(' ') - xml.append(func_def.name) - xml.append('\n') - for type, name, dflt, null in func_def.params: - xml.append(' ') - xml.append(name) - xml.append('') - if dflt: - xml.append('') - xml.append(dflt) - xml.append('') - xml.append('\n') - if not func_def.params: - xml.append(' \n ') - return ''.join(xml) - - def create_method_prototype(self, meth_def, addlink=0): - xml = ['\n'] - xml.append(' ') - if addlink: - xml.append('' % self.make_method_ref(meth_def)) - xml.append(self.pyname(meth_def.name)) - if addlink: - xml.append('') - xml.append('\n') - for type, name, dflt, null in meth_def.params: - xml.append(' ') - xml.append(name) - xml.append('') - if dflt: - xml.append('') - xml.append(dflt) - xml.append('') - xml.append('\n') - if not meth_def.params: - xml.append(' ') - xml.append(' ') - return ''.join(xml) - - def write_class_header(self, obj_name): - self._fp.write(DOCBOOK_HEADER) - self._fp.write(CLASS_HEADER_TEMPLATE % dict( - entryid=self.make_class_ref(obj_name), - name=self.pyname(obj_name), - miscinfo="PyGTK Docs")) - - def write_class_footer(self, obj_name): - self._fp.write('\n') - - def write_heading(self, text): - self._fp.write(' \n') - self._fp.write(' ' + text + '\n\n') - - def close_section(self): - self._fp.write(' \n') - - def write_synopsis(self, obj_def): - self._fp.write('\n') - self._fp.write(' %s\n' - % self.pyname(obj_def.c_name)) - if isinstance(obj_def, definitions.ObjectDef): - if obj_def.parent: - self._fp.write(' %s' - '\n' - % (self.make_class_ref(obj_def.parent), - self.pyname(obj_def.parent))) - for base in obj_def.implements: - self._fp.write(' %s' - '\n' - % (self.make_class_ref(base), self.pyname(base))) - elif isinstance(obj_def, definitions.InterfaceDef): - self._fp.write(' gobject.GInterface' - '\n') - elif isinstance(obj_def, definitions.BoxedDef): - self._fp.write(' gobject.GBoxed' - '\n') - elif isinstance(obj_def, definitions.PointerDef): - self._fp.write(' gobject.GPointer' - '\n') - - constructor = self.parser.find_constructor(obj_def, self.overrides) - if constructor: - self._fp.write( - '%s\n' % self.create_constructor_prototype(constructor)) - for method in self.get_methods_for_object(obj_def): - self._fp.write( - '%s\n' % self.create_method_prototype(method, addlink=1)) - self._fp.write('\n\n') - - def write_hierarchy(self, obj_name, ancestry): - self._fp.write('') - indent = '' - for name, interfaces in ancestry: - self._fp.write( - '%s+-- %s' % - (indent, self.make_class_ref(name), self.pyname(name))) - if interfaces: - self._fp.write(' (implements ') - for i in range(len(interfaces)): - self._fp.write('%s' % - (self.make_class_ref(interfaces[i]), - self.pyname(interfaces[i]))) - if i != len(interfaces) - 1: - self._fp.write(', ') - self._fp.write(')\n') - else: - self._fp.write('\n') - indent = indent + ' ' - self._fp.write('\n\n') - - def write_params(self, params, ret, func_doc): - if not params and (not ret or ret == 'none'): - return - self._fp.write(' \n') - for type, name, dflt, null in params: - if func_doc: - descr = func_doc.get_param_description(name).strip() - else: - descr = 'a ' + type - self._fp.write(VARIABLE_TEMPLATE % dict( - parameter=name, - description=self.reformat_text(descr, singleline=1))) - if ret and ret != 'none': - if func_doc and func_doc.ret: - descr = func_doc.ret.strip() - else: - descr = 'a ' + ret - self._fp.write(VARIABLE_TEMPLATE % dict( - parameter='Returns', - description=self.reformat_text(descr, singleline=1))) - self._fp.write(' \n') - - def write_constructor(self, func_def, func_doc): - prototype = self.create_constructor_prototype(func_def) - self._fp.write('%s\n' % prototype) - self.write_params(func_def.params, func_def.ret, func_doc) - - if func_doc and func_doc.description: - self._fp.write(self.reformat_text(func_doc.description)) - self._fp.write('\n\n\n') - - def write_method(self, meth_def, func_doc): - self._fp.write(' \n' % ( - self.make_method_ref(meth_def), )) - self._fp.write(' %s.%s\n\n' % ( - self.pyname(meth_def.of_object), - meth_def.name)) - prototype = self.create_method_prototype(meth_def) - self._fp.write('%s\n' % prototype) - self.write_params(meth_def.params, meth_def.ret, func_doc) - if func_doc and func_doc.description: - self._fp.write(self.reformat_text(func_doc.description)) - self._fp.write(' \n\n\n') - - def output_toc(self, files, fp=sys.stdout): - self._fp.write(DOCBOOK_HEADER) - - #self._fp.write('\n') - #self._fp.write(' Class Documentation\n') - #for filename, obj_def in files: - # self._fp.write('&' + - # obj_def.c_name.translate(self._transtable) + ';\n') - #self._fp.write('\n') - - self._fp.write('\n') - self._fp.write(' Class Reference\n') - for filename in sorted(files): - self._fp.write(' \n' % filename) - self._fp.write('\n') - - -def main(args): - try: - opts, args = getopt.getopt(args[1:], "d:s:o:", - ["defs-file=", "override=", "source-dir=", - "output-prefix="]) - except getopt.error, e: - sys.stderr.write('docgen.py: %s\n' % e) - sys.stderr.write( - 'usage: docgen.py -d file.defs [-s /src/dir] [-o output-prefix]\n') - return 1 - - defs_file = None - overrides_file = None - source_dirs = [] - output_prefix = 'docs' - for opt, arg in opts: - if opt in ('-d', '--defs-file'): - defs_file = arg - if opt in ('--override', ): - overrides_file = arg - elif opt in ('-s', '--source-dir'): - source_dirs.append(arg) - elif opt in ('-o', '--output-prefix'): - output_prefix = arg - if len(args) != 0 or not defs_file: - sys.stderr.write( - 'usage: docgen.py -d file.defs [-s /src/dir] [-o output-prefix]\n') - return 1 - - d = DocbookDocWriter() - d.add_sourcedirs(source_dirs) - d.add_docs(defs_file, overrides_file, 'gio') - d.output_docs(output_prefix) - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/codegen/h2def.py b/codegen/h2def.py deleted file mode 100755 index 17617fa..0000000 --- a/codegen/h2def.py +++ /dev/null @@ -1,631 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- -# GPL'ed -# Toby D. Reeves -# -# Modified by James Henstridge to output stuff in -# Havoc's new defs format. Info on this format can be seen at: -# http://mail.gnome.org/archives/gtk-devel-list/2000-January/msg00070.html -# Updated to be PEP-8 compatible and refactored to use OOP -# -# Scan the given public .h files of a GTK module (or module using -# GTK object conventions) and generates a set of scheme defs. -# -# h2def searches through a header file looking for function prototypes and -# generates a scheme style defenition for each prototype. -# Basically the operation of h2def is: -# -# - read each .h file into a buffer which is scrubbed of extraneous data -# - find all object defenitions: -# - find all structures that may represent a GtkObject -# - find all structures that might represent a class -# - find all structures that may represent a GtkObject subclass -# - find all structures that might represent a class/Iface inherited from -# GTypeInterface -# - find all enum defenitions -# - write out the defs -# -# The command line options are: -# -# -s --separate Create separate files for objects and function/method defs -# using the given name as the base name (optional). If this -# is not specified the combined object and function defs -# will be output to sys.stdout. -# -f --defsfilter Extract defs from the given file to filter the output defs -# that is don't output defs that are defined in the -# defsfile. More than one deffile may be specified. -# -m --modulename The prefix to be stripped from the front of function names -# for the given module -# -n --namespace The module or namespace name to be used, for example -# WebKit where h2def is unable to detect the module name -# automatically. it also sets the gtype-id prefix. -# --onlyenums Only produce defs for enums and flags -# --onlyobjdefs Only produce defs for objects -# -v Verbose output -# -# Examples: -# -# python h2def.py /usr/local/include/pango-1.0/pango/*.h >/tmp/pango.defs -# -# - Outputs all defs for the pango module. -# -# python h2def.py -m gdk -s /tmp/gdk-2.10 \ -# -f /usr/tmp/pygtk/gtk/gdk-base.defs \ -# /usr/local/include/gtk-2.0/gdk/*.h \ -# /usr/local/include/gtk-2.0/gdk-pixbuf/*.h -# -# - Outputs the gdk module defs that are not contained in the defs file -# /usr/tmp/pygtk/gtk/gdk-base.defs. Two output files are created: -# /tmp/gdk-2.10-types.defs and /tmp/gdk-2.10.defs. -# -# python h2def.py -n WebKit /usr/incude/webkit-1.0/webkit/*.h \ -# >/tmp/webkit.defs -# -# - Outputs all the defs for webkit module, setting the module name to WebKit -# and the gtype-id prefix to WEBKIT_ which can't be detected automatically. -# - -import getopt -import os -import re -import string -import sys - -import defsparser - -# ------------------ Create typecodes from typenames --------- - -_upperstr_pat1 = re.compile(r'([^A-Z])([A-Z])') -_upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])') -_upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])') - -def to_upper_str(name): - """Converts a typename to the equivalent upercase and underscores - name. This is used to form the type conversion macros and enum/flag - name variables""" - name = _upperstr_pat1.sub(r'\1_\2', name) - name = _upperstr_pat2.sub(r'\1_\2', name) - name = _upperstr_pat3.sub(r'\1_\2', name, count=1) - return string.upper(name) - -def typecode(typename, namespace=None): - """create a typecode (eg. GTK_TYPE_WIDGET) from a typename""" - if namespace: - return string.replace(string.upper(namespace) + "_" + to_upper_str(typename[len(namespace):]), '_', '_TYPE_', 1) - - return string.replace(to_upper_str(typename), '_', '_TYPE_', 1) - - -# ------------------ Find object definitions ----------------- -# Strips the comments from buffer -def strip_comments(buf): - parts = [] - lastpos = 0 - while 1: - pos = string.find(buf, '/*', lastpos) - if pos >= 0: - parts.append(buf[lastpos:pos]) - pos = string.find(buf, '*/', pos) - if pos >= 0: - lastpos = pos + 2 - else: - break - else: - parts.append(buf[lastpos:]) - break - return string.join(parts, '') - -# Strips the dll API from buffer, for example WEBKIT_API -def strip_dll_api(buf): - pat = re.compile("[A-Z]*_API ") - buf = pat.sub("", buf) - return buf - -obj_name_pat = "[A-Z][a-z]*[A-Z][A-Za-z0-9]*" - -split_prefix_pat = re.compile('([A-Z]+[a-z]*)([A-Za-z0-9]+)') - -def find_obj_defs(buf, objdefs=[]): - """ - Try to find object definitions in header files. - """ - - # filter out comments from buffer. - buf = strip_comments(buf) - - # filter out dll api - buf = strip_dll_api(buf) - - maybeobjdefs = [] # contains all possible objects from file - - # first find all structures that look like they may represent a GtkObject - pat = re.compile("struct\s+_(" + obj_name_pat + ")\s*{\s*" + - "(" + obj_name_pat + ")\s+", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - maybeobjdefs.append((m.group(1), m.group(2))) - pos = m.end() - - # handle typedef struct { ... } style struct defs. - pat = re.compile("typedef struct\s+[_\w]*\s*{\s*" + - "(" + obj_name_pat + ")\s+[^}]*}\s*" + - "(" + obj_name_pat + ")\s*;", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - maybeobjdefs.append((m.group(2), m.group(1))) - pos = m.end() - - # now find all structures that look like they might represent a class: - pat = re.compile("struct\s+_(" + obj_name_pat + ")Class\s*{\s*" + - "(" + obj_name_pat + ")Class\s+", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - t = (m.group(1), m.group(2)) - # if we find an object structure together with a corresponding - # class structure, then we have probably found a GtkObject subclass. - if t in maybeobjdefs: - objdefs.append(t) - pos = m.end() - - pat = re.compile("typedef struct\s+[_\w]*\s*{\s*" + - "(" + obj_name_pat + ")Class\s+[^}]*}\s*" + - "(" + obj_name_pat + ")Class\s*;", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - t = (m.group(2), m.group(1)) - # if we find an object structure together with a corresponding - # class structure, then we have probably found a GtkObject subclass. - if t in maybeobjdefs: - objdefs.append(t) - pos = m.end() - - # now find all structures that look like they might represent - # a class inherited from GTypeInterface: - pat = re.compile("struct\s+_(" + obj_name_pat + ")Class\s*{\s*" + - "GTypeInterface\s+", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - t = (m.group(1), '') - t2 = (m.group(1)+'Class', 'GTypeInterface') - # if we find an object structure together with a corresponding - # class structure, then we have probably found a GtkObject subclass. - if t2 in maybeobjdefs: - objdefs.append(t) - pos = m.end() - - # now find all structures that look like they might represent - # an Iface inherited from GTypeInterface: - pat = re.compile("struct\s+_(" + obj_name_pat + ")Iface\s*{\s*" + - "GTypeInterface\s+", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = pat.search(buf, pos) - if not m: break - t = (m.group(1), '') - t2 = (m.group(1)+'Iface', 'GTypeInterface') - # if we find an object structure together with a corresponding - # class structure, then we have probably found a GtkObject subclass. - if t2 in maybeobjdefs: - objdefs.append(t) - pos = m.end() - -def sort_obj_defs(objdefs): - objdefs.sort() # not strictly needed, but looks nice - pos = 0 - while pos < len(objdefs): - klass,parent = objdefs[pos] - for i in range(pos+1, len(objdefs)): - # parent below subclass ... reorder - if objdefs[i][0] == parent: - objdefs.insert(i+1, objdefs[pos]) - del objdefs[pos] - break - else: - pos = pos + 1 - return objdefs - -# ------------------ Find enum definitions ----------------- - -def find_enum_defs(buf, enums=[]): - # strip comments - # bulk comments - buf = strip_comments(buf) - - # strip dll api macros - buf = strip_dll_api(buf) - - # strip # directives - pat = re.compile(r"""^[#].*?$""", re.MULTILINE) - buf = pat.sub('', buf) - - buf = re.sub('\n', ' ', buf) - - enum_pat = re.compile(r'enum\s*{([^}]*)}\s*([A-Z][A-Za-z]*)(\s|;)') - splitter = re.compile(r'\s*,\s', re.MULTILINE) - pos = 0 - while pos < len(buf): - m = enum_pat.search(buf, pos) - if not m: break - - name = m.group(2) - vals = m.group(1) - isflags = string.find(vals, '<<') >= 0 - entries = [] - for val in splitter.split(vals): - if not string.strip(val): continue - entries.append(string.split(val)[0]) - if name != 'GdkCursorType': - enums.append((name, isflags, entries)) - - pos = m.end() - -# ------------------ Find function definitions ----------------- - -def clean_func(buf): - """ - Ideally would make buf have a single prototype on each line. - Actually just cuts out a good deal of junk, but leaves lines - where a regex can figure prototypes out. - """ - # bulk comments - buf = strip_comments(buf) - - # dll api - buf = strip_dll_api(buf) - - # compact continued lines - pat = re.compile(r"""\\\n""", re.MULTILINE) - buf = pat.sub('', buf) - - # Preprocess directives - pat = re.compile(r"""^[#].*?$""", re.MULTILINE) - buf = pat.sub('', buf) - - #typedefs, stucts, and enums - pat = re.compile(r"""^(typedef|struct|enum)(\s|.|\n)*?;\s*""", - re.MULTILINE) - buf = pat.sub('', buf) - - #strip DECLS macros - pat = re.compile(r"""G_BEGIN_DECLS|BEGIN_LIBGTOP_DECLS""", re.MULTILINE) - buf = pat.sub('', buf) - - #extern "C" - pat = re.compile(r"""^\s*(extern)\s+\"C\"\s+{""", re.MULTILINE) - buf = pat.sub('', buf) - - #multiple whitespace - pat = re.compile(r"""\s+""", re.MULTILINE) - buf = pat.sub(' ', buf) - - #clean up line ends - pat = re.compile(r""";\s*""", re.MULTILINE) - buf = pat.sub('\n', buf) - buf = buf.lstrip() - - #associate *, &, and [] with type instead of variable - #pat = re.compile(r'\s+([*|&]+)\s*(\w+)') - pat = re.compile(r' \s* ([*|&]+) \s* (\w+)', re.VERBOSE) - buf = pat.sub(r'\1 \2', buf) - pat = re.compile(r'\s+ (\w+) \[ \s* \]', re.VERBOSE) - buf = pat.sub(r'[] \1', buf) - - # make return types that are const work. - buf = re.sub(r'\s*\*\s*G_CONST_RETURN\s*\*\s*', '** ', buf) - buf = string.replace(buf, 'G_CONST_RETURN ', 'const-') - buf = string.replace(buf, 'const ', 'const-') - - #strip GSEAL macros from the middle of function declarations: - pat = re.compile(r"""GSEAL""", re.VERBOSE) - buf = pat.sub('', buf) - - return buf - -proto_pat=re.compile(r""" -(?P(-|\w|\&|\*)+\s*) # return type -\s+ # skip whitespace -(?P\w+)\s*[(] # match the function name until the opening ( -\s*(?P.*?)\s*[)] # group the function arguments -""", re.IGNORECASE|re.VERBOSE) -#""" -arg_split_pat = re.compile("\s*,\s*") - -get_type_pat = re.compile(r'(const-)?([A-Za-z0-9]+)\*?\s+') -pointer_pat = re.compile('.*\*$') -func_new_pat = re.compile('(\w+)_new$') - -class DefsWriter: - def __init__(self, fp=None, prefix=None, ns=None, verbose=False, - defsfilter=None): - if not fp: - fp = sys.stdout - - self.fp = fp - self.prefix = prefix - self.namespace = ns - self.verbose = verbose - - self._enums = {} - self._objects = {} - self._functions = {} - if defsfilter: - filter = defsparser.DefsParser(defsfilter) - filter.startParsing() - for func in filter.functions + filter.methods.values(): - self._functions[func.c_name] = func - for obj in filter.objects + filter.boxes + filter.interfaces: - self._objects[obj.c_name] = obj - for obj in filter.enums: - self._enums[obj.c_name] = obj - - def write_def(self, deffile): - buf = open(deffile).read() - - self.fp.write('\n;; From %s\n\n' % os.path.basename(deffile)) - self._define_func(buf) - self.fp.write('\n') - - def write_enum_defs(self, enums, fp=None): - if not fp: - fp = self.fp - - fp.write(';; Enumerations and flags ...\n\n') - trans = string.maketrans(string.uppercase + '_', - string.lowercase + '-') - filter = self._enums - for cname, isflags, entries in enums: - if filter: - if cname in filter: - continue - name = cname - module = None - if self.namespace: - module = self.namespace - name = cname[len(self.namespace):] - else: - m = split_prefix_pat.match(cname) - if m: - module = m.group(1) - name = m.group(2) - if isflags: - fp.write('(define-flags ' + name + '\n') - else: - fp.write('(define-enum ' + name + '\n') - if module: - fp.write(' (in-module "' + module + '")\n') - fp.write(' (c-name "' + cname + '")\n') - fp.write(' (gtype-id "' + typecode(cname, self.namespace) + '")\n') - prefix = entries[0] - for ent in entries: - # shorten prefix til we get a match ... - # and handle GDK_FONT_FONT, GDK_FONT_FONTSET case - while ((len(prefix) and prefix[-1] != '_') or ent[:len(prefix)] != prefix - or len(prefix) >= len(ent)): - prefix = prefix[:-1] - prefix_len = len(prefix) - fp.write(' (values\n') - for ent in entries: - fp.write(' \'("%s" "%s")\n' % - (string.translate(ent[prefix_len:], trans), ent)) - fp.write(' )\n') - fp.write(')\n\n') - - def write_obj_defs(self, objdefs, fp=None): - if not fp: - fp = self.fp - - fp.write(';; -*- scheme -*-\n') - fp.write('; object definitions ...\n') - - filter = self._objects - for klass, parent in objdefs: - if filter: - if klass in filter: - continue - if self.namespace: - cname = klass[len(self.namespace):] - cmodule = self.namespace - else: - m = split_prefix_pat.match(klass) - cname = klass - cmodule = None - if m: - cmodule = m.group(1) - cname = m.group(2) - fp.write('(define-object ' + cname + '\n') - if cmodule: - fp.write(' (in-module "' + cmodule + '")\n') - if parent: - fp.write(' (parent "' + parent + '")\n') - fp.write(' (c-name "' + klass + '")\n') - fp.write(' (gtype-id "' + typecode(klass, self.namespace) + '")\n') - # should do something about accessible fields - fp.write(')\n\n') - - def _define_func(self, buf): - buf = clean_func(buf) - buf = string.split(buf,'\n') - filter = self._functions - for p in buf: - if not p: - continue - m = proto_pat.match(p) - if m == None: - if self.verbose: - sys.stderr.write('No match:|%s|\n' % p) - continue - func = m.group('func') - if func[0] == '_': - continue - if filter: - if func in filter: - continue - ret = m.group('ret') - args = m.group('args') - args = arg_split_pat.split(args) - for i in range(len(args)): - spaces = string.count(args[i], ' ') - if spaces > 1: - args[i] = string.replace(args[i], ' ', '-', spaces - 1) - - self._write_func(func, ret, args) - - def _write_func(self, name, ret, args): - if len(args) >= 1: - # methods must have at least one argument - munged_name = name.replace('_', '') - m = get_type_pat.match(args[0]) - if m: - obj = m.group(2) - if munged_name[:len(obj)] == obj.lower(): - self._write_method(obj, name, ret, args) - return - - if self.prefix: - l = len(self.prefix) - if name[:l] == self.prefix and name[l] == '_': - fname = name[l+1:] - else: - fname = name - else: - fname = name - - # it is either a constructor or normal function - self.fp.write('(define-function ' + fname + '\n') - self.fp.write(' (c-name "' + name + '")\n') - - # Hmmm... Let's asume that a constructor function name - # ends with '_new' and it returns a pointer. - m = func_new_pat.match(name) - if pointer_pat.match(ret) and m: - cname = '' - for s in m.group(1).split ('_'): - cname += s.title() - if cname != '': - self.fp.write(' (is-constructor-of "' + cname + '")\n') - - self._write_return(ret) - self._write_arguments(args) - - def _write_method(self, obj, name, ret, args): - regex = string.join(map(lambda x: x+'_?', string.lower(obj)),'') - mname = re.sub(regex, '', name, 1) - if self.prefix: - l = len(self.prefix) + 1 - if mname[:l] == self.prefix and mname[l+1] == '_': - mname = mname[l+1:] - self.fp.write('(define-method ' + mname + '\n') - self.fp.write(' (of-object "' + obj + '")\n') - self.fp.write(' (c-name "' + name + '")\n') - self._write_return(ret) - self._write_arguments(args[1:]) - - def _write_return(self, ret): - if ret != 'void': - self.fp.write(' (return-type "' + ret + '")\n') - else: - self.fp.write(' (return-type "none")\n') - - def _write_arguments(self, args): - is_varargs = 0 - has_args = len(args) > 0 - for arg in args: - if arg == '...': - is_varargs = 1 - elif arg in ('void', 'void '): - has_args = 0 - if has_args: - self.fp.write(' (parameters\n') - for arg in args: - if arg != '...': - tupleArg = tuple(string.split(arg)) - if len(tupleArg) == 2: - self.fp.write(' \'("%s" "%s")\n' % tupleArg) - self.fp.write(' )\n') - if is_varargs: - self.fp.write(' (varargs #t)\n') - self.fp.write(')\n\n') - -# ------------------ Main function ----------------- - -def main(args): - verbose = False - onlyenums = False - onlyobjdefs = False - separate = False - modulename = None - namespace = None - defsfilter = None - opts, args = getopt.getopt(args[1:], 'vs:m:n:f:', - ['onlyenums', 'onlyobjdefs', - 'modulename=', 'namespace=', - 'separate=', 'defsfilter=']) - for o, v in opts: - if o == '-v': - verbose = True - if o == '--onlyenums': - onlyenums = True - if o == '--onlyobjdefs': - onlyobjdefs = True - if o in ('-s', '--separate'): - separate = v - if o in ('-m', '--modulename'): - modulename = v - if o in ('-n', '--namespace'): - namespace = v - if o in ('-f', '--defsfilter'): - defsfilter = v - - if not args[0:1]: - print 'Must specify at least one input file name' - return -1 - - # read all the object definitions in - objdefs = [] - enums = [] - for filename in args: - buf = open(filename).read() - find_obj_defs(buf, objdefs) - find_enum_defs(buf, enums) - objdefs = sort_obj_defs(objdefs) - - if separate: - methods = file(separate + '.defs', 'w') - types = file(separate + '-types.defs', 'w') - - dw = DefsWriter(methods, prefix=modulename, ns=namespace, - verbose=verbose, defsfilter=defsfilter) - dw.write_obj_defs(objdefs, types) - dw.write_enum_defs(enums, types) - print "Wrote %s-types.defs" % separate - - for filename in args: - dw.write_def(filename) - print "Wrote %s.defs" % separate - else: - dw = DefsWriter(prefix=modulename, ns=namespace, - verbose=verbose, defsfilter=defsfilter) - - if onlyenums: - dw.write_enum_defs(enums) - elif onlyobjdefs: - dw.write_obj_defs(objdefs) - else: - dw.write_obj_defs(objdefs) - dw.write_enum_defs(enums) - - for filename in args: - dw.write_def(filename) - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/codegen/mergedefs.py b/codegen/mergedefs.py deleted file mode 100755 index 773e499..0000000 --- a/codegen/mergedefs.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- - -import optparse - -import defsparser - -parser = optparse.OptionParser( - usage="usage: %prog [options] generated-defs old-defs") -parser.add_option("-p", "--merge-parameters", - help="Merge changes in function/methods parameter lists", - action="store_true", dest="parmerge", default=False) -(options, args) = parser.parse_args() - -if len(args) != 2: - parser.error("wrong number of arguments") - -newp = defsparser.DefsParser(args[0]) -oldp = defsparser.DefsParser(args[1]) - -newp.startParsing() -oldp.startParsing() - -newp.merge(oldp, options.parmerge) - -newp.write_defs() diff --git a/codegen/missingdefs.py b/codegen/missingdefs.py deleted file mode 100755 index f0017e7..0000000 --- a/codegen/missingdefs.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- - -import sys -import defsparser - -if len(sys.argv) < 3: - sys.stderr.write("Usage: missingdefs.py generated-defs old-defs\n") - sys.exit(1) - -newp = defsparser.DefsParser(sys.argv[1]) -oldp = defsparser.DefsParser(sys.argv[2]) - -newp.startParsing() -oldp.startParsing() - -newp.printMissing(oldp) diff --git a/codegen/mkskel.py b/codegen/mkskel.py deleted file mode 100755 index 61f520b..0000000 --- a/codegen/mkskel.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- - -import sys, os, getopt - -module_init_template = \ -'/* -*- Mode: C; c-basic-offset: 4 -*- */\n' + \ -'#ifdef HAVE_CONFIG_H\n' + \ -'# include "config.h"\n' + \ -'#endif\n' + \ -'#include \n' + \ -'#include \n' + \ -'\n' + \ -'/* include any extra headers needed here */\n' + \ -'\n' + \ -'void %(prefix)s_register_classes(PyObject *d);\n' + \ -'extern PyMethodDef %(prefix)s_functions[];\n' + \ -'\n' + \ -'DL_EXPORT(void)\n' + \ -'init%(module)s(void)\n' + \ -'{\n' + \ -' PyObject *m, *d;\n' + \ -'\n' + \ -' /* perform any initialisation required by the library here */\n' + \ -'\n' + \ -' m = Py_InitModule("%(module)s", %(prefix)s_functions);\n' + \ -' d = PyModule_GetDict(m);\n' + \ -'\n' + \ -' init_pygtk();\n' + \ -'\n' + \ -' %(prefix)s_register_classes(d);\n' + \ -'\n' + \ -' /* add anything else to the module dictionary (such as constants) */\n' +\ -'\n' + \ -' if (PyErr_Occurred())\n' + \ -' Py_FatalError("could not initialise module %(module)s");\n' + \ -'}\n' - -override_template = \ -'/* -*- Mode: C; c-basic-offset: 4 -*- */\n' + \ -'%%%%\n' + \ -'headers\n' + \ -'/* include any required headers here */\n' + \ -'%%%%\n' + \ -'init\n' + \ -' /* include any code here that needs to be executed before the\n' + \ -' * extension classes get initialised */\n' + \ -'%%%%\n' + \ -'\n' + \ -'/* you should add appropriate ignore, ignore-glob and\n' + \ -' * override sections here */\n' - -def open_with_backup(file): - if os.path.exists(file): - try: - os.rename(file, file+'~') - except OSError: - # fail silently if we can't make a backup - pass - return open(file, 'w') - -def write_skels(fileprefix, prefix, module): - fp = open_with_backup(fileprefix+'module.c') - fp.write(module_init_template % { 'prefix': prefix, 'module': module }) - fp.close() - fp = open_with_backup(fileprefix+'.override') - fp.write(override_template % { 'prefix': prefix, 'module': module }) - fp.close() - -if __name__ == '__main__': - opts, args = getopt.getopt(sys.argv[1:], 'f:p:m:h', - ['file-prefix=', 'prefix=', 'module=', 'help']) - fileprefix = None - prefix = None - module = None - for opt, arg in opts: - if opt in ('-f', '--file-prefix'): - fileprefix = arg - elif opt in ('-p', '--prefix'): - prefix = arg - elif opt in ('-m', '--module'): - module = arg - elif opt in ('-h', '--help'): - print 'usage: mkskel.py -f fileprefix -p prefix -m module' - sys.exit(0) - if not fileprefix or not prefix or not module: - print 'usage: mkskel.py -f fileprefix -p prefix -m module' - sys.exit(1) - write_skels(fileprefix, prefix, module) diff --git a/codegen/override.py b/codegen/override.py deleted file mode 100644 index bba5e42..0000000 --- a/codegen/override.py +++ /dev/null @@ -1,285 +0,0 @@ -# -*- Mode: Python; py-indent-offset: 4 -*- - -# this file contains code for loading up an override file. The override file -# provides implementations of functions where the code generator could not -# do its job correctly. - -import fnmatch -import os -import re -import string -import sys - -def class2cname(klass, method): - c_name = '' - for c in klass: - if c.isupper(): - c_name += '_' + c.lower() - else: - c_name += c - return c_name[1:] + '_' + method - -# import python_type as c_name [for arg_type] -# Last ('for') clause is optional. If present, the type will be -# imported only if given 'arg_type' is registered. -import_pat = re.compile(r'\s*import\s+(\S+)\.([^\s.]+)\s+as\s+(\S+)(\s+for\s+(\S+))?') - -class Overrides: - def __init__(self, filename=None): - self.modulename = None - self.ignores = {} - self.glob_ignores = [] - self.type_ignores = {} - self.overrides = {} - self.overridden = {} - self.kwargs = {} - self.noargs = {} - self.onearg = {} - self.staticmethod = {} - self.classmethod = {} - self.startlines = {} - self.override_attrs = {} - self.override_slots = {} - self.headers = '' - self.body = '' - self.init = '' - self.imports = [] - self.defines = {} - self.functions = {} - self.newstyle_constructors = {} - self.dynamicnamespace = False - if filename: - self.handle_file(filename) - - def handle_file(self, filename): - oldpath = os.getcwd() - - fp = open(filename, 'r') - dirname = os.path.dirname(os.path.abspath(filename)) - - if dirname != oldpath: - os.chdir(dirname) - - # read all the components of the file ... - bufs = [] - startline = 1 - lines = [] - line = fp.readline() - linenum = 1 - while line: - if line == '%%\n' or line == '%%': - if lines: - bufs.append((string.join(lines, ''), startline)) - startline = linenum + 1 - lines = [] - else: - lines.append(line) - line = fp.readline() - linenum = linenum + 1 - if lines: - bufs.append((string.join(lines, ''), startline)) - if not bufs: return - - for buf, startline in bufs: - self.__parse_override(buf, startline, filename) - - os.chdir(oldpath) - - def __parse_override(self, buffer, startline, filename): - pos = string.find(buffer, '\n') - if pos >= 0: - line = buffer[:pos] - rest = buffer[pos+1:] - else: - line = buffer ; rest = '' - words = string.split(line) - command = words[0] - if (command == 'ignore' or - command == 'ignore-' + sys.platform): - "ignore/ignore-platform [functions..]" - for func in words[1:]: - self.ignores[func] = 1 - for func in string.split(rest): - self.ignores[func] = 1 - elif (command == 'ignore-glob' or - command == 'ignore-glob-' + sys.platform): - "ignore-glob/ignore-glob-platform [globs..]" - for func in words[1:]: - self.glob_ignores.append(func) - for func in string.split(rest): - self.glob_ignores.append(func) - elif (command == 'ignore-type' or - command == 'ignore-type-' + sys.platform): - "ignore-type/ignore-type-platform [typenames..]" - for typename in words[1:]: - self.type_ignores[typename] = 1 - for typename in string.split(rest): - self.type_ignores[typename] = 1 - elif command == 'override': - "override function/method [kwargs|noargs|onearg] [staticmethod|classmethod]" - func = words[1] - if 'kwargs' in words[1:]: - self.kwargs[func] = 1 - elif 'noargs' in words[1:]: - self.noargs[func] = 1 - elif 'onearg' in words[1:]: - self.onearg[func] = True - - if 'staticmethod' in words[1:]: - self.staticmethod[func] = True - elif 'classmethod' in words[1:]: - self.classmethod[func] = True - if func in self.overrides: - raise RuntimeError("Function %s is being overridden more than once" % (func,)) - self.overrides[func] = rest - self.startlines[func] = (startline + 1, filename) - elif command == 'override-attr': - "override-slot Class.attr" - attr = words[1] - self.override_attrs[attr] = rest - self.startlines[attr] = (startline + 1, filename) - elif command == 'override-slot': - "override-slot Class.slot" - slot = words[1] - self.override_slots[slot] = rest - self.startlines[slot] = (startline + 1, filename) - elif command == 'headers': - "headers" - self.headers = '%s\n#line %d "%s"\n%s' % \ - (self.headers, startline + 1, filename, rest) - elif command == 'body': - "body" - self.body = '%s\n#line %d "%s"\n%s' % \ - (self.body, startline + 1, filename, rest) - elif command == 'init': - "init" - self.init = '%s\n#line %d "%s"\n%s' % \ - (self.init, startline + 1, filename, rest) - elif command == 'modulename': - "modulename name" - self.modulename = words[1] - elif command == 'include': - "include filename" - for filename in words[1:]: - self.handle_file(filename) - for filename in string.split(rest): - self.handle_file(filename) - elif command == 'import': - "import module1 [\n module2, \n module3 ...]" - for line in string.split(buffer, '\n'): - match = import_pat.match(line) - if match: - module, pyname, cname, conditional, importing_for = match.groups() - self.imports.append((module, pyname, cname, importing_for or None)) - elif command == 'define': - "define funcname [kwargs|noargs|onearg] [classmethod|staticmethod]" - "define Class.method [kwargs|noargs|onearg] [classmethod|staticmethod]" - func = words[1] - klass = None - if func.find('.') != -1: - klass, func = func.split('.', 1) - - if not self.defines.has_key(klass): - self.defines[klass] = {} - self.defines[klass][func] = rest - else: - self.functions[func] = rest - - if 'kwargs' in words[1:]: - self.kwargs[func] = 1 - elif 'noargs' in words[1:]: - self.noargs[func] = 1 - elif 'onearg' in words[1:]: - self.onearg[func] = 1 - - if 'staticmethod' in words[1:]: - self.staticmethod[func] = True - elif 'classmethod' in words[1:]: - self.classmethod[func] = True - - self.startlines[func] = (startline + 1, filename) - - elif command == 'new-constructor': - "new-constructor GType" - gtype, = words[1:] - self.newstyle_constructors[gtype] = True - elif command == 'options': - for option in words[1:]: - if option == 'dynamicnamespace': - self.dynamicnamespace = True - - def is_ignored(self, name): - if self.ignores.has_key(name): - return 1 - for glob in self.glob_ignores: - if fnmatch.fnmatchcase(name, glob): - return 1 - return 0 - - def is_type_ignored(self, name): - return name in self.type_ignores - - def is_overriden(self, name): - return self.overrides.has_key(name) - - def is_already_included(self, name): - return self.overridden.has_key(name) - - def override(self, name): - self.overridden[name] = 1 - return self.overrides[name] - - def define(self, klass, name): - self.overridden[class2cname(klass, name)] = 1 - return self.defines[klass][name] - - def function(self, name): - return self.functions[name] - - def getstartline(self, name): - return self.startlines[name] - - def wants_kwargs(self, name): - return self.kwargs.has_key(name) - - def wants_noargs(self, name): - return self.noargs.has_key(name) - - def wants_onearg(self, name): - return self.onearg.has_key(name) - - def is_staticmethod(self, name): - return self.staticmethod.has_key(name) - - def is_classmethod(self, name): - return self.classmethod.has_key(name) - - def attr_is_overriden(self, attr): - return self.override_attrs.has_key(attr) - - def attr_override(self, attr): - return self.override_attrs[attr] - - def slot_is_overriden(self, slot): - return self.override_slots.has_key(slot) - - def slot_override(self, slot): - return self.override_slots[slot] - - def get_headers(self): - return self.headers - - def get_body(self): - return self.body - - def get_init(self): - return self.init - - def get_imports(self): - return self.imports - - def get_defines_for(self, klass): - return self.defines.get(klass, {}) - - def get_functions(self): - return self.functions diff --git a/codegen/pygobject-codegen-2.0.in b/codegen/pygobject-codegen-2.0.in deleted file mode 100644 index c5c912e..0000000 --- a/codegen/pygobject-codegen-2.0.in +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -prefix=@prefix@ -datarootdir=@datarootdir@ -datadir=@datadir@ -codegendir=${datadir}/pygobject/2.0/codegen - -PYTHONPATH=$codegendir -export PYTHONPATH - -exec @PYTHON@ $codegendir/codegen.py "$@" diff --git a/codegen/reversewrapper.py b/codegen/reversewrapper.py deleted file mode 100644 index b96e12e..0000000 --- a/codegen/reversewrapper.py +++ /dev/null @@ -1,912 +0,0 @@ -### -*- python -*- -### Code to generate "Reverse Wrappers", i.e. C->Python wrappers -### (C) 2004 Gustavo Carneiro -import argtypes -import os - -DEBUG_MODE = ('PYGTK_CODEGEN_DEBUG' in os.environ) - -def join_ctype_name(ctype, name): - '''Joins a C type and a variable name into a single string''' - if ctype[-1] != '*': - return " ".join((ctype, name)) - else: - return "".join((ctype, name)) - - -class CodeSink(object): - def __init__(self): - self.indent_level = 0 # current indent level - self.indent_stack = [] # previous indent levels - - def _format_code(self, code): - assert isinstance(code, str) - l = [] - for line in code.split('\n'): - l.append(' '*self.indent_level + line) - if l[-1]: - l.append('') - return '\n'.join(l) - - def writeln(self, line=''): - raise NotImplementedError - - def indent(self, level=4): - '''Add a certain ammount of indentation to all lines written - from now on and until unindent() is called''' - self.indent_stack.append(self.indent_level) - self.indent_level += level - - def unindent(self): - '''Revert indentation level to the value before last indent() call''' - self.indent_level = self.indent_stack.pop() - - -class FileCodeSink(CodeSink): - def __init__(self, fp): - CodeSink.__init__(self) - assert isinstance(fp, file) - self.fp = fp - - def writeln(self, line=''): - self.fp.write(self._format_code(line)) - -class MemoryCodeSink(CodeSink): - def __init__(self): - CodeSink.__init__(self) - self.lines = [] - - def writeln(self, line=''): - self.lines.append(self._format_code(line)) - - def flush_to(self, sink): - assert isinstance(sink, CodeSink) - for line in self.lines: - sink.writeln(line.rstrip()) - self.lines = [] - - def flush(self): - l = [] - for line in self.lines: - l.append(self._format_code(line)) - self.lines = [] - return "".join(l) - -class ReverseWrapper(object): - '''Object that generates a C->Python wrapper''' - def __init__(self, cname, is_static=True): - assert isinstance(cname, str) - - self.cname = cname - ## function object we will call, or object whose method we will call - self.called_pyobj = None - ## name of method of self.called_pyobj we will call - self.method_name = None - self.is_static = is_static - - self.parameters = [] - self.declarations = MemoryCodeSink() - self.post_return_code = MemoryCodeSink() - self.body = MemoryCodeSink() - self.check_exception_code = MemoryCodeSink() - self.cleanup_actions = [] - self.pyargv_items = [] - self.pyargv_optional_items = [] - self.pyret_parse_items = [] # list of (format_spec, parameter) - self.code_sinks_stack = [self.body] - - def set_call_target(self, called_pyobj, method_name=None): - assert called_pyobj is not None - assert self.called_pyobj is None - self.called_pyobj = called_pyobj - self.method_name = method_name - - def set_return_type(self, return_type): - assert isinstance(return_type, ReturnType) - self.return_type = return_type - - def add_parameter(self, param): - assert isinstance(param, Parameter) - self.parameters.append(param) - - def add_declaration(self, decl_code): - self.declarations.writeln(decl_code) - - def add_pyargv_item(self, variable, optional=False): - if optional: - self.pyargv_optional_items.append(variable) - else: - self.pyargv_items.append(variable) - - def add_pyret_parse_item(self, format_specifier, parameter, prepend=False): - if prepend: - self.pyret_parse_items.insert(0, (format_specifier, parameter)) - else: - self.pyret_parse_items.append((format_specifier, parameter)) - - - def push_code_sink(self, code_sink): - self.code_sinks_stack.insert(0, code_sink) - - def pop_code_sink(self): - return self.code_sinks_stack.pop(0) - - - def write_code(self, code, - cleanup=None, - failure_expression=None, - failure_cleanup=None, - failure_exception=None, - code_sink=None): - '''Add a chunk of code with cleanup and error handling - - This method is to be used by TypeHandlers when generating code - - Keywork arguments: - code -- code to add - cleanup -- code to cleanup any dynamic resources created by @code - (except in case of failure) (default None) - failure_expression -- C boolean expression to indicate - if anything failed (default None) - failure_cleanup -- code to cleanup any dynamic resources - created by @code in case of failure (default None) - failure_exception -- code to raise an exception in case of - failure (which will be immediately - printed and cleared), (default None) - code_sink -- "code sink" to use; by default, - ReverseWrapper.body is used, which writes the - main body of the wrapper, before calling the - python method. Alternatively, - ReverseWrapper.after_pyret_parse can be used, to - write code after the PyArg_ParseTuple that - parses the python method return value. - ''' - if code_sink is None: - code_sink = self.code_sinks_stack[0] - if code is not None: - code_sink.writeln(code) - if failure_expression is not None: - code_sink.writeln("if (%s) {" % (failure_expression,)) - code_sink.indent() - if failure_exception is None: - code_sink.writeln("if (PyErr_Occurred())") - code_sink.indent() - code_sink.writeln("PyErr_Print();") - code_sink.unindent() - else: - code_sink.writeln(failure_exception) - code_sink.writeln("PyErr_Print();") - if failure_cleanup is not None: - code_sink.writeln(failure_cleanup) - for cleanup_action in self.cleanup_actions: - code_sink.writeln(cleanup_action) - - self.push_code_sink(code_sink) - try: - self.return_type.write_error_return() - finally: - self.pop_code_sink() - - code_sink.unindent() - code_sink.writeln("}") - if cleanup is not None: - self.cleanup_actions.insert(0, cleanup) - - def generate(self, sink): - '''Generate the code into a CodeSink object''' - assert isinstance(sink, CodeSink) - - if DEBUG_MODE: - self.declarations.writeln("/* begin declarations */") - self.body.writeln("/* begin main body */") - self.post_return_code.writeln("/* begin post-return code */") - - self.add_declaration("PyGILState_STATE __py_state;") - self.write_code(code="__py_state = pyg_gil_state_ensure();", - cleanup="pyg_gil_state_release(__py_state);") - - for param in self.parameters: - param.convert_c2py() - - assert self.called_pyobj is not None,\ - "Parameters failed to provide a target function or method." - - if self.is_static: - sink.writeln('static %s' % self.return_type.get_c_type()) - else: - sink.writeln(self.return_type.get_c_type()) - c_proto_params = map(Parameter.format_for_c_proto, self.parameters) - sink.writeln("%s(%s)\n{" % (self.cname, ", ".join(c_proto_params))) - - self.return_type.write_decl() - self.add_declaration("PyObject *py_retval;") - - ## Handle number of arguments - if self.pyargv_items: - self.add_declaration("PyObject *py_args;") - py_args = "py_args" - if self.pyargv_optional_items: - self.add_declaration("int argc = %i;" % len(self.pyargv_items)) - argc = "argc" - for arg in self.pyargv_optional_items: - self.body.writeln("if (%s)" % arg) - self.body.indent() - self.body.writeln("++argc;") - self.body.unindent() - else: - argc = str(len(self.pyargv_items)) - else: - if self.pyargv_optional_items: - self.add_declaration("PyObject *py_args;") - py_args = "py_args" - self.add_declaration("int argc = 0;") - argc = "argc" - for arg in self.pyargv_optional_items: - self.body.writeln("if (%s)" % arg) - self.body.indent() - self.body.writeln("++argc;") - self.body.unindent() - else: - py_args = "NULL" - argc = None - - self.body.writeln() - - if py_args != "NULL": - self.write_code("py_args = PyTuple_New(%s);" % argc, - cleanup="Py_DECREF(py_args);") - pos = 0 - for arg in self.pyargv_items: - try: # try to remove the Py_DECREF cleanup action, if we can - self.cleanup_actions.remove("Py_DECREF(%s);" % arg) - except ValueError: # otherwise we have to Py_INCREF.. - self.body.writeln("Py_INCREF(%s);" % arg) - self.body.writeln("PyTuple_SET_ITEM(%s, %i, %s);" % (py_args, pos, arg)) - pos += 1 - for arg in self.pyargv_optional_items: - self.body.writeln("if (%s) {" % arg) - self.body.indent() - try: # try to remove the Py_DECREF cleanup action, if we can - self.cleanup_actions.remove("Py_XDECREF(%s);" % arg) - except ValueError: # otherwise we have to Py_INCREF.. - self.body.writeln("Py_INCREF(%s);" % arg) - self.body.writeln("PyTuple_SET_ITEM(%s, %i, %s);" % (py_args, pos, arg)) - self.body.unindent() - self.body.writeln("}") - pos += 1 - - self.body.writeln() - - ## Call the python method - if self.method_name is None: - self.write_code("py_retval = PyObject_Call(%s, %s);" - % (self.called_pyobj, py_args), - cleanup="Py_XDECREF(py_retval);") - self.check_exception_code.flush_to(self.body) - self.write_code(None, failure_expression="!py_retval") - - else: - self.add_declaration("PyObject *py_method;") - self.write_code("py_method = PyObject_GetAttrString(%s, \"%s\");" - % (self.called_pyobj, self.method_name), - cleanup="Py_DECREF(py_method);", - failure_expression="!py_method") - self.write_code("py_retval = PyObject_CallObject(py_method, %s);" - % (py_args,), - cleanup="Py_XDECREF(py_retval);") - self.check_exception_code.flush_to(self.body) - self.write_code(None, failure_expression="!py_retval") - - ## -- Handle the return value -- - - ## we need to check if the return_type object is prepared to cooperate with multiple return values - len_before = len(self.pyret_parse_items) - self.return_type.write_conversion() - len_after = len(self.pyret_parse_items) - assert (self.return_type.get_c_type() == 'void' - or not (len_before == len_after and len_after > 0)),\ - ("Bug in reverse wrappers: return type handler %s" - " is not prepared to cooperate multiple return values") % (type(self.return_type),) - - sink.indent() - - if self.pyret_parse_items == [("", "")]: - ## special case when there are no return parameters - self.write_code( - code=None, - failure_expression='py_retval != Py_None', - failure_exception=('PyErr_SetString(PyExc_TypeError, ' - '"virtual method should return None");')) - else: - if len(self.pyret_parse_items) == 1: - ## if retval is one item only, pack it in a tuple so we - ## can use PyArg_ParseTuple as usual.. - self.write_code('py_retval = Py_BuildValue("(N)", py_retval);') - if len(self.pyret_parse_items) > 0: - ## Parse return values using PyArg_ParseTuple - params = ["py_retval", - '"%s"' % "".join([format for format, param in self.pyret_parse_items])] - params.extend([param for format, param in self.pyret_parse_items if param]) - self.write_code(code=None, failure_expression=( - '!PyArg_ParseTuple(%s)' % (', '.join(params),))) - - if DEBUG_MODE: - self.declarations.writeln("/* end declarations */") - self.declarations.flush_to(sink) - sink.writeln() - if DEBUG_MODE: - self.body.writeln("/* end main body */") - self.body.flush_to(sink) - sink.writeln() - if DEBUG_MODE: - self.post_return_code.writeln("/* end post-return code */") - self.post_return_code.flush_to(sink) - sink.writeln() - - for cleanup_action in self.cleanup_actions: - sink.writeln(cleanup_action) - if self.return_type.get_c_type() != 'void': - sink.writeln() - sink.writeln("return retval;") - sink.unindent() - sink.writeln("}") - -class TypeHandler(object): - def __init__(self, wrapper, **props): - assert isinstance(wrapper, ReverseWrapper) - self.wrapper = wrapper - self.props = props - -class ReturnType(TypeHandler): - - supports_optional = False - - def get_c_type(self): - raise NotImplementedError - - def write_decl(self): - raise NotImplementedError - - def write_error_return(self): - '''Write "return " code in case of error''' - raise NotImplementedError - - def write_conversion(self): - '''Writes code to convert Python return value in 'py_retval' - into C 'retval'. Returns a string with C boolean expression - that determines if anything went wrong. ''' - raise NotImplementedError - -class Parameter(TypeHandler): - - def __init__(self, wrapper, name, **props): - TypeHandler.__init__(self, wrapper, **props) - self.name = name - - def get_c_type(self): - raise NotImplementedError - - def convert_c2py(self): - '''Write some code before calling the Python method.''' - pass - - def format_for_c_proto(self): - return join_ctype_name(self.get_c_type(), self.name) - - -###--- -class StringParam(Parameter): - - def get_c_type(self): - return self.props.get('c_type', 'char *').replace('const-', 'const ') - - def convert_c2py(self): - if self.props.get('optional', False): - self.wrapper.add_declaration("PyObject *py_%s = NULL;" % self.name) - self.wrapper.write_code(code=("if (%s)\n" - " py_%s = PyString_FromString(%s);\n" - % (self.name, self.name, self.name)), - cleanup=("Py_XDECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name, optional=True) - elif self.props.get('nullok', False): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("if (%s)\n" - " py_%s = PyString_FromString(%s);\n" - "else {\n" - " Py_INCREF(Py_None);\n" - " py_%s = Py_None;\n" - "}\n" - % (self.name, self.name, self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - else: - self.wrapper.add_declaration("PyObject *py_%s = NULL;" % self.name) - self.wrapper.write_code(code=("if (%s)\n" - " py_%s = PyString_FromString(%s);\n" % - (self.name, self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name), - failure_expression=("!py_%s" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -for ctype in ('char*', 'gchar*', 'const-char*', 'char-const*', 'const-gchar*', - 'gchar-const*', 'string', 'static_string'): - argtypes.matcher.register_reverse(ctype, StringParam) -del ctype - -class StringReturn(ReturnType): - - def get_c_type(self): - return self.props.get('c_type', 'char *').replace('const-', 'const ') - #return "char *" - - def write_decl(self): - self.wrapper.add_declaration("%s retval;" % self.get_c_type()) - #self.wrapper.add_declaration("char *retval;") - - def write_error_return(self): - self.wrapper.write_code("return NULL;") - - def write_conversion(self): - self.wrapper.add_pyret_parse_item("s", "&retval", prepend=True) - self.wrapper.write_code("retval = g_strdup(retval);", code_sink=self.wrapper.post_return_code) - -for ctype in ('char*', 'gchar*', 'const-gchar*'): - argtypes.matcher.register_reverse_ret(ctype, StringReturn) -del ctype - - -class VoidReturn(ReturnType): - - def get_c_type(self): - return "void" - - def write_decl(self): - pass - - def write_error_return(self): - self.wrapper.write_code("return;") - - def write_conversion(self): - self.wrapper.add_pyret_parse_item("", "", prepend=True) - -argtypes.matcher.register_reverse_ret('void', VoidReturn) -argtypes.matcher.register_reverse_ret('none', VoidReturn) - -class GObjectParam(Parameter): - - def get_c_type(self): - return self.props.get('c_type', 'GObject *') - - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s = NULL;" % self.name) - self.wrapper.write_code(code=("if (%s)\n" - " py_%s = pygobject_new((GObject *) %s);\n" - "else {\n" - " Py_INCREF(Py_None);\n" - " py_%s = Py_None;\n" - "}" - % (self.name, self.name, self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse('GObject*', GObjectParam) - -class GObjectReturn(ReturnType): - - supports_optional = True - - def get_c_type(self): - return self.props.get('c_type', 'GObject *') - - def write_decl(self): - if not self.props.get('optional'): - self.wrapper.add_declaration("%s retval;" % self.get_c_type()) - else: - self.wrapper.add_declaration("%s retval = NULL;" % self.get_c_type()) - - def write_error_return(self): - self.wrapper.write_code("return NULL;") - - def write_conversion(self): - if not self.props.get('optional'): - self.wrapper.write_code( - code=None, - failure_expression="!PyObject_TypeCheck(py_retval, &PyGObject_Type)", - failure_exception='PyErr_SetString(PyExc_TypeError, "retval should be a GObject");') - self.wrapper.write_code("retval = (%s) pygobject_get(py_retval);" - % self.get_c_type()) - self.wrapper.write_code("g_object_ref((GObject *) retval);") - else: - self.wrapper.write_code( - code=None, - failure_expression="py_retval != Py_None && !PyObject_TypeCheck(py_retval, &PyGObject_Type)", - failure_exception='PyErr_SetString(PyExc_TypeError, "retval should be None or a GObject");') - self.wrapper.write_code("if (py_retval != Py_None) {\n" - " retval = (%s) pygobject_get(py_retval);\n" - " g_object_ref((GObject *) retval);\n" - "}\n" - % self.get_c_type()) - -argtypes.matcher.register_reverse_ret('GObject*', GObjectReturn) - - - -class IntParam(Parameter): - - def get_c_type(self): - return self.props.get('c_type', 'int') - - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("py_%s = PyInt_FromLong(%s);" % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -class IntReturn(ReturnType): - def get_c_type(self): - return self.props.get('c_type', 'int') - def write_decl(self): - self.wrapper.add_declaration("%s retval;" % self.get_c_type()) - def write_error_return(self): - self.wrapper.write_code("return -G_MAXINT;") - def write_conversion(self): - self.wrapper.add_pyret_parse_item("i", "&retval", prepend=True) - -for argtype in ('int', 'gint', 'guint', 'short', 'gshort', 'gushort', 'long', - 'glong', 'gsize', 'gssize', 'guint8', 'gint8', 'guint16', - 'gint16', 'gint32', 'GTime'): - argtypes.matcher.register_reverse(argtype, IntParam) - argtypes.matcher.register_reverse_ret(argtype, IntReturn) -del argtype - -class IntPtrParam(Parameter): - def __init__(self, wrapper, name, **props): - if "direction" not in props: - raise argtypes.ArgTypeConfigurationError( - "cannot use int* parameter without direction") - if props["direction"] not in ("out", "inout"): - raise argtypes.ArgTypeConfigurationError( - "cannot use int* parameter with direction '%s'" - % (props["direction"],)) - Parameter.__init__(self, wrapper, name, **props) - def get_c_type(self): - return self.props.get('c_type', 'int*') - def convert_c2py(self): - if self.props["direction"] == "inout": - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("py_%s = PyInt_FromLong(*%s);" % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - self.wrapper.add_pyret_parse_item("i", self.name) -for argtype in ('int*', 'gint*'): - argtypes.matcher.register_reverse(argtype, IntPtrParam) -del argtype - - -class GEnumReturn(IntReturn): - def write_conversion(self): - self.wrapper.write_code( - code=None, - failure_expression=( - "pyg_enum_get_value(%s, py_retval, (gint *)&retval)" - % (self.props['typecode'],))) - -argtypes.matcher.register_reverse_ret("GEnum", GEnumReturn) - -class GEnumParam(IntParam): - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("py_%s = pyg_enum_from_gtype(%s, %s);" % - (self.name, self.props['typecode'], self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name), - failure_expression=("!py_%s" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("GEnum", GEnumParam) - -class GFlagsReturn(IntReturn): - def write_conversion(self): - self.wrapper.write_code( - code=None, - failure_expression=( - "pyg_flags_get_value(%s, py_retval, (gint *)&retval)" % - self.props['typecode'])) - -argtypes.matcher.register_reverse_ret("GFlags", GFlagsReturn) - -class GFlagsParam(IntParam): - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=( - "py_%s = pyg_flags_from_gtype(%s, %s);" % - (self.name, self.props['typecode'], self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name), - failure_expression=("!py_%s" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("GFlags", GFlagsParam) - - -class GtkTreePathParam(IntParam): - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=( - "py_%s = pygtk_tree_path_to_pyobject(%s);" % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name), - failure_expression=("!py_%s" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("GtkTreePath*", GtkTreePathParam) - - -class GtkTreePathReturn(ReturnType): - def get_c_type(self): - return self.props.get('c_type', 'GtkTreePath *') - def write_decl(self): - self.wrapper.add_declaration("GtkTreePath * retval;") - def write_error_return(self): - self.wrapper.write_code("return NULL;") - def write_conversion(self): - self.wrapper.write_code( - "retval = pygtk_tree_path_from_pyobject(py_retval);\n", - failure_expression=('!retval'), - failure_exception=( - 'PyErr_SetString(PyExc_TypeError, "retval should be a GtkTreePath");')) - -argtypes.matcher.register_reverse_ret("GtkTreePath*", GtkTreePathReturn) - - -class BooleanReturn(ReturnType): - def get_c_type(self): - return "gboolean" - def write_decl(self): - self.wrapper.add_declaration("gboolean retval;") - self.wrapper.add_declaration("PyObject *py_main_retval;") - def write_error_return(self): - self.wrapper.write_code("return FALSE;") - def write_conversion(self): - self.wrapper.add_pyret_parse_item("O", "&py_main_retval", prepend=True) - self.wrapper.write_code( - "retval = PyObject_IsTrue(py_main_retval)? TRUE : FALSE;", - code_sink=self.wrapper.post_return_code) -argtypes.matcher.register_reverse_ret("gboolean", BooleanReturn) - -class BooleanParam(Parameter): - def get_c_type(self): - return "gboolean" - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code("py_%s = %s? Py_True : Py_False;" - % (self.name, self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("gboolean", BooleanParam) - - -class DoubleParam(Parameter): - def get_c_type(self): - return self.props.get('c_type', 'gdouble') - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("py_%s = PyFloat_FromDouble(%s);" % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -class DoublePtrParam(Parameter): - def __init__(self, wrapper, name, **props): - if "direction" not in props: - raise argtypes.ArgTypeConfigurationError( - "cannot use double* parameter without direction") - if props["direction"] not in ("out", ): # inout not yet implemented - raise argtypes.ArgTypeConfigurationError( - "cannot use double* parameter with direction '%s'" - % (props["direction"],)) - Parameter.__init__(self, wrapper, name, **props) - def get_c_type(self): - return self.props.get('c_type', 'double*') - def convert_c2py(self): - self.wrapper.add_pyret_parse_item("d", self.name) -for argtype in ('double*', 'gdouble*'): - argtypes.matcher.register_reverse(argtype, DoublePtrParam) -del argtype - -class DoubleReturn(ReturnType): - def get_c_type(self): - return self.props.get('c_type', 'gdouble') - def write_decl(self): - self.wrapper.add_declaration("%s retval;" % self.get_c_type()) - def write_error_return(self): - self.wrapper.write_code("return -G_MAXFLOAT;") - def write_conversion(self): - self.wrapper.add_pyret_parse_item("d", "&retval", prepend=True) - -for argtype in ('float', 'double', 'gfloat', 'gdouble'): - argtypes.matcher.register_reverse(argtype, DoubleParam) - argtypes.matcher.register_reverse_ret(argtype, DoubleReturn) - - -class GBoxedParam(Parameter): - def get_c_type(self): - return self.props.get('c_type').replace('const-', 'const ') - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - ctype = self.get_c_type() - if ctype.startswith('const '): - ctype_no_const = ctype[len('const '):] - self.wrapper.write_code( - code=('py_%s = pyg_boxed_new(%s, (%s) %s, TRUE, TRUE);' % - (self.name, self.props['typecode'], - ctype_no_const, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - else: - self.wrapper.write_code( - code=('py_%s = pyg_boxed_new(%s, %s, FALSE, FALSE);' % - (self.name, self.props['typecode'], self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("GBoxed", GBoxedParam) - - -class GBoxedReturn(ReturnType): - def get_c_type(self): - return self.props.get('c_type') - def write_decl(self): - self.wrapper.add_declaration("%s retval;" % self.get_c_type()) - def write_error_return(self): - self.wrapper.write_code("return retval;") - def write_conversion(self): - self.wrapper.write_code(code = None, - failure_expression=("!pyg_boxed_check(py_retval, %s)" % - (self.props['typecode'],)), - failure_exception=( - 'PyErr_SetString(PyExc_TypeError, "retval should be a %s");' - % (self.props['typename'],))) - self.wrapper.write_code('retval = pyg_boxed_get(py_retval, %s);' % - self.props['typename']) - -argtypes.matcher.register_reverse_ret("GBoxed", GBoxedReturn) - - -class GdkRegionPtrReturn(GBoxedReturn): - def write_error_return(self): - self.wrapper.write_code("return gdk_region_new();") - def write_conversion(self): - self.props['typecode'] = 'PYGDK_TYPE_REGION' - self.props['typename'] = 'GdkRegion' - super(GdkRegionPtrReturn, self).write_conversion() - -argtypes.matcher.register_reverse_ret("GdkRegion*", GdkRegionPtrReturn) - - -class PangoFontDescriptionReturn(GBoxedReturn): - def write_error_return(self): - self.wrapper.write_code("return pango_font_description_new();") - def write_conversion(self): - self.props['typecode'] = 'PANGO_TYPE_FONT_DESCRIPTION' - self.props['typename'] = 'PangoFontDescription' - super(PangoFontDescriptionReturn, self).write_conversion() - -argtypes.matcher.register_reverse_ret("PangoFontDescription*", - PangoFontDescriptionReturn) - - -class PangoFontMetricsReturn(GBoxedReturn): - def write_error_return(self): - self.wrapper.write_code("return pango_font_metrics_new();") - def write_conversion(self): - self.props['typecode'] = 'PANGO_TYPE_FONT_METRICS' - self.props['typename'] = 'PangoFontMetrics' - super(PangoFontMetricsReturn, self).write_conversion() - -argtypes.matcher.register_reverse_ret("PangoFontMetrics*", - PangoFontMetricsReturn) - - -class PangoLanguageReturn(GBoxedReturn): - def write_error_return(self): - self.wrapper.write_code("return pango_language_from_string(\"\");") - def write_conversion(self): - self.props['typecode'] = 'PANGO_TYPE_LANGUAGE' - self.props['typename'] = 'PangoLanguage' - super(PangoLanguageReturn, self).write_conversion() - -argtypes.matcher.register_reverse_ret("PangoLanguage*", PangoLanguageReturn) - - -class GdkRectanglePtrParam(Parameter): - def get_c_type(self): - return self.props.get('c_type').replace('const-', 'const ') - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code( - code=('py_%s = pyg_boxed_new(GDK_TYPE_RECTANGLE, %s, TRUE, TRUE);' % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name)) - self.wrapper.add_pyargv_item("py_%s" % self.name) - -argtypes.matcher.register_reverse("GdkRectangle*", GdkRectanglePtrParam) -argtypes.matcher.register_reverse('GtkAllocation*', GdkRectanglePtrParam) - - -class GErrorParam(Parameter): - def get_c_type(self): - return self.props.get('c_type').replace('**', ' **') - def convert_c2py(self): - self.wrapper.write_code(code=None, - failure_expression=("pyg_gerror_exception_check(%s)" % self.name), - code_sink=self.wrapper.check_exception_code) - -argtypes.matcher.register_reverse('GError**', GErrorParam) - - -class PyGObjectMethodParam(Parameter): - def __init__(self, wrapper, name, method_name, **props): - Parameter.__init__(self, wrapper, name, **props) - self.method_name = method_name - - def get_c_type(self): - return self.props.get('c_type', 'GObject *') - - def convert_c2py(self): - self.wrapper.add_declaration("PyObject *py_%s;" % self.name) - self.wrapper.write_code(code=("py_%s = pygobject_new((GObject *) %s);" % - (self.name, self.name)), - cleanup=("Py_DECREF(py_%s);" % self.name), - failure_expression=("!py_%s" % self.name)) - self.wrapper.set_call_target("py_%s" % self.name, self.method_name) - - -class CallbackInUserDataParam(Parameter): - def __init__(self, wrapper, name, free_it, **props): - Parameter.__init__(self, wrapper, name, **props) - self.free_it = free_it - - def get_c_type(self): - return "gpointer" - - def convert_c2py(self): - self.wrapper.add_declaration("PyObject **_user_data;") - cleanup = self.free_it and ("g_free(%s);" % self.name) or None - self.wrapper.write_code(code=("_real_user_data = (PyObject **) %s;" - % self.name), - cleanup=cleanup) - - self.wrapper.add_declaration("PyObject *py_func;") - cleanup = self.free_it and "Py_DECREF(py_func);" or None - self.wrapper.write_code(code="py_func = _user_data[0];", - cleanup=cleanup) - self.wrapper.set_call_target("py_func") - - self.wrapper.add_declaration("PyObject *py_user_data;") - cleanup = self.free_it and "Py_XDECREF(py_user_data);" or None - self.wrapper.write_code(code="py_user_data = _user_data[1];", - cleanup=cleanup) - self.wrapper.add_pyargv_item("py_user_data", optional=True) - -def _test(): - import sys - - if 1: - wrapper = ReverseWrapper("this_is_the_c_function_name", is_static=True) - wrapper.set_return_type(StringReturn(wrapper)) - wrapper.add_parameter(PyGObjectMethodParam(wrapper, "self", method_name="do_xxx")) - wrapper.add_parameter(StringParam(wrapper, "param2", optional=True)) - wrapper.add_parameter(GObjectParam(wrapper, "param3")) - #wrapper.add_parameter(InoutIntParam(wrapper, "param4")) - wrapper.generate(FileCodeSink(sys.stderr)) - - if 0: - wrapper = ReverseWrapper("this_a_callback_wrapper") - wrapper.set_return_type(VoidReturn(wrapper)) - wrapper.add_parameter(StringParam(wrapper, "param1", optional=False)) - wrapper.add_parameter(GObjectParam(wrapper, "param2")) - wrapper.add_parameter(CallbackInUserDataParam(wrapper, "data", free_it=True)) - wrapper.generate(FileCodeSink(sys.stderr)) - -if __name__ == '__main__': - _test() diff --git a/codegen/scanvirtuals.py b/codegen/scanvirtuals.py deleted file mode 100755 index c108737..0000000 --- a/codegen/scanvirtuals.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -import re -import sys - - -def main(): - rx = re.compile(r'^\s*([\w\s\*]+)\(\s*\*\s*(\w+)\s*\)\s*\(([^()]*)\);', - re.DOTALL|re.MULTILINE) - for f in sys.argv[1:]: - #print ";; From", f - buf = file(f).read() - for m in rx.findall(buf): - return_type = m[0].strip() - if 'typedef' in return_type: - continue - if return_type == 'void': - return_type = 'none' - return_type = return_type.replace(' ', '') - virtual_name = m[1] - if 'reserved' in virtual_name: - continue - params = [] - if not m[2]: - print >> sys.stderr, repr(m) - continue - for param in map(str.strip, m[2].split(',')): - if '*' in param: - tokens = param.split('*') - ptype = tokens[0].strip() + '*'*(len(tokens) - 1) - pname = tokens[-1].strip() - else: - if param == 'void': - continue - ptype, pname = map(str.strip, param.split()) - ptype = ptype.replace('const ', 'const-') - while '[]' in pname: - pname = pname.replace('[]', '') - ptype += '[]' - params.append((ptype, pname)) - if not params: - continue - objname = params[0][0].replace('*', '') - print '(define-virtual', virtual_name - print ' (of-object "%s")' % objname - print ' (return-type "%s")' % return_type - if len(params) > 1: - print ' (parameters' - for param in params[1:]: - print ' \'("%s" "%s")' % param - print ' )' - print ')' - -if __name__ == '__main__': - main() diff --git a/codegen/scmexpr.py b/codegen/scmexpr.py deleted file mode 100755 index 02f2e4b..0000000 --- a/codegen/scmexpr.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- -from __future__ import generators - -import string -from cStringIO import StringIO - -class error(Exception): - def __init__(self, filename, lineno, msg): - Exception.__init__(self, msg) - self.filename = filename - self.lineno = lineno - self.msg = msg - def __str__(self): - return '%s:%d: error: %s' % (self.filename, self.lineno, self.msg) - -trans = [' '] * 256 -for i in range(256): - if chr(i) in string.letters + string.digits + '_': - trans[i] = chr(i) - else: - trans[i] = '_' -trans = string.join(trans, '') - -def parse(filename): - if isinstance(filename, str): - fp = open(filename, 'r') - else: # if not string, assume it is some kind of iterator - fp = filename - filename = getattr(fp, 'name', '') - whitespace = ' \t\n\r\x0b\x0c' - nonsymbol = whitespace + '();\'"' - stack = [] - openlines = [] - lineno = 0 - for line in fp: - pos = 0 - lineno += 1 - while pos < len(line): - if line[pos] in whitespace: # ignore whitespace - pass - elif line[pos] == ';': # comment - break - elif line[pos:pos+2] == "'(": - pass # the open parenthesis will be handled next iteration - elif line[pos] == '(': - stack.append(()) - openlines.append(lineno) - elif line[pos] == ')': - if len(stack) == 0: - raise error(filename, lineno, 'close parenthesis found when none open') - closed = stack[-1] - del stack[-1] - del openlines[-1] - if stack: - stack[-1] += (closed,) - else: - yield closed - elif line[pos] == '"': # quoted string - if not stack: - raise error(filename, lineno, - 'string found outside of s-expression') - endpos = pos + 1 - chars = [] - while endpos < len(line): - if endpos+1 < len(line) and line[endpos] == '\\': - endpos += 1 - if line[endpos] == 'n': - chars.append('\n') - elif line[endpos] == 'r': - chars.append('\r') - elif line[endpos] == 't': - chars.append('\t') - else: - chars.append('\\') - chars.append(line[endpos]) - elif line[endpos] == '"': - break - else: - chars.append(line[endpos]) - endpos += 1 - if endpos >= len(line): - raise error(filename, lineno, "unclosed quoted string") - pos = endpos - stack[-1] += (''.join(chars),) - else: # symbol/number - if not stack: - raise error(filename, lineno, - 'identifier found outside of s-expression') - endpos = pos - while endpos < len(line) and line[endpos] not in nonsymbol: - endpos += 1 - symbol = line[pos:endpos] - pos = max(pos, endpos-1) - try: symbol = int(symbol) - except ValueError: - try: symbol = float(symbol) - except ValueError: pass - stack[-1] += (symbol,) - pos += 1 - if len(stack) != 0: - msg = '%d unclosed parentheses found at end of ' \ - 'file (opened on line(s) %s)' % (len(stack), - ', '.join(map(str, openlines))) - raise error(filename, lineno, msg) - -class Parser: - def __init__(self, filename): - """Argument is either a string, a parse tree, or file object""" - self.filename = filename - def startParsing(self, filename=None): - statements = parse(filename or self.filename) - for statement in statements: - self.handle(statement) - def handle(self, tup): - cmd = string.translate(tup[0], trans) - if hasattr(self, cmd): - getattr(self, cmd)(*tup[1:]) - else: - self.unknown(tup) - def unknown(self, tup): - pass - -_testString = """; a scheme file -(define-func gdk_font_load ; a comment at end of line - GdkFont - ((string name))) - -(define-boxed GdkEvent - gdk_event_copy - gdk_event_free - "sizeof(GdkEvent)") -""" - -if __name__ == '__main__': - import sys - if sys.argv[1:]: - fp = open(sys.argv[1]) - else: - fp = StringIO(_testString) - statements = parse(fp) - for s in statements: - print `s` diff --git a/config.h.in b/config.h.in index 5ac6e15..1420b85 100644 --- a/config.h.in +++ b/config.h.in @@ -1,8 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Use introspection information */ -#undef ENABLE_INTROSPECTION - /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H diff --git a/configure b/configure index 927e918..744bde9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for pygobject 2.28.6. +# Generated by GNU Autoconf 2.68 for pygobject 2.90.1. # # Report bugs to . # @@ -571,12 +571,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='2.28.6' -PACKAGE_STRING='pygobject 2.28.6' +PACKAGE_VERSION='2.90.1' +PACKAGE_STRING='pygobject 2.90.1' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='' -ac_unique_file="gobject/gobjectmodule.c" +ac_unique_file="gi/gimodule.c" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -621,19 +621,11 @@ INTROSPECTION_COMPILER INTROSPECTION_SCANNER ENABLE_CAIRO_FALSE ENABLE_CAIRO_TRUE -ENABLE_INTROSPECTION_FALSE -ENABLE_INTROSPECTION_TRUE PYCAIRO_LIBS PYCAIRO_CFLAGS GI_DATADIR GI_LIBS GI_CFLAGS -BUILD_GIOUNIX_FALSE -BUILD_GIOUNIX_TRUE -GIOUNIX_LIBS -GIOUNIX_CFLAGS -BUILD_GIO_FALSE -BUILD_GIO_TRUE GIO_LIBS GIO_CFLAGS LIBFFI_PC @@ -642,7 +634,6 @@ HAVE_LIBFFI_TRUE FFI_LIBS FFI_CFLAGS DATADIR -pygobject_CODEGEN_DEFINES PYTHON_BASENAME GLIB_MKENUMS GOBJECT_QUERY @@ -806,7 +797,6 @@ enable_docs enable_glibtest with_ffi enable_cairo -enable_introspection ' ac_precious_vars='build_alias host_alias @@ -824,8 +814,6 @@ FFI_CFLAGS FFI_LIBS GIO_CFLAGS GIO_LIBS -GIOUNIX_CFLAGS -GIOUNIX_LIBS GI_CFLAGS GI_LIBS PYCAIRO_CFLAGS @@ -1372,7 +1360,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pygobject 2.28.6 to adapt to many kinds of systems. +\`configure' configures pygobject 2.90.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1442,7 +1430,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 2.28.6:";; + short | recursive ) echo "Configuration of pygobject 2.90.1:";; esac cat <<\_ACEOF @@ -1466,7 +1454,6 @@ Optional Features: --disable-glibtest do not try to compile and run a test GLIB program --enable-cairo Enable Cairo bindings using introspection information - --enable-introspection Use introspection information Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1496,10 +1483,6 @@ Some influential environment variables: FFI_LIBS linker flags for FFI, overriding pkg-config GIO_CFLAGS C compiler flags for GIO, overriding pkg-config GIO_LIBS linker flags for GIO, overriding pkg-config - GIOUNIX_CFLAGS - C compiler flags for GIOUNIX, overriding pkg-config - GIOUNIX_LIBS - linker flags for GIOUNIX, overriding pkg-config GI_CFLAGS C compiler flags for GI, overriding pkg-config GI_LIBS linker flags for GI, overriding pkg-config PYCAIRO_CFLAGS @@ -1573,7 +1556,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 2.28.6 +pygobject configure 2.90.1 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1851,7 +1834,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pygobject $as_me 2.28.6, which was +It was created by pygobject $as_me 2.90.1, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2210,14 +2193,14 @@ $as_echo "#define PYGOBJECT_MAJOR_VERSION 2" >>confdefs.h PYGOBJECT_MAJOR_VERSION=2 -$as_echo "#define PYGOBJECT_MINOR_VERSION 28" >>confdefs.h +$as_echo "#define PYGOBJECT_MINOR_VERSION 90" >>confdefs.h -PYGOBJECT_MINOR_VERSION=28 +PYGOBJECT_MINOR_VERSION=90 -$as_echo "#define PYGOBJECT_MICRO_VERSION 6" >>confdefs.h +$as_echo "#define PYGOBJECT_MICRO_VERSION 1" >>confdefs.h -PYGOBJECT_MICRO_VERSION=6 +PYGOBJECT_MICRO_VERSION=1 ac_config_headers="$ac_config_headers config.h" @@ -2701,7 +2684,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='2.28.6' + VERSION='2.90.1' cat >>confdefs.h <<_ACEOF @@ -12037,7 +12020,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -pygobject config.lt 2.28.6 +pygobject config.lt 2.90.1 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -15519,9 +15502,6 @@ fi PYTHON_BASENAME=`basename $PYTHON` -pygobject_CODEGEN_DEFINES="" - - EXP_VAR=DATADIR FROM_VAR=$datadir @@ -15712,67 +15692,92 @@ fi # Put the nasty error message in config.log where it belongs echo "$GIO_PKG_ERRORS" >&5 - have_gio=false + as_fn_error $? "Package requirements (gio-2.0 >= 2.24.0) were not met: + +$GIO_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 + elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - have_gio=false + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } + else GIO_CFLAGS=$pkg_cv_GIO_CFLAGS GIO_LIBS=$pkg_cv_GIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - have_gio=true -fi - +fi -# Do not build GIO if the python version >= 3.0 -# We use GI to access GIO in python 3 - if test $have_gio = true -a $build_py3k = false; then - BUILD_GIO_TRUE= - BUILD_GIO_FALSE='#' +# Check whether --enable-cairo was given. +if test "${enable_cairo+set}" = set; then : + enableval=$enable_cairo; enable_cairo=$enableval else - BUILD_GIO_TRUE='#' - BUILD_GIO_FALSE= + enable_cairo=yes fi -if test -n "$export_dynamic"; then - GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"` -fi - pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIOUNIX" >&5 -$as_echo_n "checking for GIOUNIX... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GI" >&5 +$as_echo_n "checking for GI... " >&6; } -if test -n "$GIOUNIX_CFLAGS"; then - pkg_cv_GIOUNIX_CFLAGS="$GIOUNIX_CFLAGS" +if test -n "$GI_CFLAGS"; then + pkg_cv_GI_CFLAGS="$GI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GIOUNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.22.4" 2>/dev/null` + pkg_cv_GI_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$GIOUNIX_LIBS"; then - pkg_cv_GIOUNIX_LIBS="$GIOUNIX_LIBS" +if test -n "$GI_LIBS"; then + pkg_cv_GI_LIBS="$GI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GIOUNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.22.4" 2>/dev/null` + pkg_cv_GI_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +" 2>/dev/null` else pkg_failed=yes fi @@ -15792,101 +15797,96 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + GI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +" 2>&1` else - GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + GI_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GIOUNIX_PKG_ERRORS" >&5 + echo "$GI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 +) were not met: + +$GI_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GI_CFLAGS +and GI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 - have_giounix=false elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - have_giounix=false -else - GIOUNIX_CFLAGS=$pkg_cv_GIOUNIX_CFLAGS - GIOUNIX_LIBS=$pkg_cv_GIOUNIX_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_giounix=true -fi - + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. - if test $have_giounix = true -a $build_py3k = false; then - BUILD_GIOUNIX_TRUE= - BUILD_GIOUNIX_FALSE='#' -else - BUILD_GIOUNIX_TRUE='#' - BUILD_GIOUNIX_FALSE= -fi +Alternatively, you may set the environment variables GI_CFLAGS +and GI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -if test -n "$export_dynamic"; then - GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"` -fi +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } -# Check whether --enable-cairo was given. -if test "${enable_cairo+set}" = set; then : - enableval=$enable_cairo; enable_cairo=$enableval else - enable_cairo=yes -fi - + GI_CFLAGS=$pkg_cv_GI_CFLAGS + GI_LIBS=$pkg_cv_GI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -# Check whether --enable-introspection was given. -if test "${enable_introspection+set}" = set; then : - enableval=$enable_introspection; enable_introspection=$enableval -else - enable_introspection=yes fi -if test "$enable_introspection" != no; then +GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) -$as_echo "#define ENABLE_INTROSPECTION 1" >>confdefs.h +if test "$enable_cairo" != no; then + if test $build_py3k = true; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GI" >&5 -$as_echo_n "checking for GI... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYCAIRO" >&5 +$as_echo_n "checking for PYCAIRO... " >&6; } -if test -n "$GI_CFLAGS"; then - pkg_cv_GI_CFLAGS="$GI_CFLAGS" +if test -n "$PYCAIRO_CFLAGS"; then + pkg_cv_PYCAIRO_CFLAGS="$PYCAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - \""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - ") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"py3cairo >= 1.10.0 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "py3cairo >= 1.10.0 + ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GI_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - " 2>/dev/null` + pkg_cv_PYCAIRO_CFLAGS=`$PKG_CONFIG --cflags "py3cairo >= 1.10.0 + " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$GI_LIBS"; then - pkg_cv_GI_LIBS="$GI_LIBS" +if test -n "$PYCAIRO_LIBS"; then + pkg_cv_PYCAIRO_LIBS="$PYCAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - \""; } >&5 - ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - ") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"py3cairo >= 1.10.0 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "py3cairo >= 1.10.0 + ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GI_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - " 2>/dev/null` + pkg_cv_PYCAIRO_LIBS=`$PKG_CONFIG --libs "py3cairo >= 1.10.0 + " 2>/dev/null` else pkg_failed=yes fi @@ -15906,28 +15906,25 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - " 2>&1` + PYCAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "py3cairo >= 1.10.0 + " 2>&1` else - GI_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - " 2>&1` + PYCAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors "py3cairo >= 1.10.0 + " 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GI_PKG_ERRORS" >&5 + echo "$PYCAIRO_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (glib-2.0 >= 2.24.0 - gobject-introspection-1.0 >= 0.10.2 - ) were not met: + as_fn_error $? "Package requirements (py3cairo >= 1.10.0 + ) were not met: -$GI_PKG_ERRORS +$PYCAIRO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables GI_CFLAGS -and GI_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PYCAIRO_CFLAGS +and PYCAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then @@ -15939,25 +15936,21 @@ as_fn_error $? "The pkg-config script could not be found or is too old. Make su is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables GI_CFLAGS -and GI_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables PYCAIRO_CFLAGS +and PYCAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - GI_CFLAGS=$pkg_cv_GI_CFLAGS - GI_LIBS=$pkg_cv_GI_LIBS + PYCAIRO_CFLAGS=$pkg_cv_PYCAIRO_CFLAGS + PYCAIRO_LIBS=$pkg_cv_PYCAIRO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi - - GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) - - - if test "$enable_cairo" != no; then + else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYCAIRO" >&5 @@ -16060,14 +16053,6 @@ $as_echo "yes" >&6; } fi fi fi - if test "$enable_introspection" = "yes"; then - ENABLE_INTROSPECTION_TRUE= - ENABLE_INTROSPECTION_FALSE='#' -else - ENABLE_INTROSPECTION_TRUE='#' - ENABLE_INTROSPECTION_FALSE= -fi - if test "$enable_cairo" = "yes"; then ENABLE_CAIRO_TRUE= ENABLE_CAIRO_FALSE='#' @@ -16193,7 +16178,7 @@ esac fi -ac_config_files="$ac_config_files Makefile pygobject-2.0.pc pygobject-2.0-uninstalled.pc codegen/Makefile codegen/pygobject-codegen-2.0 docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile glib/Makefile gobject/Makefile gio/Makefile examples/Makefile tests/Makefile PKG-INFO" +ac_config_files="$ac_config_files Makefile pygobject-3.0.pc pygobject-3.0-uninstalled.pc docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile gi/_glib/Makefile gi/_gobject/Makefile examples/Makefile tests/Makefile PKG-INFO" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16348,18 +16333,6 @@ if test -z "${HAVE_LIBFFI_TRUE}" && test -z "${HAVE_LIBFFI_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBFFI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_GIO_TRUE}" && test -z "${BUILD_GIO_FALSE}"; then - as_fn_error $? "conditional \"BUILD_GIO\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_GIOUNIX_TRUE}" && test -z "${BUILD_GIOUNIX_FALSE}"; then - as_fn_error $? "conditional \"BUILD_GIOUNIX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_INTROSPECTION_TRUE}" && test -z "${ENABLE_INTROSPECTION_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_INTROSPECTION\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_CAIRO_TRUE}" && test -z "${ENABLE_CAIRO_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CAIRO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16773,7 +16746,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pygobject $as_me 2.28.6, which was +This file was extended by pygobject $as_me 2.90.1, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16839,7 +16812,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pygobject config.status 2.28.6 +pygobject config.status 2.90.1 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -17252,19 +17225,16 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "pygobject-2.0.pc") CONFIG_FILES="$CONFIG_FILES pygobject-2.0.pc" ;; - "pygobject-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pygobject-2.0-uninstalled.pc" ;; - "codegen/Makefile") CONFIG_FILES="$CONFIG_FILES codegen/Makefile" ;; - "codegen/pygobject-codegen-2.0") CONFIG_FILES="$CONFIG_FILES codegen/pygobject-codegen-2.0" ;; + "pygobject-3.0.pc") CONFIG_FILES="$CONFIG_FILES pygobject-3.0.pc" ;; + "pygobject-3.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pygobject-3.0-uninstalled.pc" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/entities.docbook") CONFIG_FILES="$CONFIG_FILES docs/reference/entities.docbook" ;; "docs/xsl/fixxref.py") CONFIG_FILES="$CONFIG_FILES docs/xsl/fixxref.py" ;; "gi/Makefile") CONFIG_FILES="$CONFIG_FILES gi/Makefile" ;; "gi/repository/Makefile") CONFIG_FILES="$CONFIG_FILES gi/repository/Makefile" ;; "gi/overrides/Makefile") CONFIG_FILES="$CONFIG_FILES gi/overrides/Makefile" ;; - "glib/Makefile") CONFIG_FILES="$CONFIG_FILES glib/Makefile" ;; - "gobject/Makefile") CONFIG_FILES="$CONFIG_FILES gobject/Makefile" ;; - "gio/Makefile") CONFIG_FILES="$CONFIG_FILES gio/Makefile" ;; + "gi/_glib/Makefile") CONFIG_FILES="$CONFIG_FILES gi/_glib/Makefile" ;; + "gi/_gobject/Makefile") CONFIG_FILES="$CONFIG_FILES gi/_gobject/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "PKG-INFO") CONFIG_FILES="$CONFIG_FILES PKG-INFO" ;; @@ -18633,5 +18603,4 @@ fi echo echo "libffi support: $have_libffi" -echo "introspection support: $enable_introspection" echo diff --git a/configure.ac b/configure.ac index 1b923b4..d6832c3 100644 --- a/configure.ac +++ b/configure.ac @@ -11,22 +11,22 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 2) -m4_define(pygobject_minor_version, 28) -m4_define(pygobject_micro_version, 6) +m4_define(pygobject_minor_version, 90) +m4_define(pygobject_micro_version, 1) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... m4_define(introspection_required_version, 0.10.2) -m4_define(pycairo_required_version, 1.2.0) +m4_define(py2cairo_required_version, 1.2.0) +m4_define(py3cairo_required_version, 1.10.0) m4_define(glib_required_version, 2.24.0) m4_define(gio_required_version, 2.24.0) -m4_define(giounix_required_version, 2.22.4) AC_INIT(pygobject, pygobject_version, [http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject]) AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .") AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([gobject/gobjectmodule.c]) +AC_CONFIG_SRCDIR([gi/gimodule.c]) AC_DEFINE(PYGOBJECT_MAJOR_VERSION, pygobject_major_version, [pygobject major version]) AC_SUBST(PYGOBJECT_MAJOR_VERSION, pygobject_major_version) @@ -176,9 +176,6 @@ fi PYTHON_BASENAME=`basename $PYTHON` AC_SUBST([PYTHON_BASENAME]) -pygobject_CODEGEN_DEFINES="" -AC_SUBST([pygobject_CODEGEN_DEFINES]) - AS_AC_EXPAND(DATADIR, $datadir) dnl libffi @@ -205,55 +202,32 @@ AC_SUBST(FFI_LIBS) AC_SUBST(LIBFFI_PC) dnl gio -PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version, - have_gio=true, have_gio=false) -AC_SUBST(GIO_CFLAGS) -AC_SUBST(GIO_LIBS) - -# Do not build GIO if the python version >= 3.0 -# We use GI to access GIO in python 3 -AM_CONDITIONAL(BUILD_GIO, test $have_gio = true -a $build_py3k = false) - -if test -n "$export_dynamic"; then - GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"` -fi - -dnl giounix -PKG_CHECK_MODULES(GIOUNIX, gio-unix-2.0 >= giounix_required_version, - have_giounix=true, have_giounix=false) -AC_SUBST(GIOUNIX_CFLAGS) -AC_SUBST(GIOUNIX_LIBS) -AM_CONDITIONAL(BUILD_GIOUNIX, test $have_giounix = true -a $build_py3k = false) -if test -n "$export_dynamic"; then - GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"` -fi +PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version) AC_ARG_ENABLE(cairo, AC_HELP_STRING([--enable-cairo], [Enable Cairo bindings using introspection information]), enable_cairo=$enableval, enable_cairo=yes) -AC_ARG_ENABLE(introspection, - AC_HELP_STRING([--enable-introspection], [Use introspection information]), - enable_introspection=$enableval, - enable_introspection=yes) -if test "$enable_introspection" != no; then - AC_DEFINE(ENABLE_INTROSPECTION,1,Use introspection information) - PKG_CHECK_MODULES(GI, - glib-2.0 >= glib_required_version - gobject-introspection-1.0 >= introspection_required_version - ) - - GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) - AC_SUBST(GI_DATADIR) - - if test "$enable_cairo" != no; then +PKG_CHECK_MODULES(GI, + glib-2.0 >= glib_required_version + gobject-introspection-1.0 >= introspection_required_version +) + +GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) +AC_SUBST(GI_DATADIR) + +if test "$enable_cairo" != no; then + if test $build_py3k = true; then + PKG_CHECK_MODULES(PYCAIRO, + py3cairo >= py3cairo_required_version + ) + else PKG_CHECK_MODULES(PYCAIRO, - pycairo >= pycairo_required_version + pycairo >= py2cairo_required_version ) fi fi -AM_CONDITIONAL(ENABLE_INTROSPECTION, test "$enable_introspection" = "yes") AM_CONDITIONAL(ENABLE_CAIRO, test "$enable_cairo" = "yes") INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` @@ -279,19 +253,16 @@ fi AC_CONFIG_FILES( Makefile - pygobject-2.0.pc - pygobject-2.0-uninstalled.pc - codegen/Makefile - codegen/pygobject-codegen-2.0 + pygobject-3.0.pc + pygobject-3.0-uninstalled.pc docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile - glib/Makefile - gobject/Makefile - gio/Makefile + gi/_glib/Makefile + gi/_gobject/Makefile examples/Makefile tests/Makefile PKG-INFO) @@ -299,5 +270,4 @@ AC_OUTPUT echo echo "libffi support: $have_libffi" -echo "introspection support: $enable_introspection" echo diff --git a/docs/Makefile.am b/docs/Makefile.am index 418df8a..ad68613 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,46 +16,6 @@ HTML_FILES = \ html/glib-functions.html \ html/gobject-class-reference.html \ html/glib-class-reference.html \ - html/class-gioapplaunchcontext.html \ - html/class-gioappinfo.html \ - html/class-gioasyncresult.html \ - html/class-giobufferedinputstream.html \ - html/class-giobufferedoutputstream.html \ - html/class-giocancellable.html \ - html/class-giodatainputstream.html \ - html/class-giodataoutputstream.html \ - html/class-giodrive.html \ - html/class-gioemblem.html \ - html/class-gioemblemedicon.html \ - html/class-giofile.html \ - html/class-giofileattributeinfo.html \ - html/class-giofileenumerator.html \ - html/class-giofileicon.html \ - html/class-giofileinfo.html \ - html/class-giofileinputstream.html \ - html/class-giofilemonitor.html \ - html/class-giofileoutputstream.html \ - html/class-giofilterinputstream.html \ - html/class-giofilteroutputstream.html \ - html/class-gioicon.html \ - html/class-gioinputstream.html \ - html/class-gioloadableicon.html \ - html/class-giomemoryinputstream.html \ - html/class-giomemoryoutputstream.html \ - html/class-giomount.html \ - html/class-giomountoperation.html \ - html/class-giooutputstream.html \ - html/class-gioseekable.html \ - html/class-giosimpleasyncresult.html \ - html/class-giothemedicon.html \ - html/class-giounixinputstream.html \ - html/class-giounixoutputstream.html \ - html/class-giovolume.html \ - html/class-giovolumemonitor.html \ - html/gio-constants.html \ - html/gio-functions.html \ - html/gio-class-reference.html \ - html/giounix-class-reference.html \ html/gobject-constants.html \ html/gobject-functions.html \ html/index.html \ @@ -78,47 +38,7 @@ XML_FILES = \ reference/pyglib-constants.xml \ reference/pyglib-functions.xml \ reference/pyglib-maincontext.xml \ - reference/pyglib-mainloop.xml \ - reference/pygio-classes.xml \ - reference/pygiounix-classes.xml \ - reference/pygio-constants.xml \ - reference/pygio-functions.xml \ - reference/pygio-applaunchcontext.xml \ - reference/pygio-appinfo.xml \ - reference/pygio-asyncresult.xml \ - reference/pygio-bufferedinputstream.xml \ - reference/pygio-bufferedoutputstream.xml \ - reference/pygio-cancellable.xml \ - reference/pygio-datainputstream.xml \ - reference/pygio-dataoutputstream.xml \ - reference/pygio-drive.xml \ - reference/pygio-emblem.xml \ - reference/pygio-emblemedicon.xml \ - reference/pygio-file.xml \ - reference/pygio-fileattributeinfo.xml \ - reference/pygio-fileenumerator.xml \ - reference/pygio-fileicon.xml \ - reference/pygio-fileinfo.xml \ - reference/pygio-fileinputstream.xml \ - reference/pygio-filemonitor.xml \ - reference/pygio-fileoutputstream.xml \ - reference/pygio-filterinputstream.xml \ - reference/pygio-filteroutputstream.xml \ - reference/pygio-icon.xml \ - reference/pygio-inputstream.xml \ - reference/pygio-loadableicon.xml \ - reference/pygio-memoryinputstream.xml \ - reference/pygio-memoryoutputstream.xml \ - reference/pygio-mount.xml \ - reference/pygio-mountoperation.xml \ - reference/pygio-outputstream.xml \ - reference/pygio-seekable.xml \ - reference/pygio-simpleasyncresult.xml \ - reference/pygio-themedicon.xml \ - reference/pygio-unixinputstream.xml \ - reference/pygio-unixoutputstream.xml \ - reference/pygio-volume.xml \ - reference/pygio-volumemonitor.xml + reference/pyglib-mainloop.xml XSL_FILES = \ xsl/common.xsl \ diff --git a/docs/Makefile.in b/docs/Makefile.in index acb75a7..14ef3ad 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -110,8 +110,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ -GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GI_CFLAGS = @GI_CFLAGS@ @@ -228,7 +226,6 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ @@ -253,46 +250,6 @@ HTML_FILES = \ html/glib-functions.html \ html/gobject-class-reference.html \ html/glib-class-reference.html \ - html/class-gioapplaunchcontext.html \ - html/class-gioappinfo.html \ - html/class-gioasyncresult.html \ - html/class-giobufferedinputstream.html \ - html/class-giobufferedoutputstream.html \ - html/class-giocancellable.html \ - html/class-giodatainputstream.html \ - html/class-giodataoutputstream.html \ - html/class-giodrive.html \ - html/class-gioemblem.html \ - html/class-gioemblemedicon.html \ - html/class-giofile.html \ - html/class-giofileattributeinfo.html \ - html/class-giofileenumerator.html \ - html/class-giofileicon.html \ - html/class-giofileinfo.html \ - html/class-giofileinputstream.html \ - html/class-giofilemonitor.html \ - html/class-giofileoutputstream.html \ - html/class-giofilterinputstream.html \ - html/class-giofilteroutputstream.html \ - html/class-gioicon.html \ - html/class-gioinputstream.html \ - html/class-gioloadableicon.html \ - html/class-giomemoryinputstream.html \ - html/class-giomemoryoutputstream.html \ - html/class-giomount.html \ - html/class-giomountoperation.html \ - html/class-giooutputstream.html \ - html/class-gioseekable.html \ - html/class-giosimpleasyncresult.html \ - html/class-giothemedicon.html \ - html/class-giounixinputstream.html \ - html/class-giounixoutputstream.html \ - html/class-giovolume.html \ - html/class-giovolumemonitor.html \ - html/gio-constants.html \ - html/gio-functions.html \ - html/gio-class-reference.html \ - html/giounix-class-reference.html \ html/gobject-constants.html \ html/gobject-functions.html \ html/index.html \ @@ -314,47 +271,7 @@ XML_FILES = \ reference/pyglib-constants.xml \ reference/pyglib-functions.xml \ reference/pyglib-maincontext.xml \ - reference/pyglib-mainloop.xml \ - reference/pygio-classes.xml \ - reference/pygiounix-classes.xml \ - reference/pygio-constants.xml \ - reference/pygio-functions.xml \ - reference/pygio-applaunchcontext.xml \ - reference/pygio-appinfo.xml \ - reference/pygio-asyncresult.xml \ - reference/pygio-bufferedinputstream.xml \ - reference/pygio-bufferedoutputstream.xml \ - reference/pygio-cancellable.xml \ - reference/pygio-datainputstream.xml \ - reference/pygio-dataoutputstream.xml \ - reference/pygio-drive.xml \ - reference/pygio-emblem.xml \ - reference/pygio-emblemedicon.xml \ - reference/pygio-file.xml \ - reference/pygio-fileattributeinfo.xml \ - reference/pygio-fileenumerator.xml \ - reference/pygio-fileicon.xml \ - reference/pygio-fileinfo.xml \ - reference/pygio-fileinputstream.xml \ - reference/pygio-filemonitor.xml \ - reference/pygio-fileoutputstream.xml \ - reference/pygio-filterinputstream.xml \ - reference/pygio-filteroutputstream.xml \ - reference/pygio-icon.xml \ - reference/pygio-inputstream.xml \ - reference/pygio-loadableicon.xml \ - reference/pygio-memoryinputstream.xml \ - reference/pygio-memoryoutputstream.xml \ - reference/pygio-mount.xml \ - reference/pygio-mountoperation.xml \ - reference/pygio-outputstream.xml \ - reference/pygio-seekable.xml \ - reference/pygio-simpleasyncresult.xml \ - reference/pygio-themedicon.xml \ - reference/pygio-unixinputstream.xml \ - reference/pygio-unixoutputstream.xml \ - reference/pygio-volume.xml \ - reference/pygio-volumemonitor.xml + reference/pyglib-mainloop.xml XSL_FILES = \ xsl/common.xsl \ diff --git a/docs/html/class-gioappinfo.html b/docs/html/class-gioappinfo.html deleted file mode 100644 index e8d134f..0000000 --- a/docs/html/class-gioappinfo.html +++ /dev/null @@ -1,210 +0,0 @@ -gio.AppInfo

gio.AppInfo

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).

Synopsis

class gio.AppInfo(gobject.GInterface):
-    gio.AppInfo(commandline, application_name=None, flags=gio.APP_INFO_CREATE_NONE)
def add_supports_type(content_type)
def can_delete()
def can_remove_supports_type()
def delete()
def dup()
def equal(appinfo2)
def get_commandline()
def get_description()
def get_executable()
def get_icon()
def get_id()
def get_name()
def launch(files, launch_context)
def launch_uris(uris, launch_context)
def remove_supports_type(content_type)
def set_as_default_for_extension(extension)
def set_as_default_for_type(content_type)
def should_show()
def supports_files()
def supports_uris()
-Functions
- 
-    def gio.app_info_get_all()
def gio.app_info_get_all_for_type(content_type)
def gio.app_info_get_default_for_type(content_type, must_support_uris)
def gio.app_info_get_default_for_uri_scheme(uri_scheme)
def gio.app_info_reset_type_association(content_type)

Ancestry

+-- gobject.GInterface
-  +-- gio.AppInfo
-

Known Implementation

- gio.AppInfo is implemented by - gio.DesktopAppInfo -

Description

- gio.AppInfo - and gio.AppLaunchContext - are used for describing and launching applications installed on the system. -

- As of GLib 2.20, URIs will always be converted to POSIX paths (using - gio.File.get_path()) when using - gio.AppInfo.launch() - even if the application requested an URI and not a POSIX path. For example for an desktop-file - based application with Exec key totem %U and a single URI, sftp://foo/file.avi, then /home/user/.gvfs/sftp - on foo/file.avi will be passed. This will only work if a set of suitable GIO extensions (such as gvfs 2.26 - compiled with FUSE support), is available and operational; if this is not the case, the URI will be passed - unmodified to the application. Some URIs, such as mailto:, of course cannot be mapped to a POSIX path - (in gvfs there's no FUSE mount for it); such URIs will be passed unmodified to the application. -

- Specifically for gvfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the - gio.File constructors - (since gvfs implements the GVfs extension point). As such, if the application needs to examine the URI, - it needs to use - gio.File.get_uri() - or similar on - gio.File. - In other words, an application cannot assume that the URI passed to e.g. - gio.File() constructor - is equal to the result of - gio.File.get_uri(). -

Constructor

    gio.AppInfo(commandline, application_name=None, flags=gio.APP_INFO_CREATE_NONE)

commandline :

the commandline to use -

application_name :

the application name, or None to use commandline. -

flags :

flags that can specify details of the created, - from Gio AppInfo Create Flags Constants -

Returns :

a new - gio.AppInfo - for given command. -

- Creates a new gio.AppInfo - from the given information. -

Methods

gio.AppInfo.add_supports_type

    def add_supports_type(content_type)

content_type :

A string.

- The add_supports_type() method adds a content type - to the application information to indicate the application is capable of - opening files with the given content type. -

gio.AppInfo.can_delete

    def can_delete()

Returns :

True if appinfo can be deleted. -

- The can_delete() method obtains the information - whether the gio.AppInfo - can be deleted. See - gio.AppInfo.delete(). -

gio.AppInfo.can_remove_supports_type

    def can_remove_supports_type()

Returns :

True if it is possible to remove - supported content types from a given appinfo, False - if not.

- The can_remove_supports_type() method checks if a - supported content type can be removed from an application. -

gio.AppInfo.delete

    def delete()

Returns :

True if appinfo has been deleted. -

- The delete() method tries to delete an - gio.AppInfo. -

- On some platforms, there may be a difference between user-defined - gio.AppInfos - which can be deleted, and system-wide ones which cannot. See - gio.AppInfo.can_delete(). -

gio.AppInfo.dup

    def dup()

Returns :

A duplicate of appinfo.

- The dup() method creates a duplicate of a - gio.AppInfo. -

gio.AppInfo.equal

    def equal(icon2)

appinfo2 :

the second - gio.AppInfo -

Returns :

True if appinfo1 is equal to appinfo2. - False otherwise.

- The equal() method checks if two - gio.AppInfos are equal. -

gio.AppInfo.get_commandline

    def get_commandline()

Returns :

a string containing the appinfo's commandline, or - None if this information is not available. -

- The get_commandline() method gets the - commandline with which the application will be started. -

gio.AppInfo.get_description

    def get_description()

Returns :

A string containing a description of the application - appinfo, or None if none.

- The get_description() method gets a human-readable - description of an installed application. -

gio.AppInfo.get_executable

    def get_executable()

Returns :

a string containing the appinfo's application - binary's name. -

- The get_description() method gets the executable's - name for the installed application. -

gio.AppInfo.get_icon

    def get_icon()

Returns :

the default - gio.Icon for appinfo. -

- The get_icon() method gets the icon for the application. -

gio.AppInfo.get_id

    def get_id()

Returns :

a string containing the application's ID. -

- The get_id() method gets the ID of an application. - An id is a string that identifies the application. The exact format of the - id is platform dependent. For instance, on Unix this is the desktop file id - from the xdg menu specification. -

- Note that the returned ID may be None, depending on - how the appinfo has been constructed. -

gio.AppInfo.get_name

    def get_name()

Returns :

the name of the application for appinfo. -

- The get_name() method gets the installed - name of the application. -

gio.AppInfo.launch

    def launch(files, launch_context)

files :

a list of gio.File objects. -

launch_context :

a gio.AppLaunchContext - or None.

Returns :

True on successful launch, - False otherwise. -

- The launch() method launches the application. - Passes files to the launched application as arguments, using the optional - launch_context to get information about the details of the launcher - (like what screen it is on). On error, error will be set accordingly. -

- To lauch the application without arguments pass a None for files list. -

- Note that even if the launch is successful the application launched can fail - to start if it runs into problems during startup. There is no way to detect this. -

- Some URIs can be changed when passed through a - gio.File - (for instance unsupported uris with strange formats like mailto:), so - if you have a textual uri you want to pass in as argument, consider using - gio.File.launch_uris() - instead. -

gio.AppInfo.launch_uris

    def launch_uris(uris, launch_context)

uris :

a list containing URIs to launch. -

launch_context :

a gio.AppLaunchContext - or None.

Returns :

True on successful launch, - False otherwise. -

- The launch_uris() method launches the application. - Passes uris to the launched application as arguments, using the optional - launch_context to get information about the details of the launcher - (like what screen it is on). On error, error will be set accordingly. -

- To lauch the application without arguments pass a None for files list. -

- Note that even if the launch is successful the application launched can fail - to start if it runs into problems during startup. There is no way to detect this. -

gio.AppInfo.remove_supports_type

    def remove_supports_type(content_type)

content_type :

A string.

- The remove_supports_type() method removes a - supported type from an application, if possible. -

gio.AppInfo.set_as_default_for_extension

    def set_as_default_for_extension(extension)

extension :

A string containing the file extension (without the dot). -

- The set_as_default_for_extension() method sets the - application as the default handler for the given file extention. -

gio.AppInfo.set_as_default_for_type

    def set_as_default_for_type(content_type)

content_type :

The content type. -

- The set_as_default_for_type() method sets the - application as the default handler for a given type. -

gio.AppInfo.should_show

    def should_show()

Returns :

True if the appinfo should be shown, - False otherwise. -

- The should_show() method checks if the application - info should be shown in menus that list available applications. -

gio.AppInfo.supports_files

    def supports_files()

Returns :

True if the appinfo supports files. -

- The supports_files() method checks if the application - accepts files as arguments. -

gio.AppInfo.supports_uris

    def supports_uris()

Returns :

True if the appinfo supports uris. -

- The supports_uris() method checks if the application - accepts uris as arguments. -

Functions

gio.app_info_get_all

    def app_info_get_all()

Returns :

A list of gio.AppInfos. -

- The app_info_get_all() function gets a list of all of - the applications currently registered on this system. -

- For desktop files, this includes applications that have NoDisplay=true set or are - excluded from display by means of OnlyShowIn or NotShowIn. See - gio.AppInfo.should_show(). - The returned list does not include applications which have the Hidden key set. -

gio.app_info_get_all_for_type

    def app_info_get_all_for_type(content_type)

content_type :

the content type to find a - gio.AppInfo - for.

Returns :

A list of gio.AppInfos - for a given content type or None on error. -

- The app_info_get_all_for_type() function gets a list of all - gio.AppInfos - for a given content type. -

gio.app_info_get_default_for_type

    def app_info_get_default_for_type(content_type, must_support_uris)

content_type :

the content type to find a - gio.AppInfo - for.

must_support_uris :

if True, the - gio.AppInfo - is expected to support URIs

Returns :

gio.AppInfo - for given content_type or None on error. -

- The app_info_get_default_for_type() function gets the - gio.AppInfo - that correspond to a given content type. -

gio.app_info_get_default_for_uri_scheme

    def app_info_get_default_for_uri_scheme(uri_scheme)

uri_scheme :

a string containing a URI scheme.

Returns :

gio.AppInfo - for given uri_scheme or None on error. -

- The app_info_get_default_for_uri_scheme() function gets - the default application for launching applications using this URI scheme. A URI - scheme is the initial part of the URI, up to but not including the - ':', e.g. "http", "ftp" or "sip". -

gio.app_info_reset_type_association

    def app_info_reset_type_association(content_type)

content_type :

a content type

- The app_info_reset_type_association() function - removes all changes to the type associations done by - set_as_default_for_type(), - set_as_default_for_extension(), - add_supports_type() or - remove_supports_type(). -

diff --git a/docs/html/class-gioapplaunchcontext.html b/docs/html/class-gioapplaunchcontext.html deleted file mode 100644 index 2d1d3df..0000000 --- a/docs/html/class-gioapplaunchcontext.html +++ /dev/null @@ -1,44 +0,0 @@ -gio.AppLaunchContext

gio.AppLaunchContext

gio.AppLaunchContext — Application launch context.

Synopsis

class gio.AppLaunchContext(gobject.GObject):
-    gio.AppLaunchContext()
def get_display(info, files)
def get_startup_notify_id(info, files)
def launch_failed(startup_notify_id)

Description

- The gio.AppLaunchContext - is used for integrating the launch with the launching application. This is used to handle for - instance startup notification and launching the new application on the same screen as the launching window. -

Constructor

    gio.AppLaunchContext()

Returns :

a new - gio.AppLaunchContext. -

- Creates a new application launch context. This is not normally used, instead - you instantiate a subclass of this, such as - gtk.gdk.AppLaunchContext. -

Methods

gio.AppLaunchContext.get_display

    def get_display(info, files)

info :

a - gio.AppInfo -

files :

a list of - gio.File - objects.

Returns :

a display string for the display. -

- The get_display() method gets the display - string for the display. This is used to ensure new applications - are started on the same display as the launching application. -

gio.AppLaunchContext.get_startup_notify_id

    def get_startup_notify_id(info, files)

info :

a - gio.AppInfo -

files :

a list of - gio.File - objects.

Returns :

a startup notification ID for the application, - or None if not supported. -

- The get_startup_notify_id() method initiates - startup notification for the application and returns the DESKTOP_STARTUP_ID - for the launched operation, if supported. -

- Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard. -

gio.AppLaunchContext.launch_failed

    def launch_failed(startup_notify_id)

startup_notify_id :

the startup notification id that was returned by - get_startup_notify_id. -

Returns :

a startup notification ID for the application, - or None if not supported. -

- The get_startup_notify_id() method is called - when an application has failed to launch, so that it can cancel the application - startup notification started in - get_startup_notify_id -

diff --git a/docs/html/class-gioasyncresult.html b/docs/html/class-gioasyncresult.html deleted file mode 100644 index ea06247..0000000 --- a/docs/html/class-gioasyncresult.html +++ /dev/null @@ -1,44 +0,0 @@ -gio.AsyncResult

gio.AsyncResult

gio.AsyncResult — Asynchronous Function Results.

Synopsis

class gio.AsyncResult(gobject.GInterface):
-    def get_source_object()

Prerequisites

- gio.AsyncResult is required by - gobject.GObject. -

Known Implementation

- gio.AsyncResult is implemented by - gio.SimpleAsyncResult. -

Description

- gio.AsyncResult - provides a base class for implementing asynchronous function results. -

- Asynchronous operations are broken up into two separate operations which are chained - together by a GAsyncReadyCallback. To begin an asynchronous operation, provide a - GAsyncReadyCallback to the asynchronous function. This callback will be triggered when - the operation has completed, and will be passed a GAsyncResult instance filled with the - details of the operation's success or failure, the object the asynchronous function was - started for and any error codes returned. The asynchronous callback function is then expected - to call the corresponding "_finish()" function with the object the function was called for, - and the gio.AsyncResult - instance, and optionally, an error to grab any error conditions that may have occurred. -

- The purpose of the "_finish()" function is to take the generic result of type GAsyncResult and - return the specific result that the operation in question yields (e.g. a - gio.FileEnumerator - for a "enumerate children" operation). If the result or error status of the operation is not needed, - there is no need to call the "_finish()" function, GIO will take care of cleaning up the result and error - information after the GAsyncReadyCallback returns. It is also allowed to take a reference to the - gio.AsyncResult - and call "_finish()" later. -

- The callback for an asynchronous operation is called only once, and is always called, even - in the case of a cancelled operation. On cancellation the result is a gio.ERROR_CANCELLED error. -

- Some ascynchronous operations are implemented using synchronous calls. These are run in a - separate thread, if GThread has been initialized, but otherwise they are sent to the Main Event - Loop and processed in an idle function. So, if you truly need asynchronous operations, make - sure to initialize GThread. -

Methods

gio.AsyncResult.get_source_object

    def get_source_object()

Returns :

the source object for the res. -

- The get_source_object() method gets the source object - from a gio.AsyncResult -

diff --git a/docs/html/class-giobufferedinputstream.html b/docs/html/class-giobufferedinputstream.html deleted file mode 100644 index 7fc25b4..0000000 --- a/docs/html/class-giobufferedinputstream.html +++ /dev/null @@ -1,133 +0,0 @@ -gio.BufferedInputStream

gio.BufferedInputStream

gio.BufferedInputStream — Buffered Input Stream

Synopsis

class gio.BufferedInputStream(gio.FilterInputStream):
-    gio.BufferedInputStream(base_stream)
def fill(count, cancellable=None)
def fill_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def fill_finish(result)
def get_available()
def get_buffer_size()
def read_byte(cancellable=None)
def set_buffer_size(size)
-Functions
- 
-    def gio.buffered_input_stream_new_sized(size)

gio.BufferedInputStream Properties

"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

- gio.BufferedInputStream - implements gio.FilterInputStream - and provides for buffered reads. -

- By default, - gio.BufferedInputStream's - buffer size is set at 4 kilobytes. -

- To create a buffered input stream, use - gio.BufferedInputStream(), - or gio.buffered_input_stream_new_sized() - to specify the buffer's size at construction. -

- To get the size of a buffer within a buffered input stream, use - get_buffer_size(). - To change the size of a buffered input stream's buffer, use - set_buffer_size(). - Note that the buffer's size cannot be reduced below the size of the data within the buffer. -

Constructor

    gio.BufferedInputStream(base_stream)

base_stream :

a - gio.InputStream. -

Returns :

a new - gio.InputStream - for the given base_stream. -

- Creates a new gio.InputStream - from the given base_stream, with a buffer set to the default size (4 kilobytes). -

Methods

gio.BufferedInputStream.fill

    def fill(count, cancellable=None)

count :

the number of bytes that will be read from the stream. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

the number of bytes read into stream's buffer, - up to count, or -1 on error. -

- The fill() method tries to read count bytes - from the stream into the buffer. Will block during this read. -

- If count is zero, returns zero and does nothing. A value of count - larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. -

- On success, the number of bytes read into the buffer is returned. It - is not an error if this is not the same as the requested size, as it can - happen e.g. near the end of a file. Zero is returned on end of file - (or if count is zero), but never otherwise. -

- If count is -1 then the attempted read size is equal to the number - of bytes that are required to fill the buffer. -

- If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. -

- On error -1 is returned and error is set accordingly. -

- For the asynchronous, non-blocking, version of this function, see - gio.BufferedInputStream.fill_async(). -

gio.BufferedInputStream.fill_async

    def fill_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

count :

the number of bytes that will be read from the stream. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The fill_async() method reads data into stream's - buffer asynchronously, up to count size. io_priority can be used to - prioritize reads. -

- For the synchronous version of this function, see - gio.BufferedInputStream.fill(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set -

- If count is -1 then the attempted read size is equal to the number of bytes - that are required to fill the buffer. -

gio.BufferedInputStream.fill_finish

    def fill_finish(result)

result :

a gio.AsyncResult. -

Returns :

the size of the read stream, or -1 on an error. -

- The fill_finish() method finishes an asynchronous - file append operation started with - gio.BufferedInputStream.fill_async(). -

gio.BufferedInputStream.get_available

    def get_available()

Returns :

size of the available stream. -

- The get_available() method gets the size of - the available data within the stream. -

gio.BufferedInputStream.get_buffer_size

    def get_buffer_size()

Returns :

the current buffer size. -

- The get_buffer_size() method gets the size - of the input buffer. -

gio.BufferedInputStream.read_byte

    def read_byte(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

the byte read from the stream, or -1 on end of stream or error. -

- The read_byte() method tries to read a single - byte from the stream or the buffer. Will block during this read. -

- On success, the byte read from the stream is returned. On end of stream -1 - is returned but it's not an exceptional error and error is not set. -

- If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. -

- On error -1 is returned and error is set accordingly. -

gio.BufferedInputStream.set_buffer_size

    def set_buffer_size(size)

size :

the new buffer size. -

- The set_buffer_size() method sets the size - of the internal buffer of stream to size, or to the size of the contents - of the buffer. The buffer can never be resized smaller than its current contents. -

Functions

gio.buffered_input_stream_new_sized

    def buffered_input_stream_new_sized(size)

size :

the requested buffer size. -

Returns :

A new - gio.InputStream. -

- The buffered_input_stream_new_sized() function creates - a new gio.BufferedInputStream - from the given base_stream, with a buffer set to size. -

diff --git a/docs/html/class-giobufferedoutputstream.html b/docs/html/class-giobufferedoutputstream.html deleted file mode 100644 index a77139f..0000000 --- a/docs/html/class-giobufferedoutputstream.html +++ /dev/null @@ -1,62 +0,0 @@ -gio.BufferedOutputStream

gio.BufferedOutputStream

gio.BufferedOutputStream — Buffered Output Stream

Synopsis

class gio.BufferedOutputStream(gio.FilterOutputStream):
-    gio.BufferedOutputStream(base_stream)
def get_auto_grow()
def get_buffer_size()
def set_auto_grow(auto_grow)
def set_buffer_size(size)
-Functions
- 
-    def gio.buffered_output_stream_new_sized(size)

gio.BufferedOutputStream Properties

"auto-grow"Read - WriteWhether the buffer should automatically grow. Default value: False.
"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

- gio.BufferedOutputStream - implements gio.FilterOutputStream - and provides for buffered writes. -

- By default, - gio.BufferedOutputStream's - buffer size is set at 4 kilobytes. -

- To create a buffered output stream, use - gio.BufferedOutputStream(), - or gio.buffered_output_stream_new_sized() - to specify the buffer's size at construction. -

- To get the size of a buffer within a buffered output stream, use - gio.BufferedOutputStream.get_buffer_size(). - To change the size of a buffered output stream's buffer, use - gio.BufferedOutputStream.set_buffer_size(). - Note that the buffer's size cannot be reduced below the size of the data within the buffer. -

Constructor

    gio.BufferedOutputStream(base_stream)

base_stream :

a - gio.OutputStream. -

Returns :

a new - gio.OutputStream - for the given base_stream. -

- Creates a new buffered output stream for a base stream. -

Methods

gio.BufferedOutputStream.get_auto_grow

    def get_auto_grow()

Returns :

True if the stream's - buffer automatically grows, False otherwise. -

- The get_auto_grow() method checks if the - buffer automatically grows as data is added. -

gio.BufferedOutputStream.get_buffer_size

    def get_buffer_size()

Returns :

the current buffer size. -

- The get_buffer_size() method gets the size - of the buffer in the stream. -

gio.BufferedOutputStream.set_auto_grow

    def set_auto_grow(auto_grow)

auto_grow :

a boolean. -

- The set_auto_grow() method sets whether or not - the stream's buffer should automatically grow. If auto_grow is true, - then each write will just make the buffer larger, and you must manually - flush the buffer to actually write out the data to the underlying stream. -

gio.BufferedOutputStream.set_buffer_size

    def set_buffer_size(size)

size :

the new buffer size. -

- The set_buffer_size() method sets the size of - the internal buffer to size. -

Functions

gio.buffered_output_stream_new_sized

    def buffered_output_stream_new_sized(size)

size :

the requested buffer size. -

Returns :

A new - gio.OutputStream - with an internal buffer set to size.. -

- The buffered_output_stream_new_sized() function creates - a new gio.BufferedOutputStream - from the given base_stream, with a buffer set to size. -

diff --git a/docs/html/class-giocancellable.html b/docs/html/class-giocancellable.html deleted file mode 100644 index 54c8bf5..0000000 --- a/docs/html/class-giocancellable.html +++ /dev/null @@ -1,61 +0,0 @@ -gio.Cancellable

gio.Cancellable

gio.Cancellable — Thread-safe Operation Cancellation Stack.

Synopsis

class gio.Cancellable(gobject.GObject):
-    gio.Cancellable()
def cancel()
def get_fd()
def is_cancelled()
def pop_current()
def push_current()
def reset()
def set_error_if_cancelled()
-Functions
- 
-    def gio.cancellable_get_current()

Ancestry

+-- gobject.GObject
-  +-- gio.Cancellable
-

Description

- The gio.Cancellable - is a thread-safe operation cancellation stack used throughout GIO to allow for - cancellation of synchronous and asynchronous operations. -

Constructor

    gio.Cancellable()

Returns :

a new - gio.Cancellable. -

- Creates a new gio.Cancellable object. -

- Applications that want to start one or more operations that should be cancellable should create a - gio.Cancellable - and pass it to the operations. -

- One gio.Cancellable - can be used in multiple consecutive operations, but not in multiple concurrent operations. -

Methods

gio.Cancellable.cancel

    def cancel()

- The cancel() method will set cancellable to cancelled, - and will emit the "cancelled" signal. (However, see the warning about race conditions - in the documentation for that signal if you are planning to connect to it.) -

- This function is thread-safe. In other words, you can safely call it from a thread - other than the one running the operation that was passed the cancellable. -

- The convention within gio is that cancelling an asynchronous operation causes it - to complete asynchronously. That is, if you cancel the operation from the same thread - in which it is running, then the operation's GAsyncReadyCallback will not be invoked - until the application returns to the main loop. -

gio.Cancellable.get_fd

    def get_fd()

Returns :

A valid file descriptor. -1 if the file descriptor - is not supported, or on errors.

- The get_fd() method gets the file descriptor - for a cancellable job. This can be used to implement cancellable operations - on Unix systems. The returned fd will turn readable when cancellable is cancelled. -

gio.Cancellable.is_cancelled

    def is_cancelled()

Returns :

True if cancellable is cancelled, - False if called with None or if - item is not cancelled.

- The get_fd() method gets the file descriptor - for a cancellable job. This can be used to implement cancellable operations - on Unix systems. The returned fd will turn readable when cancellable is cancelled. -

gio.Cancellable.pop_current

    def pop_current()

- The pop_current() method pops cancellable off - the cancellable stack (verifying that cancellable is on the top of the stack). -

gio.Cancellable.push_current

    def push_current()

- The push_current() method pushes cancellable onto - the cancellable stack. The current cancllable can then be recieved using - gio.cancellable_get_current(). -

gio.Cancellable.reset

    def reset()

- The reset() method resets cancellable to its uncancelled state. -

gio.Cancellable.set_error_if_cancelled

    def set_error_if_cancelled()

Returns :

True if cancellable was cancelled, - False if it was not.

- The set_error_if_cancelled() method, if the cancellable - is cancelled, sets the error to notify that the operation was cancelled. -

Functions

gio.cancellable_get_current

    def cancellable_get_current()

Returns :

A gio.Cancellable - from the top of the stack, or None if the stack is empty.

- The cancellable_get_current() function gets the top cancellable from the stack. -

diff --git a/docs/html/class-giodatainputstream.html b/docs/html/class-giodatainputstream.html deleted file mode 100644 index 67fb819..0000000 --- a/docs/html/class-giodatainputstream.html +++ /dev/null @@ -1,223 +0,0 @@ -gio.DataInputStream

gio.DataInputStream

gio.DataInputStream — Data Input Stream

Synopsis

class gio.DataInputStream(gio.BufferedInputStream):
-    gio.DataInputStream(base_stream)
def get_byte_order()
def get_newline_type()
def read_byte(cancellable=None)
def read_int16(cancellable=None)
def read_int32(cancellable=None)
def read_int64(cancellable=None)
def read_line(cancellable=None)
def read_line_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_line_finish(result)
def read_uint16(cancellable=None)
def read_uint32(cancellable=None)
def read_uint64(cancellable=None)
def read_until(stop_chars, cancellable=None)
def read_until_async(stop_chars, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_until_finish(result)
def set_byte_order(order)
def set_newline_type(type)

gio.DataInputStream Properties

"byte-order"Read - WriteThe byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.
"newline-type"Read - WriteThe accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF.

Description

- gio.DataInputStream - implements gio.InputStream - and includes functions for reading structured data directly from a binary input stream. -

Constructor

    gio.DataInputStream(base_stream)

base_stream :

a - gio.InputStream. -

Returns :

a new - gio.DataInputStream -

- Creates a new gio.DataInputStream - from the given base_stream. -

Methods

gio.DataInputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current - Gio Data Stream Byte Order Constants. -

- The get_byte_order() method gets the byte - order for the data input stream. -

gio.DataInputStream.get_newline_type

    def get_newline_type()

Returns :

Gio Data Stream Newline Type Constants - for the given stream. -

- The get_newline_type() method gets the current - newline type for the stream. -

gio.DataInputStream.read_byte

    def read_byte(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

an unsigned 8-bit/1-byte value read from the - stream or 0 if an error occurred. -

- The read_byte() method reads an unsigned 8-bit/1-byte value from stream. -

gio.DataInputStream.read_int16

    def read_int16(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 16-bit/2-byte value read from stream or 0 if an error occurred. -

- The read_int16() method reads a 16-bit/2-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_int32

    def read_int32(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 32-bit/4-byte value read from the stream - or 0 if an error occurred. -

- The read_int32() method reads a signed 32-bit/4-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_int64

    def read_int64(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 64-bit/8-byte value read from the stream - or 0 if an error occurred. -

- The read_int64() method reads a signed 64-bit/8-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_line

    def read_line(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a string with the line that was read in (without the newlines). - Set length to a gsize to get the length of the read line. On an error, it will return - None and error will be set. If there's no content to read, it - will still return None, but error won't be set. -

- The read_line() reads a line from the data input stream. -

- If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. -

gio.DataInputStream.read_line_async

    def read_line_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The read_line_async() method is the asynchronous version of - gio.DataInputStream.read_line(). - It is an error to have two outstanding calls to this function. -

- For the synchronous version of this function, see - gio.DataInputStream.read_line(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set -

gio.DataInputStream.read_line_finish

    def read_line_finish(result)

result :

a gio.AsyncResult. -

Returns :

a string with the line that was read in (without the newlines). - On an error, it will return None and error will be set. - If there's no content to read, it will still return None, - but error won't be set. -

- The read_line_finish() method finishes an asynchronous - file append operation started with - gio.DataInputStream.read_line_async(). -

gio.DataInputStream.read_uint16

    def read_uint16(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 16-bit/2-byte value read from stream or 0 if an error occurred. -

- The read_uint16() method reads a 16-bit/2-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_uint32

    def read_uint32(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 32-bit/4-byte value read from the stream - or 0 if an error occurred. -

- The read_uint32() method reads a signed 32-bit/4-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_uint64

    def read_uint64(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a signed 64-bit/8-byte value read from the stream - or 0 if an error occurred. -

- The read_uint64() method reads a signed 64-bit/8-byte value from stream. -

- In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataInputStream.read_until

    def read_until(stop_chars, cancellable=None)

stop_chars :

characters to terminate the read. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a string with the data that was read before encountering - any of the stop characters. This function will return NULL on an error. -

- The read_until() reads a string from the data input - stream, up to the first occurrence of any of the stop characters. -

gio.DataInputStream.read_until_async

    def read_until_async(stop_chars, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

stop_chars :

characters to terminate the read. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The read_until_async() method it's the asynchronous version of - gio.DataInputStream.read_until(). - It is an error to have two outstanding calls to this function. -

- For the synchronous version of this function, see - gio.DataInputStream.read_until(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set -

- When the operation is finished, callback will be called. You can then call - gio.DataInputStream.read_until_finish() - to get the result of the operation. -

gio.DataInputStream.read_until_finish

    def read_until_finish(result)

result :

a gio.AsyncResult. -

Returns :

a string with the data that was read before encountering - any of the stop characters. This function will return None on an error. -

- The read_until_finish() method finishes an asynchronous - file append operation started with - gio.DataInputStream.read_until_async(). -

gio.DataInputStream.set_byte_order

    def set_byte_order(order)

order :

a - Gio Data Stream Byte Order Constants to set. -

- The set_byte_order() method sets the byte order for - the given stream. All subsequent reads from the stream will be read in the given order. -

gio.DataInputStream.set_newline_type

    def set_newline_type(type)

type :

a - Gio Data Stream Newline Type Constants to set. -

- The set_newline_type() method sets the newline type for the stream. -

Note

- Note that using gio.DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a - read chunk ends in "CR" we must read an additional byte to know if this is - "CR" or "CR LF", and this might block if there is no more data availible. -
diff --git a/docs/html/class-giodataoutputstream.html b/docs/html/class-giodataoutputstream.html deleted file mode 100644 index a681efe..0000000 --- a/docs/html/class-giodataoutputstream.html +++ /dev/null @@ -1,118 +0,0 @@ -gio.DataOutputStream

gio.DataOutputStream

gio.DataOutputStream — Data Output Stream

Synopsis

class gio.DataOutputStream(gio.BufferedOutputStream):
-    gio.DataOutputStream(base_stream)
def get_byte_order()
def put_byte(cancellable=None)
def put_int16(cancellable=None)
def put_int32(cancellable=None)
def put_int64(cancellable=None)
def put_string(cancellable=None)
def put_uint16(cancellable=None)
def put_uint32(cancellable=None)
def put_uint64(cancellable=None)
def set_byte_order(order)

gio.DataOutputStream Properties

"byte-order"Read - WriteDetermines the byte ordering that is used when writing - multi-byte entities (such as integers) to the stream. - Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.

Description

- gio.DataOutputStream - implements gio.InputStream - and includes functions for writing data directly to an output stream. -

Constructor

    gio.DataOutputStream(base_stream)

base_stream :

a - gio.OutputStream. -

Returns :

a new - gio.DataOutputStream -

- Creates a new gio.DataOutputStream - from the given base_stream. -

Methods

gio.DataOutputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current - Gio Data Stream Byte Order Constants. -

- The get_byte_order() method gets the byte - order for the stream. -

gio.DataOutputStream.put_byte

    def put_byte(data, cancellable=None)

data :

a char. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_byte() method puts a byte into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_int16

    def put_int16(data, cancellable=None)

data :

a gint16. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_int16() method puts a signed 16-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_int32

    def put_int32(data, cancellable=None)

data :

a gint32. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_int32() method puts a signed 32-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_int64

    def put_int64(data, cancellable=None)

data :

a gint64. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_int64() method puts a signed 64-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_string

    def put_string(str, cancellable=None)

str :

a string. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if string was successfully added to the stream. -

- The put_string() method puts a string into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_uint16

    def put_uint16(data, cancellable=None)

data :

a guint16. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_uint16() method puts an unsigned 16-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_uint32

    def put_uint32(data, cancellable=None)

data :

a guint32. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_uint32() method puts an unsigned 32-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.put_uint64

    def put_uint64(data, cancellable=None)

data :

a guint64. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True if data was successfully added to the stream. -

- The put_uint64() method puts an unsigned 64-bit integer into the output stream. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.DataOutputStream.set_byte_order

    def set_byte_order(order)

order :

a - Gio Data Stream Byte Order Constants to set. -

- The set_byte_order() method sets the byte order for - the given stream. All subsequent reads from the stream will be read in the given order. -

diff --git a/docs/html/class-giodrive.html b/docs/html/class-giodrive.html deleted file mode 100644 index be54893..0000000 --- a/docs/html/class-giodrive.html +++ /dev/null @@ -1,117 +0,0 @@ -gio.Drive

gio.Drive

gio.Drive — Virtual File System drive management.

Synopsis

class gio.Drive(gobject.GInterface):
-    def can_eject()
def can_poll_for_media()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_icon()
def get_identifier()
def get_name()
def get_volumes()
def has_media()
def has_volumes()
def is_media_check_automatic()
def is_media_removable()
def poll_for_media(callback, cancellable=None, user_data=None)
def poll_for_media_finish(result)

Ancestry

+-- gobject.GInterface
-  +-- gio.Drive
-

Prerequisites

- gio.Drive requires - gobject.GObject -

Description

- gio.Drive - - this represent a piece of hardware connected to the machine. Its generally - only created for removable hardware or hardware with removable media. -

- gio.Drive - is a container class for GVolume objects that stem from the same piece of media. - As such, gio.Drive - abstracts a drive with (or without) removable media and provides operations for - querying whether media is available, determing whether media change is automatically - detected and ejecting the media. -

- If the gio.Drive - reports that media isn't automatically detected, one can poll for media; typically - one should not do this periodically as a poll for media operation is potententially - expensive and may spin up the drive creating noise. -

- For porting from GnomeVFS note that there is no equivalent of - gio.Drive - in that API. -

Methods

gio.Drive.can_eject

    def can_eject()

Returns :

True if the drive can be ejected, - False otherwise. -

- The can_eject() method checks if a drive can be ejected. -

gio.Drive.can_poll_for_media

    def can_poll_for_media()

Returns :

True if the drive can be polled - for media changes, False otherwise. -

- The can_poll_for_media() method checks if a drive - can be polled for media changes. -

gio.Drive.eject

    def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

flags affecting the unmount if required for eject. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The eject() method asynchronously ejects a drive. -

- When the operation is finished, callback will be called. You can then call - gio.Drive.eject_finish() - to obtain the result of the operation. -

gio.Drive.eject_finish

    def eject_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the drive has been ejected - successfully, False otherwise. -

- The eject_finish() method finishes ejecting a drive. -

gio.Drive.enumerate_identifiers

    def enumerate_identifiers()

Returns :

a list of strings containing kinds of identifiers. -

- The enumerate_identifiers() method gets the kinds - of identifiers that drive has. Use - gio.Drive.get_identifier() - to obtain the identifiers themselves. -

gio.Drive.get_icon

    def get_icon()

Returns :

gio.Icon - for the drive. -

- The get_icon() method gets the icon for drive. -

gio.Drive.get_identifier

    def get_identifier()

Returns :

A string containing the requested identfier, or - None if the - gio.Drive - doesn't have this kind of identifier. -

- The get_identifier() method gets the identifier of - the given kind for drive. -

gio.Drive.get_name

    def get_name()

Returns :

A string containing drive's name. -

- The get_name() method gets the name of drive. -

gio.Drive.get_volumes

    def get_volumes()

Returns :

A list containing any - gio.Volume - objects on the given drive. -

- The get_volumes() method get a list of mountable - volumes for drive. -

gio.Drive.has_media

    def has_media()

Returns :

True if drive has media, - False otherwise.

- The has_media() method checks if the drive - has media. Note that the OS may not be polling the drive for media changes; see - gio.Drive.is_media_check_automatic() - for more details. -

gio.Drive.has_volumes

    def has_volumes()

Returns :

True if drive contains volumes, - False otherwise.

- The has_volumes() method check if drive has any mountable volumes. -

gio.Drive.is_media_check_automatic

    def is_media_check_automatic()

Returns :

True if drive is capabable - of automatically detecting media changes, - False otherwise.

- The is_media_check_automatic() method checks if - drive is capabable of automatically detecting media changes. -

gio.Drive.is_media_removable

    def is_media_removable()

Returns :

True if drive supports removable media, - False otherwise.

- The is_media_removable() method checks if the - drive supports removable media. -

gio.Drive.poll_for_media

    def poll_for_media(callback, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The poll_for_media() method asynchronously polls - drive to see if media has been inserted or removed. -

- When the operation is finished, callback will be called. You can then call - gio.Drive.poll_for_media_finish() - to obtain the result of the operation. -

gio.Drive.poll_for_media_finish

    def poll_for_media_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the drive has been poll_for_mediaed - successfully, False otherwise. -

- The poll_for_media_finish() method finishes - an operation started with - gio.Drive.poll_for_media() - on a drive. -

diff --git a/docs/html/class-gioemblem.html b/docs/html/class-gioemblem.html deleted file mode 100644 index 451f288..0000000 --- a/docs/html/class-gioemblem.html +++ /dev/null @@ -1,46 +0,0 @@ -gio.Emblem

gio.Emblem

gio.Emblem — An object for emblems.

Synopsis

class gio.Emblem(gobject.GObject, gio.Icon):
-    gio.Emblem(icon, origin=gio.EMBLEM_ORIGIN_UNKNOWN)
def get_icon()
def get_origin()
-Functions
- 
-    def gio.emblem_new_with_origin(icon, origin)

Ancestry

+-- gobject.GObject
-  +-- gio.Emblem
-

Implemented Interfaces

- gio.Emblem - implements - gio.Icon -

gio.Emblem Properties

"icon"Read - Write - Construct OnlyThe actual icon of the emblem.
"origin"Read - Write - Construct OnlyTells which origin the emblem is derived from.

Description

- The gio.Emblem - class is an implementation of gio.Icon - that supports having an emblem, which is an icon with additional properties. - It can then be added to a - gio.EmblemedIcon. -

- Currently, only metainformation about the emblem's origin is supported. - More may be added in the future. -

Constructor

    gio.Emblem(icon, origin=gio.EMBLEM_ORIGIN_UNKNOWN)

icon :

a - gio.Icon containing the icon. -

origin :

- origin of the emblem. -

Returns :

a new - gio.Emblem. -

Note

- Parameter origin is available since PyGObject 2.20. -

- Creates a new gio.Emblem for icon. -

Methods

gio.Emblem.get_icon

    def get_icon()

Returns :

a - gio.Icon. -

- The get_icon() method gives back the icon from emblem. -

gio.Emblem.get_origin

    def get_origin()

Returns :

the origin of the emblem. -

- The get_origin() method gets the origin of the emblem. -

Functions

gio.emblem_new_with_origin

    def emblem_new_with_origin(icon, origin)

origin :

a Gio Emblem Origin Constants - defining the emblem's origin. -

Returns :

A gio.Emblem. -

Note

- While this method is not deprecated, with 2.20 and up it is recommended - to use the constructor instead. -

- The emblem_new_with_origin() function creates - a new emblem for icon. -

diff --git a/docs/html/class-gioemblemedicon.html b/docs/html/class-gioemblemedicon.html deleted file mode 100644 index 12b7277..0000000 --- a/docs/html/class-gioemblemedicon.html +++ /dev/null @@ -1,38 +0,0 @@ -gio.EmblemedIcon

gio.EmblemedIcon

gio.EmblemedIcon — Icon with emblems.

Synopsis

class gio.EmblemedIcon(gobject.GObject, gio.Icon):
-    gio.EmblemedIcon(icon, emblem)
def add_emblem(emblem)
def get_icon()

Ancestry

+-- gobject.GObject
-  +-- gio.EmblemedIcon
-

Implemented Interfaces

- gio.EmblemedIcon - implements - gio.Icon -

Description

- The gio.EmblemedIcon - class is an implementation of gio.Icon - that supports adding an emblem to an icon. Adding multiple emblems to an icon is ensured via - gio.EmblemedIcon.add_emblem(). -

- Note that - gio.EmblemedIcon - allows no control over the position of the emblems. See also - gio.Emblem - for more information. -

Constructor

    gio.EmblemedIcon(icon, emblem)

icon :

a - gio.Icon. -

emblem :

a - gio.Emblem. -

Returns :

a new - gio.Icon. -

- Creates a new gio.Icon - for icon with the emblem emblem. -

Methods

gio.EmblemedIcon.add_emblem

    def add_emblem(emblem)

emblem :

a - gio.Emblem -

- The add_emblem() method adds emblem to the - list of gio.Emblems. -

gio.EmblemedIcon.get_icon

    def get_icon()

Returns :

a - gio.Icon - that is owned by emblemed. -

- The get_icon() method gets the main icon for emblemed. -

diff --git a/docs/html/class-giofile.html b/docs/html/class-giofile.html deleted file mode 100644 index 9f40126..0000000 --- a/docs/html/class-giofile.html +++ /dev/null @@ -1,1436 +0,0 @@ -gio.File

gio.File

gio.File — File and Directory Handling.

Synopsis

class gio.File(gobject.GInterface):
-    gio.File(commandline, path=None, uri=None)
def append_to(flags=gio.FILE_CREATE_NONE, cancellable=None)
def append_to_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def append_to_finish(result)
def copy(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)
def copy_async(destination, callback, progress_callback=None, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None, progress_callback_data=None)
def copy_attributes(destination, flags=gio.FILE_COPY_NONE, cancellable=None)
def copy_finish(result)
def create(flags=gio.FILE_CREATE_NONE, cancellable=None)
def create_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def create_finish(result)
def delete(cancellable=None)
def dup()
def eject_mountable(callback, flags=gio.FILE_CREATE_NONE, cancellable=None, user_data=None)
def eject_mountable_finish(result)
def enumerate_children(attributes, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def enumerate_children_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def enumerate_children_finish(result)
def equal(file2)
def find_enclosing_mount(cancellable)
def find_enclosing_mount_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def find_enclosing_mount_finish(result)
def get_basename()
def get_child(name)
def get_child_for_display_name(display_name)
def get_parent()
def get_parse_name()
def get_path()
def get_relative_path(descendant)
def get_uri()
def get_uri_scheme()
def has_prefix(prefix)
def has_uri_scheme(uri_scheme)
def is_native()
def load_contents(cancellable)
def load_contents_async(callback, cancellable=None, user_data=None)
def load_contents_finish(result)
def make_directory(cancellable=None)
def make_directory_with_parents(cancellable=None)
def make_symbolic_link(symlink_value, cancellable)
def monitor(flags=gio.FILE_MONITOR_NONE, cancellable=None)
def monitor_directory(flags, cancellable=None)
def monitor_file(flags, cancellable=None)
def mount_enclosing_volume(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_enclosing_volume_finish(result)
def mount_mountable(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_mountable_finish(result)
def move(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)
def query_default_handler(cancellable)
def query_exists(cancellable)
def query_file_type(flags, cancellable)
def query_filesystem_info(attributes, cancellable)
def query_filesystem_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_filesystem_info_finish(result)
def query_info(attributes, flags, cancellable)
def query_info_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)
def query_settable_attributes(cancellable=None)
def query_writable_namespace(cancellable=None)
def read(cancellable=None)
def read_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_finish(result=None)
def replace(etag, make_backup, flags=gio.FILE_CREATE_NONE, cancellable=None)
def replace_async(callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def replace_contents(contents, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, cancellable=None)
def replace_contents_async(contents, callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, cancellable=None, user_data=None)
def replace_contents_finish(result=None)
def replace_finish(result=None)
def resolve_relative_path(relative_path)
def set_attribute(attribute, type, value_p, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_byte_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_int32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_int64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_uint32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_uint64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attributes_async(info, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def set_attributes_finish(result)
def set_attributes_from_info(info, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_dispay_name(display_name, cancellable=None)
def set_display_name_async(display_name, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def set_display_name_finish(result)
def trash(cancellable=None)
def unmount_mountable(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def unmount_mountable_finish(cancellable=None)
-Functions
-    def gio.file_parse_name(parse_name)

Ancestry

+-- gobject.GInterface
-  +-- gio.File
-

Prerequisites

- gio.File is implemented by - gobject.GObject -

Description

- gio.File is a high - level abstraction for manipulating files on a virtual file system. - gio.Files are lightweight, - immutable objects that do no I/O upon creation. It is necessary to understand that - gio.File - objects do not represent files, merely an identifier for a file. All file content - I/O is implemented as streaming operations (see - gio.InputStream and - gio.OutputStream). -

- To construct a gio.File, you can use - it's constructor either with a path, an uri or a commandline argument. - gio.file_parse_name() - from a utf8 string gotten from - gio.File.get_parse_name(). -

- One way to think of a gio.File is as - an abstraction of a pathname. For normal files the system pathname is what is stored internally, - but as gio.Files are extensible it - could also be something else that corresponds to a pathname in a userspace implementation of a filesystem. -

- gio.Files make up hierarchies of - directories and files that correspond to the files on a filesystem. You can move through the - file system with GFile using - gio.File.get_parent() - to get an identifier for the parent directory, - gio.File.get_child() - to get a child within a directory, - gio.File.resolve_relative_path() - to resolve a relative path between two gio.Files. - There can be multiple hierarchies, so you may not end up at the same root if you repeatedly call - gio.File.get_parent() - on two different files. -

- All gio.Files have a basename (get with - gio.File.get_basename() - ). These names are byte strings that are used to identify the file on the filesystem - (relative to its parent directory) and there is no guarantees that they have any particular charset - encoding or even make any sense at all. If you want to use filenames in a user interface you should - use the display name that you can get by requesting the gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with - gio.File.query_info(). - This is guaranteed to be in utf8 and can be used in a user interface. But always store the real basename or the - GFile to use to actually access the file, because there is no way to go from a display name to the actual name. -

- Using gio.File as an identifier has the same - weaknesses as using a path in that there may be multiple aliases for the same file. For instance, - hard or soft links may cause two different gio.Files - to refer to the same file. Other possible causes for aliases are: case insensitive filesystems, short and - long names on Fat/NTFS, or bind mounts in Linux. If you want to check if two GFiles point to the same file - you can query for the gio.FILE_ATTRIBUTE_ID_FILE attribute. Note that - gio.File does some trivial canonicalization - of pathnames passed in, so that trivial differences in the path string used at creation - (duplicated slashes, slash at end of path, "." or ".." path segments, etc) does not create different - gio.Files. -

- Many gio.File operations have both synchronous - and asynchronous versions to suit your application. Asynchronous versions of synchronous functions simply - have _async() appended to their function names. The asynchronous I/O functions call a - GAsyncReadyCallback which is then used to finalize the operation, producing a GAsyncResult - which is then passed to the function's matching _finish() operation. -

- Some gio.File operations do not have - synchronous analogs, as they may take a very long time to finish, and blocking may leave an application - unusable. Notable cases include: - gio.File.mount_mountable() - to mount a mountable file. - gio.File.unmount_mountable() - to unmount a mountable file. - gio.File.eject_mountable() - to eject a mountable file. -

- One notable feature of gio.Files are - entity tags, or "etags" for short. Entity tags are somewhat like a more abstract - version of the traditional mtime, and can be used to quickly determine if the file - has been modified from the version on the file system. See the HTTP 1.1 - specification for HTTP Etag headers, which are a very similar concept. -

Constructor

    gio.File(commandline, path=None, uri=None)

commandline :

a command line string. -

path :

a string containing a relative or absolute path. -

uri :

a string containing a URI. -

Returns :

a new - gio.File. -

- Creates a new gio.File either from a commandline, - a path or an uri. -

Methods

gio.File.append_to

    def append_to(flags=gio.FILE_CREATE_NONE, cancellable=None)

flags :

a set of - Gio File Create Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.FileOutputStream - or None on error. -

- The append_to() method gets an output stream for - appending data to the file. If the file doesn't already exist it is created. -

- By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to the - current user, to the level that is supported on the target filesystem. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If - the operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

- Some file systems don't allow all file names, and may return an - gio.ERROR_INVALID_FILENAME error. If the file is a directory the - gio.ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, - and depend on what kind of filesystem the file is on. -

gio.File.append_to_async

    def append_to_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Create Flags Constants. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The append_to_async() method asynchronously opens file for appending. -

- For more details, see - gio.File.append_to() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.append_to_finish() - to get the result of the operation. -

gio.File.append_to_finish

    def append_to_finish(result)

result :

a gio.AsyncResult. -

Returns :

a valid - gio.OutputStream - or None on error. -

- The append_to_finish() method finishes an asynchronous - file append operation started with - gio.File.append_to_async(). -

gio.File.copy

    def copy(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)

destination :

destination gio.File. -

progress_callback :

function to callback with progress information. -

flags :

a set of - Gio File Copy Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to the progress callback function. -

Returns :

True on success, - False otherwise. -

- The copy() method copies the file source to - the location specified by destination. Can not handle recursive copies of directories. -

- If the flag gio.FILE_COPY_OVERWRITE is specified an already existing - destination file is overwritten. -

- If the flag gio.FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will - be copied as symlinks, otherwise the target of the source symlink will be copied. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- If progress_callback is not None, then the operation can be - monitored by setting this to a GFileProgressCallback function. user_data - will be passed to this function. It is guaranteed that this callback will be - called after all data has been transferred with the total number of bytes - copied during the operation. -

- If the source file does not exist then the gio.ERROR_NOT_FOUND error is returned, - independent on the status of the destination. -

- If gio.FILE_COPY_OVERWRITE is not specified and the target exists, - then the error gio.ERROR_EXISTS is returned. -

- If trying to overwrite a file over a directory the gio.ERROR_IS_DIRECTORY error - is returned. If trying to overwrite a directory with a directory the - gio.ERROR_WOULD_MERGE error is returned. -

- If the source is a directory and the target does not exist, or gio.FILE_COPY_OVERWRITE - is specified and the target is a file, then the gio.ERROR_WOULD_RECURSE error is returned. -

- If you are interested in copying the - gio.File object - itself (not the on-disk file), see - gio.File.dup(). -

gio.File.copy_async

    def append_to_async(destination, callback, progress_callback=None, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None, progress_callback_data=None)

destination :

destination gio.File. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

progress_callback :

function to callback with progress information. -

flags :

a set of - Gio File Copy Flags Constants. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

progress_callback_data :

the data to pass to the progress callback function. -

- The copy_async() method copies the file source to - the location specified by destination asynchronously. For details of the behaviour, - see gio.File.copy(). -

- If progress_callback is not None, then that function that will - be called just like in - gio.File.copy(), - however the callback will run in the main loop, not in the thread that is doing the I/O operation. -

- When the operation is finished, callback will be called. You can then call - gio.File.copy_finish() - to get the result of the operation. -

gio.File.copy_attributes

    def copy_attributes(destination, flags=gio.FILE_COPY_NONE, cancellable=None)

destination :

destination gio.File - to copy attributes to. -

flags :

a set of - Gio File Copy Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attributes were copied successfully, - False otherwise. -

- The copy_attributes() method copies the file attributes - from source to destination. -

- Normally only a subset of the file attributes are copied, those that are copies - in a normal file copy operation (which for instance does not include e.g. owner). - However if gio.FILE_COPY_ALL_METADATA is specified in flags, then all the metadata - that is possible to copy is copied. This is useful when implementing move by copy + delete source. -

gio.File.copy_finish

    def copy_finish(result)

result :

a gio.AsyncResult. -

Returns :

True on success, - False on error. -

- The copy_finish() method finishes an asynchronous - copy operation started with - gio.File.copy_async(). -

gio.File.create

    def create(flags=gio.FILE_CREATE_NONE, cancellable=None)

flags :

a set of - Gio File Create Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.FileOutputStream - or None on error. -

- The create() method creates a new file and returns - an output stream for writing to it. The file must not already exist. -

- By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to the - current user, to the level that is supported on the target filesystem. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

- If a file or directory with this name already exists the gio.ERROR_EXISTS - error will be returned. Some file systems don't allow all file names, and - may return an gio.ERROR_INVALID_FILENAME error, and if the name is to long - gio.ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible too, - and depend on what kind of filesystem the file is on. -

gio.File.create_async

    def create_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Copy Flags Constants. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The create_async() method asynchronously creates a new - file and returns an output stream for writing to it. The file must not already exist. -

- For more details, see - gio.File.create() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.create_finish() - to get the result of the operation. -

gio.File.create_finish

    def create_finish(result)

result :

a gio.AsyncResult. -

Returns :

a - gio.FileOutputStream - or None on error. -

- The create_finish() method finishes an asynchronous - copy operation started with - gio.File.create_async(). -

gio.File.delete

    def delete(cancellable)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the file was deleted, - False otherwise. -

- The deleted() method deletes a file. If the file is a - directory, it will only be deleted if it is empty. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.dup

    def dup()

Returns :

a new gio.File - that is a duplicate of the given gio.File. -

- The dup() method duplicates a - gio.File - handle. This operation does not duplicate the actual file or directory represented - by the gio.File; see - gio.File.copy() - if attempting to copy a file. -

- This call does no blocking i/o. -

gio.File.eject_mountable

    def eject_mountable(callback, flags=gio.FILE_CREATE_NONE, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Copy Flags Constants. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The eject_mountable() method starts an asynchronous eject on a - mountable. When this operation has completed, callback will be called with - user_user data, and the operation can be finalized with - gio.File.eject_mountable_finish(). -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.eject_mountable_finish

    def eject_mountable_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the file was ejected successfully, - False on error. -

- The create_finish() method finishes an asynchronous - copy operation started with - gio.File.create_async(). -

gio.File.enumerate_children

    def enumerate_children(attributes, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attributes :

an attribute query string. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.FileEnumerator - or None on error. -

- The enumerate_children() method gets the requested information - about the files in a directory. The result is a GFileEnumerator object that will give out - gio.FileInfo objects - for all the files in the directory. -

- The attribute value is a string that specifies the file attributes that should be gathered. - It is not an error if it's not possible to read a particular requested attribute from a file - - it just won't be set. attribute should be a comma-separated list of attribute or attribute - wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all - attributes in the standard namespace. An example attribute query be "standard::*,owner::user". - The standard attributes are available as defines, like gio.FILE_ATTRIBUTE_STANDARD_NAME. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

- If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. If the file - is not a directory, the gio.FILE_ERROR_NOTDIR error will be returned. - Other errors are possible too. -

gio.File.enumerate_children_async

    def enumerate_children_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

attributes :

an attribute query string. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Query Info Flags Constants. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The enumerate_children_async() method asynchronously gets the - requested information about the files in a directory. The result is a - gio.FileEnumerator - object that will give out gio.FileInfo - objects for all the files in the directory. -

- For more details, see - enumerate_children() - which is the synchronous version of this call. -

gio.File.eject_mountable_finish

    def enumerate_children_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileEnumerator - or None if an error occurred. -

- The enumerate_children_finish() method finishes an asynchronous - copy operation started with - gio.File.enumerate_children_async(). -

gio.File.equal

    def equal(file2)

file2 :

a gio.File. -

Returns :

True if file1 and file2 are equal. - False if either is not a - gio.File. -

- The equal() method checks equality of two given - gio.Files. - Note that two gio.Files - that differ can still refer to the same file on the filesystem due to various - forms of filename aliasing. -

- This call does no blocking i/o. -

gio.File.find_enclosing_mount

    def enumerate_children(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.Mount - or None on error. -

- The find_enclosing_mount() method gets a - gio.Mount for the - gio.File. -

- If the interface for file does not have a mount (e.g. possibly a remote share), - error will be set to gio.ERROR_NOT_FOUND and None will be returned. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.find_enclosing_mount_async

    def find_enclosing_mount_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The find_enclosing_mount_async() method asynchronously - gets the mount for the file. -

- For more details, see - gio.File.find_enclosing_mount() - which is the synchronous version of this call. -

gio.File.find_enclosing_mount_finish

    def find_enclosing_mount_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.Mount - or None if an error occurred. -

- The find_enclosing_mount_finish() method finishes an asynchronous - find mount started with - gio.File.find_enclosing_mount_async(). -

gio.File.get_basename

    def get_basename()

Returns :

string containing the - gio.File's - base name, or None if given - gio.File is invalid. -

- The get_basename() method gets the base name - (the last component of the path) for a given - gio.File. -

- If called for the top level of a system (such as the filesystem root or - a uri like sftp://host/) it will return a single directory separator - (and on Windows, possibly a drive letter). -

- The base name is a byte string (*not* UTF-8). It has no defined encoding - or rules other than it may not contain zero bytes. If you want to use filenames - in a user interface you should use the display name that you can get by requesting - the gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with - gio.File.query_info(). -

- This call does no blocking i/o. -

gio.File.get_child

    def get_child(name)

name :

string containing the child's basename. -

Returns :

a - gio.File - to a child specified by name. -

- The get_child() method gets a child of file - with basename equal to name. -

- Note that the file with that specific name might not exist, but you can - still have a gio.File - that points to it. You can use this for instance to create that file. -

- This call does no blocking i/o. -

gio.File.get_child_for_display_name

    def get_child_for_display_name(display_name)

display_name :

string to a possible child. -

Returns :

a - gio.File - to the specified child or None - if the display name couldn't be converted. -

- The get_child_for_display_name() method gets the - child of file for a given display_name (i.e. a UTF8 version of the name). - If this function fails, it returns NULL and error will be set. This is very - useful when constructing a GFile for a new file and the user entered the filename - in the user interface, for instance when you select a directory and type a filename - in the file selector. -

- This call does no blocking i/o. -

gio.File.get_parent

    def get_parent()

Returns :

a - gio.File - structure to the parent of the given - gio.File or - None if there is no parent. -

- The get_parent() method gets the parent directory for the file. - If the file represents the root directory of the file system, then None - will be returned. -

- This call does no blocking i/o. -

gio.File.get_parse_name

    def get_parse_name()

Returns :

a string containing the - gio.File's parse name. -

- The get_parse_name() method gets the parse name - of the file. A parse name is a UTF-8 string that describes the file such - that one can get the gio.File - back using - gio.file_parse_name(). -

- This is generally used to show the gio.File - as a nice full-pathname kind of string in a user interface, like in a location entry. -

- For local files with names that can safely be converted to UTF8 the pathname is used, - otherwise the IRI is used (a form of URI that allows UTF8 characters unescaped). -

- This call does no blocking i/o. -

gio.File.get_path

    def get_path()

Returns :

a string containing the - gio.File's path, - or None if no such path exists. -

- The get_path() method gets the local pathname for - gio.File, if one exists. -

- This call does no blocking i/o. -

gio.File.get_relative_path

    def get_relative_path(descendant)

descendant :

input gio.File. -

Returns :

string with the relative path from descendant to parent, - or None if descendant doesn't have parent as prefix. -

- The get_relative_path() method gets the path for - descendant relative to parent. -

- This call does no blocking i/o. -

gio.File.get_uri

    def get_uri()

Returns :

a string containing the - gio.File's URI. -

- The get_uri() method gets the URI for the file. -

- This call does no blocking i/o. -

gio.File.get_uri_scheme

    def get_uri_scheme()

Returns :

a string containing the URI scheme for the - gio.File. -

- The get_uri_scheme() method gets the URI scheme for a - gio.File. - RFC 3986 decodes the scheme as: -

-URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
-

- Common schemes include "file", "http", "ftp", etc. -

- This call does no blocking i/o. -

gio.File.has_prefix

    def has_prefix(prefix)

prefix :

input gio.File. -

Returns :

True if the files's parent, grandparent, - etc is prefix. False otherwise. -

- The has_prefix() method checks whether file has the prefix - specified by prefix. In other word, if the names of inital elements of files pathname - match prefix. Only full pathname elements are matched, so a path like /foo is not - considered a prefix of /foobar, only of /foo/bar. -

- This call does no blocking i/o, as it works purely on names. As such it can sometimes - return False even if file is inside a prefix (from a filesystem point - of view), because the prefix of file is an alias of prefix. -

gio.File.has_uri_scheme

    def has_uri_scheme(uri_scheme)

uri_scheme :

a string containing a URI scheme. -

Returns :

True if - gio.File's - backend supports the given URI scheme, False if URI scheme - is None, not supported, or - gio.File is invalid. -

- The has_uri_scheme() method checks to see if a - gio.File - has a given URI scheme. -

- This call does no blocking i/o. -

gio.File.is_native

    def is_native()

Returns :

True if file is native. -

- The is_native() method checks to see if a file - is native to the platform. -

- A native file s one expressed in the platform-native filename format, e.g. - "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it - might be on a locally mounted remote filesystem. -

- On some systems non-native files may be available using the native filesystem - via a userspace filesystem (FUSE), in these cases this call will return - False, but - gio.File.get_path() - will still return a native path. -

- This call does no blocking i/o. -

gio.File.load_contents

    def load_contents(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a three tuple containing the contents of the file, - the length of the contents of the file and the current entity tag for the file. -

- The load_contents() method loads the content of the file into memory. - The data is always zero-terminated, but this is not included in the resultant length. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.load_contents_async

    def load_contents_async(callback, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The load_contents_async() method starts an asynchronous load of the file's contents. -

- For more details, see - gio.File.load_contents() - which is the synchronous version of this call. -

- When the load operation has completed, callback will be called with user data. To finish - the operation, call - gio.File.load_contents_finish() - with the GAsyncResult returned by the callback. -

gio.File.load_contents_finish

    def load_contents_finish(result)

result :

a gio.AsyncResult. -

Returns :

a three tuple containing the contents of the file, - the length of the contents of the file and the current entity tag for the file. -

- The load_contents_finish() method finishes an asynchronous - find mount started with - gio.File.load_contents_async(). -

gio.File.make_directory

    def make_directory(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True on successful creation, - False otherwise. -

- The make_directory() method creates a directory. - Note that this will only create a child directory of the immediate parent directory - of the path or URI given by the gio.File. - To recursively create directories, see - gio.File.make_directory_with_parents(). - This function will fail if the parent directory does not exist, setting error to - gio.ERROR_NOT_FOUND. If the file system doesn't support creating directories, this - function will fail, setting error to gio.ERROR_NOT_SUPPORTED. -

- For a local gio.File the newly - created directory will have the default (current) ownership and permissions of the current process. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.make_directory_with_parents

    def make_directory_with_parents(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if all directories have been successfully created, - False otherwise. -

- The make_directory_with_parents() method creates a directory - and any parent directories that may not exist similar to 'mkdir -p'. If the file system - does not support creating directories, this function will fail, setting error to gio.ERROR_NOT_SUPPORTED. -

- For a local gio.File the newly - created directories will have the default (current) ownership and permissions of the current process. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.make_symbolic_link

    def make_symbolic_link(symlink_value, cancellable=None)

symlink_value :

a string with the value of the new symlink.

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True on the creation of a new symlink, - False otherwise. -

- The make_symbolic_link() method creates a symbolic link. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.monitor

    def monitor(flags=gio.FILE_MONITOR_NONE, cancellable=None)

flags :

- a Gio File Monitor Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.FileMonitor - for the given file, or None on error -

- The monitor() method obtains a file or directory - monitor for the given file, depending on the type of the file. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.monitor_directory

    def monitor_directory(flags=gio.FILE_MONITOR_NONE, cancellable=None)

flags :

- a Gio File Monitor Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.FileMonitor - for the given file, or None on error -

- The monitor_directory() method obtains a directory monitor - for the given file. This may fail if directory monitoring is not supported. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.monitor_file

    def monitor_file(flags=gio.FILE_MONITOR_NONE, cancellable=None)

flags :

- a Gio File Monitor Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.FileMonitor - for the given file, or None on error -

- The monitor_file() method obtains a file monitor for the - given file. If no file notification mechanism exists, then regular polling - of the file is used. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.mount_enclosing_volume

    def mount_enclosing_volume(mount_operation, callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)

mount_operation :

a - gio.MountOperation - or None to avoid user interaction. -

callback :

a GAsyncReadyCallback to call when the request - is satisfied, or None. -

flags :

a set of - Gio Mount Mount Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to the progress callback function. -

- The mount_enclosing_volume() method starts a mount_operation, - mounting the volume that contains the file location. -

- When this operation has completed, callback will be called with user_user data, - and the operation can be finalized with - gio.File.mount_enclosing_volume_finish(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.mount_enclosing_volume_finish

    def mount_enclosing_volume_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if successful. If an error has occurred, - this function will return False and set error appropriately if present. -

- The mount_enclosing_volume_finish() method finishes an asynchronous - find mount started with - gio.File.mount_enclosing_volume(). -

gio.File.mount_mountable

    def mount_mountable(mount_operation, callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)

mount_operation :

a - gio.MountOperation - or None to avoid user interaction. -

callback :

a GAsyncReadyCallback to call when the request - is satisfied, or None. -

flags :

a set of - Gio Mount Mount Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to the progress callback function. -

- The mount_mountable() method mounts a file of type - gio.FILE_TYPE_MOUNTABLE. Using mount_operation, you can request callbacks when, - for instance, passwords are needed during authentication. -

- When this operation has completed, callback will be called with user_user data, - and the operation can be finalized with - gio.File.mount_mountable_finish(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.mount_mountable_finish

    def mount_mountable_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.File - or None on error. -

- The mount_mountable_finish() method finishes an asynchronous - find mount started with - gio.File.mount_mountable(). -

gio.File.move

    def copy(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)

destination :

destination gio.File. -

progress_callback :

function to callback with progress information. -

flags :

a set of - Gio File Copy Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to the progress callback function. -

Returns :

True on success, - False otherwise. -

- The move() method tries to move the file or directory - source to the location specified by destination. If native move operations are - supported then this is used, otherwise a copy + delete fallback is used. The native - implementation may support moving directories (for instance on moves inside the same - filesystem), but the fallback code does not. -

- If the flag gio.FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten. -

- If the flag gio.FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied - as symlinks, otherwise the target of the source symlink will be copied. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- If progress_callback is not None, then the operation can be monitored - by setting this to a GFileProgressCallback function. progress_callback_data will be passed - to this function. It is guaranteed that this callback will be called after all data has been - transferred with the total number of bytes copied during the operation. -

- If the source file does not exist then the gio.ERROR_NOT_FOUND error is returned, - independent on the status of the destination. -

- If gio.FILE_COPY_OVERWRITE is not specified and the target exists, then the error - gio.ERROR_EXISTS is returned. -

- If trying to overwrite a file over a directory the gio.ERROR_IS_DIRECTORY error is returned. - If trying to overwrite a directory with a directory the gio.ERROR_WOULD_MERGE error is returned. -

- If the source is a directory and the target does not exist, or gio.FILE_COPY_OVERWRITE is specified - and the target is a file, then the gio.ERROR_WOULD_RECURSE error may be returned - (if the native move operation isn't available). -

gio.File.query_default_handler

    def query_default_handler(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.AppInfo - if the handle was found, None if there were errors. -

- The query_default_handler() method returns the - gio.AppInfo that - is registered as the default application to handle the file specified by file. -

- If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. -

gio.File.query_exists

    def query_exists(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the file exists (and can be detected - without error), False otherwise (or if cancelled). -

- The query_exists() method is an tility function to check - if a particular file exists. This is implemented using - gio.File.query_info() - and as such does blocking I/O. -

- Note that in many cases it is racy to first check for file existence and then execute - something based on the outcome of that, because the file might have been created or - removed in between the operations. The general approach to handling that is to not check, - but just do the operation and handle the errors as they come. -

- As an example of race-free checking, take the case of reading a file, and if it doesn't - exist, creating it. There are two racy versions: read it, and on error create it; and: - check if it exists, if not create it. These can both result in two processes creating the - file (with perhaps a partially written file as the result). The correct approach is to - always try to create the file with - gio.File.create() - which will either atomically create the file or fail with a gio.ERROR_EXISTS error. -

- However, in many cases an existence check is useful in a user interface, for instance - to make a menu item sensitive/insensitive, so that you don't have to fool users that - something is possible and then just show and error dialog. If you do this, you should - make sure to also handle the errors that can happen due to races when you execute the operation. -

gio.File.query_file_type

    def query_file_type(flags=gio.FILE_MONITOR_NONE, cancellable=None)

flags :

- a Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

- Gio File Type Constants -

- The query_file_type() method it's an utility function to inspect - the Gio File Query Info Flags Constants - of a file. This is implemented using - gio.File.query_info() - and as such does blocking I/O. -

- The primary use case of this method is to check if a file is a regular file, directory, or symlink. -

gio.File.query_filesystem_info

    def query_filesystem_info(attributes, cancellable=None)

attributes :

an attribute query string. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.FileInfo - or None if there was an error. -

- The query_filesystem_info() method it's similar to - gio.File.query_info(), - but obtains information about the filesystem the file is on, rather than the - file itself. For instance the amount of space available and the type of the filesystem. -

- The attribute value is a string that specifies the file attributes that should be gathered. - It is not an error if it's not possible to read a particular requested attribute from a file - - it just won't be set. attribute should be a comma-separated list of attribute or attribute - wildcards. The wildcard "*" means all attributes, and a wildcard like "fs:*" means all attributes - in the fs namespace. The standard namespace for filesystem attributes is "fs". Common attributes - of interest are gio.FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem in bytes), - gio.FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available), and gio.FILE_ATTRIBUTE_FILESYSTEM_TYPE - (type of the filesystem). -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

- If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. Other errors - are possible too, and depend on what kind of filesystem the file is on. -

gio.File.query_filesystem_info_async

    def query_filesystem_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

attributes :

an attribute query string. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The query_filesystem_info_async() method asynchronously - gets the requested information about the filesystem that the specified file is on. - The result is a GFileInfo object that contains key-value attributes - (such as type or size for the file). -

- For more details, see - query_filesystem_info() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.query_filesystem_info_finish() - to get the result of the operation. -

gio.File.query_filesystem_info_finish

    def query_filesystem_info_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileInfo - or None if an error occurred. -

- The query_filesystem_info_finish() method finishes an asynchronous - copy operation started with - gio.File.query_filesystem_info_async(). -

gio.File.query_filesystem_info

    def query_info(attributes, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attributes :

an attribute query string. -

flags :

- a Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.FileInfo - for the given file or None if there was an error. -

- The query_info() method gets the requested - information about specified file. The result is a - gio.FileInfo - object that contains key-value attributes (such as the type or size of the file). -

- The attribute value is a string that specifies the file attributes that should - be gathered. It is not an error if it's not possible to read a particular - requested attribute from a file - it just won't be set. attribute should be - a comma-separated list of attribute or attribute wildcards. The wildcard "*" - means all attributes, and a wildcard like "standard::*" means all attributes - in the standard namespace. An example attribute query be "standard::*,owner::user". - The standard attributes are available as defines, like gio.FILE_ATTRIBUTE_STANDARD_NAME. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

- For symlinks, normally the information about the target of the symlink is returned, - rather than information about the symlink itself. However if you pass - gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in flags the information about - the symlink itself will be returned. Also, for symlinks that point to non-existing - files the information about the symlink itself will be returned. -

- If the file does not exist, the gio.ERROR_NOT_FOUND error will be - returned. Other errors are possible too, and depend on what kind of - filesystem the file is on. -

gio.File.query_info_async

    def query_info_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

attributes :

an attribute query string. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

- a Gio File Query Info Flags Constants -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The query_info_async() method asynchronously gets the - requested information about specified file. The result is a - gio.FileInfo - object that contains key-value attributes (such as type or size for the file). -

- For more details, see - query_info() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.query_info_finish() - to get the result of the operation. -

gio.File.query_info_finish

    def query_info_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileInfo - for the given file or None if an error occurred. -

- The query_info_finish() method finishes an asynchronous - copy operation started with - gio.File.query_info_async(). -

gio.File.query_settable_attributes

    def query_settable_attributes(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a list of - gio.FileAttributeInfo - describing the settable attributes. -

- The query_settable_attributes() method obtain the - list of settable attributes for the file. -

- Returns the type and full attribute name of all the attributes that can be - set on this file. This doesn't mean setting it will always succeed though, - you might get an access failure, or some specific file may not support a specific attribute. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.query_writable_namespace

    def query_writable_namespace(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a list of - gio.FileAttributeInfo - describing the writable namespaces. -

- The query_writable_namespace() method obtain the - list of attribute namespaces where new attributes can be created by a user. - An example of this is extended attributes (in the "xattr" namespace). -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.read

    def read(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.FileInputStream - or None on error. -

- The read() method opens a file for reading. The result - is a gio.FileInputStream - that can be used to read the contents of the file. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

- If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. - If the file is a directory, the gio.ERROR_IS_DIRECTORY error will be returned. - Other errors are possible too, and depend on what kind of filesystem the file is on. -

gio.File.read_async

    def read_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The read_async() method asynchronously opens file for reading. -

- For more details, see - read() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.read_finish() - to get the result of the operation. -

gio.File.read_finish

    def read_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileInputStream - file or None if an error occurred. -

- The read_finish() method finishes an asynchronous - copy operation started with - gio.File.read_async(). -

gio.File.replace

    def replace(etag, make_backup, flags=gio.FILE_CREATE_NONE, cancellable=None)

etag :

an optional entity tag for the current - gio.File, - or None to ignore. -

make_backup :

True if a backup should be created. -

flags :

a set of - Gio File Create Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a - gio.FileOutputStream - or None on error. -

- The replace() method returns an output stream for - overwriting the file, possibly creating a backup copy of the file first. - If the file doesn't exist, it will be created. -

- This will try to replace the file in the safest way possible so that any - errors during the writing will not affect an already existing copy of the file. - For instance, for local files it may write to a temporary file and then atomically - rename over the destination when the stream is closed. -

- By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to - the current user, to the level that is supported on the target filesystem. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

- If you pass in a non-None etag value, then this value is compared - to the current entity tag of the file, and if they differ an gio.ERROR_WRONG_ETAG error - is returned. This generally means that the file has been changed since you last read it. - You can get the new etag from - gio.FileOutputStream.get_etag() - after you've finished writing and closed the GFileOutputStream. When you load a new file you can use - gio.FileInputStream.query_info() - to get the etag of the file. -

- If make_backup is True, this function will attempt to make a backup - of the current file before overwriting it. If this fails a gio.ERROR_CANT_CREATE_BACKUP - error will be returned. If you want to replace anyway, try again - with make_backup set to False. -

- If the file is a directory the gio.ERROR_IS_DIRECTORY error will be returned, and - if the file is some other form of non-regular file then a gio.ERROR_NOT_REGULAR_FILE - error will be returned. Some file systems don't allow all file names, and may return an - gio.ERROR_INVALID_FILENAME error, and if the name is to long gio.ERROR_FILENAME_TOO_LONG - will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. -

gio.File.replace_async

    def replace_async(callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

etag :

an optional entity tag for the current - gio.File, - or None to ignore. -

make_backup :

True if a backup should be created. -

flags :

a set of - Gio File Create Flags Constants -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The replace_async() method asynchronously overwrites the file, - replacing the contents, possibly creating a backup copy of the file first. -

- For more details, see - replace() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.replace_finish() - to get the result of the operation. -

gio.File.replace_contents

    def replace_contents(contents, etag, make_backup, flags=gio.FILE_CREATE_NONE, cancellable=None)

contents :

a string containing the new contents for file. -

etag :

the old entity tag for the document - or None to ignore. -

make_backup :

True if a backup should be created. -

flags :

a set of - Gio File Create Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

the new entity tag for the document. -

- The replace_contents() method replaces the contents - of file with contents of length bytes. If etag is specified (not NULL) any existing - file must have that etag, or the error gio.ERROR_WRONG_ETAG will be returned. -

- If make_backup is True, this function will attempt to make a backup of file. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

- The returned etag can be used to verify that the file hasn't changed the next time it is saved over. -

gio.File.replace_contents_async

    def replace_contents_async(contents, callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

contents :

a string containing the new contents for file. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

etag :

an optional entity tag for the current - gio.File, - or None to ignore. -

make_backup :

True if a backup should be created. -

flags :

a set of - Gio File Create Flags Constants -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The replace_contents_async() method starts an asynchronous - replacement of file with the given contents of length bytes. etag will - replace the document's current entity tag. -

- For more details, see - replace_contents() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.replace_contents_finish() - to get the result of the operation. -

gio.File.replace_contents_finish

    def replace_contents_finish(result)

result :

a gio.AsyncResult. -

Returns :

the new entity tag for the document. -

- The replace_contents_finish() method finishes an asynchronous - copy operation started with - gio.File.replace_contents_async(). -

gio.File.replace_finish

    def replace_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileOutputStream - or None if an error occurred. -

- The replace_finish() method finishes an asynchronous - copy operation started with - gio.File.replace_async(). -

gio.File.resolve_relative_path

    def resolve_relative_path(relative_path)

relative_path :

a given relative path string. -

Returns :

a gio.File - to the resolved path. None if relative_path is None - or if file is invalid. -

- The resolve_relative_path() method resolves a - relative path for file to an absolute path. -

- This call does no blocking i/o. -

gio.File.set_attribute

    def set_attribute(attribute, type, value_p, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

type :

the type of the attribute . -

value_p :

the value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute() method sets an attribute in - the file with attribute name attribute to value. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_byte_string

    def set_attribute_byte_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

a string containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_byte_string() method Sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING to value. If attribute is of a different type, - this operation will fail, returning False. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_int32

    def set_attribute_int32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

an int containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_int32() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_INT32 to value. If attribute is of a different type, - this operation will fail. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_int64

    def set_attribute_int64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

a long containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_int64() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_INT64 to value. If attribute is of a different type, - this operation will fail. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_string

    def set_attribute_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

a string containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_string() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_STRING to value. If attribute is of a different type, - this operation will fail. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_uint32

    def set_attribute_uint32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

an int containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_uint32() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_UINT32 to value. If attribute is of a different type, - this operation will fail. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attribute_uint64

    def set_attribute_uint64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

attribute :

a string containing the attribute's name. -

value :

a long containing the attribute's new value. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attribute was set, - False otherwise. -

- The set_attribute_uint64() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_UINT64 to value. If attribute is of a different type, - this operation will fail. -

- If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. -

gio.File.set_attributes_async

    def set_attributes_async(info, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

info :

a gio.FileInfo -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Query Info Flags Constants -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The set_attributes_async() method asynchronously - sets the attributes of file with info. -

- For more details, see - set_attributes_from_info() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.set_attributes_finish() - to get the result of the operation. -

gio.File.set_attributes_finish

    def set_attributes_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the attributes were set correctly, - False otherwise. -

- The set_attributes_finish() method finishes an asynchronous - copy operation started with - gio.File.set_attributes_async(). -

gio.File.set_attributes_from_info

    def set_attributes_from_info(info, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)

info :

a gio.FileInfo -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True if the attributes were set correctly, - False otherwise. -

- The set_attributes_from_info() method tries to set - all attributes in the GFileInfo on the target values, not stopping on the first error. -

- If there is any error during this operation then error will be set to the - first error. Error on particular fields are flagged by setting the "status" - field in the attribute value to gio.FILE_ATTRIBUTE_STATUS_ERROR_SETTING, - which means you can also detect further errors. -

-

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.set_display_name

    def set_display_name(display_name, cancellable=None)

display_name :

a string conaining the name to display. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

a gio.File - specifying what file was renamed to, or None if there was an error. -

- The set_display_name() method renames file to - the specified display name. -

- The display name is converted from UTF8 to the correct encoding for the - target filesystem if possible and the file is renamed to this. -

- If you want to implement a rename operation in the user interface the - edit name (gio.FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the - initial value in the rename widget, and then the result after editing - should be passed to - gio.File.set_dispay_name(). -

- On success the resulting converted filename is returned. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.set_display_name_async

    def set_display_name_async(display_name, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

display_name :

a string conaining the name to display. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The set_display_name_async() method asynchronously - sets the display name for a given GFile. -

- For more details, see - set_display_name() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.File.set_display_name_finish() - to get the result of the operation. -

gio.File.set_display_name_finish

    def set_display_name_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.File - or None on error. -

- The set_display_name_finish() method finishes an asynchronous - copy operation started with - gio.File.set_display_name_async(). -

gio.File.trash

    def trash(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore.

Returns :

True on successful trash, False otherwise. -

- The trash() method sends file to the "Trashcan", if possible. - This is similar to deleting it, but the user can recover it before emptying the trashcan. - Not all file systems support trashing, so this call can return the gio.ERROR_NOT_SUPPORTED error. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

gio.File.unmount_mountable

    def unmount_mountable(callback, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

flags :

a set of - Gio File Query Info Flags Constants -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The unmount_mountable() method unmounts a file of type gio.FILE_TYPE_MOUNTABLE. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- When the operation is finished, callback will be called. You can then call - gio.File.unmount_mountable_finish() - to get the result of the operation. -

gio.File.unmount_mountable_finish

    def unmount_mountable_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the operation finished successfully, - False otherwise. -

- The unmount_mountable_finish() method finishes an asynchronous - copy operation started with - gio.File.unmount_mountable(). -

Functions

gio.file_parse_name

    def file_parse_name(parse_name)

parse_name :

a file name or path to be parsed. -

Returns :

a new gio.File. -

- The parse_name() function constructs a - gio.File - with the given parse_name (i.e. something given by g_file_get_parse_name()). - This operation never fails, but the returned object might not support any I/O - operation if the parse_name cannot be parsed. -

diff --git a/docs/html/class-giofileattributeinfo.html b/docs/html/class-giofileattributeinfo.html deleted file mode 100644 index 8e69c3a..0000000 --- a/docs/html/class-giofileattributeinfo.html +++ /dev/null @@ -1,11 +0,0 @@ -gio.FileAttributeInfo

gio.FileAttributeInfo

gio.FileAttributeInfo — Information about a specific attribute.

Synopsis

class gio.FileAttributeInfo(__builtin__.object):
-

Ancestry

+-- __builtin__.object
-  +-- gio.FileAttributeInfo
-

Description

- The gio.FileAttributeInfo - contains information about a specific attribute. -

gio.FileAttributeInfo Attributes

"name"ReadThe name of the attribute.
"type"Readthe - Gio File Attribute Type Constants - type of the attribute.
"flags"Reada set of - Gio File Attribute Flags Constants. -
diff --git a/docs/html/class-giofileenumerator.html b/docs/html/class-giofileenumerator.html deleted file mode 100644 index d50118e..0000000 --- a/docs/html/class-giofileenumerator.html +++ /dev/null @@ -1,126 +0,0 @@ -gio.FileEnumerator

gio.FileEnumerator

gio.FileEnumerator — Enumerated Files Routines.

Synopsis

class gio.FileEnumerator(gobject.GObject):
-    def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def get_container()
def has_pending()
def is_closed()
def next_file(cancellable=None)
def next_files_async(num_files, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def next_files_finish(result)
def set_pending(pending)

gio.FileEnumerator Properties

"container"Write - Construct onlyThe container that is being enumerated.

Description

- The gio.FileEnumerator - allows you to operate on a set of - gio.Files - returning a - gio.FileInfo - structure for each file enumerated (e.g. - gio.File.enumerate_children() - will return a The gio.FileEnumerator - for each of the children within a directory). -

- To get the next file's information from a - The gio.FileEnumerator use - gio.FileEnumerator.next_file() - or its asynchronous version, - gio.FileEnumerator.next_files_async(). - Note that the asynchronous version will return a list of - gio.FileInfos, - whereas the synchronous will only return the next file in the enumerator. -

- To close a gio.FileEnumerator - use close, - or its asynchronous version, - close_async. - Once a gio.FileEnumerator - is closed, no further actions may be performed on it. -

Methods

gio.FileEnumerator.close

    def close(cancellable=None)

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

Returns :

True on success or - False on error. -

- The close() method releases all resources used by this - enumerator, making the - Gio Error Constants - return gio.ERROR_CLOSED on all calls. -

- This will be automatically called when the last reference is dropped, - but you might want to call this function to make sure resources are released - as early as possible. -

gio.FileEnumerator.close_async

    def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

The - Glib Priority Constants of the request. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The close_async() method asynchronously closes the file enumerator. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned in - gio.FileEnumerator.close_finish(). -

gio.FileEnumerator.close_finish

    def close_finish(result)

result :

a GAsyncResult. -

Returns :

True if the close operation - has finished successfully.

- The close_finish() method finishes closing a file enumerator, started from - gio.FileEnumerator.close_async(). -

- If the file enumerator was already closed when - gio.FileEnumerator.close_async() - was called, then this function will report gio.ERROR_CLOSED in error, and return False. - If the file enumerator had pending operation when the close operation was started, then this function will report - gio.ERROR_PENDING, and return False. If cancellable was not None, then the operation - may have been cancelled by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be set, and False will be returned. -

gio.FileEnumerator.get_container

    def get_container()

Returns :

the gio.File - which is being enumerated.

- The get_container() method gets the - gio.File - container which is being enumerated. -

gio.FileEnumerator.has_pending

    def has_pending()

Returns :

True if the enumerator has pending operations.

- The has_pending() method checks if the file enumerator has pending operations. -

gio.FileEnumerator.is_closed

    def is_closed()

Returns :

True if the enumerator is closed.

- The is_closed() method checks if the file enumerator has been closed. -

gio.FileEnumerator.next_file

    def next_file(cancellable=None)

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

Returns :

A gio.FileInfo - or None on error or end of enumerator. -

- The next_file() method returns information for the next - file in the enumerated object. Will block until the information is available. - The gio.FileInfo - returned from this function will contain attributes that match the attribute string - that was passed when the GFileEnumerator was created. -

- On error, returns None and sets error to the error. If the enumerator - is at the end, None will be returned and error will be unset. -

gio.FileEnumerator.next_files_async

    def next_files_async(num_files, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

num_files :

The number of file info objects to request. -

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

The - Glib Priority Constants of the request. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The next_files_async() method requests information for a number - of files from the enumerator asynchronously. When all i/o for the operation is finished - the callback will be called with the requested information. -

- The callback can be called with less than num_files files in case of error or at the - end of the enumerator. In case of a partial error the callback will be called with any - succeeding items and no error, and on the next request the error will be reported. If a - request is cancelled the callback will be called with gio.ERROR_CANCELLED. -

- During an async request no other sync and async calls are allowed, and will result in gio.ERROR_PENDING errors. -

- Any outstanding i/o request with higher priority (lower numerical value) will be executed - before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. -

gio.FileEnumerator.next_files_finish

    def next_files_finish(result)

result :

a GAsyncResult. -

Returns :

A list of - gio.FileInfos. -

- The next_files_finish() method finishes the - asynchronous operation started with - gio.FileEnumerator.next_files_async(). -

gio.FileEnumerator.set_pending

    def set_pending(pending)

pending :

A boolean value. -

- The push_current() method sets the file enumerator as having pending operations. -

diff --git a/docs/html/class-giofileicon.html b/docs/html/class-giofileicon.html deleted file mode 100644 index 72c0dba..0000000 --- a/docs/html/class-giofileicon.html +++ /dev/null @@ -1,21 +0,0 @@ -gio.FileIcon

gio.FileIcon

gio.FileIcon — Icons pointing to an image file.

Synopsis

class gio.FileIcon(gobject.GObject, gio.Icon, gio.LoadableIcon):
-    gio.FileIcon(file)
def get_file()

Ancestry

+-- gobject.GObject
-  +-- gio.FileIcon
-

Description

- The gio.FileIcon - specifies an icon by pointing to an image file to be used as icon. -

Constructor

    gio.FileIcon(file)

file :

a - gio.File -

Returns :

a new - gio.FileIcon - for the given file, or None on error. -

- Creates a new icon for a file. -

Methods

gio.FileIcon.get_file

    def get_file()

Returns :

a - gio.File - or None. -

- The get_file() method gets the - gio.File - associated with the given icon. -

diff --git a/docs/html/class-giofileinfo.html b/docs/html/class-giofileinfo.html deleted file mode 100644 index d82427c..0000000 --- a/docs/html/class-giofileinfo.html +++ /dev/null @@ -1,42 +0,0 @@ -gio.FileInfo

gio.FileInfo

gio.FileInfo — File Information and Attributes

Synopsis

class gio.FileInfo(gobject.GObject):
-    gio.FileInfo()
def clear_status()
def copy_into()
def dup()
def get_attribute_as_string(attribute)
def get_attribute_boolean(attribute)
def get_attribute_byte_string(attribute)
def get_attribute_data(attribute)
def get_attribute_int32(attribute)
def get_attribute_int64(attribute)
def get_attribute_object(attribute)
def get_attribute_status(attribute)
def get_attribute_string(attribute)
def get_attribute_type(attribute)
def get_attribute_uint32(attribute)
def get_attribute_uint64(attribute)
def get_content_type()
def get_display_name()
def get_edit_name()
def get_etag()
def get_file_type()
def get_icon()
def get_is_backup()
def get_is_hidden()
def get_is_symlink()
def get_modification_time()
def get_name()
def get_size()
def get_sort_order()
def get_symlink_target()
def has_attribute(attribute)
def list_attributes(name_space)
def remove_attribute(attribute)
def set_attribute(attribute, type, value_p)
def set_attribute_boolean(attribute, attr_value)
def set_attribute_byte_string(attribute, attr_value)
def set_attribute_data(attribute, attr_value)
def set_attribute_int32(attribute, attr_value)
def set_attribute_int64(attribute, attr_value)
def set_attribute_mask(mask)
def set_attribute_object(attribute, attr_value)
def set_attribute_status(attribute, attr_value)
def set_attribute_string(attribute, attr_value)
def set_attribute_uint32(attribute)
def set_attribute_uint64(attribute)
def set_content_type(content_type)
def set_display_name(display_name)
def set_edit_name(edit_name)
def set_file_type(type)
def set_icon(icon)
def set_is_hidden(is_hidden)
def set_is_symlink(is_symlink)
def set_modification_time(mtime)
def set_name(name)
def set_size(size)
def set_sort_order(sort_order)
def set_symlink_tarset(symlink_target)
def unset_attribute_mask()

Ancestry

+-- gobject.GObject
-  +-- gio.FileInfo
-

Description

- Functionality for manipulating basic metadata for files. - gio.FileInfo - implements methods for getting information that all files should contain, - and allows for manipulation of extended attributes. -

- See gio.FileAttribute - for more information on how GIO handles file attributes. -

- To obtain a gio.FileInfo - for a gio.File, use - gio.File.query_info() - (or its async variant). To obtain a - gio.FileInfo - for a file input or output stream, use - gio.FileInputStream.query_info() or - gio.FileOutputStream.query_info() - (or their async variants). -

- To change the actual attributes of a file, you should then set the attribute in the - gio.FileInfo and call - gio.File.set_attributes_from_info() or - gio.File.set_attributes_async() - on a gio.File. -

- However, not all attributes can be changed in the file. For instance, the - actual size of a file cannot be changed via - gio.FileInfo.set_size(). You may call - gio.File.query_settable_attributes() and - gio.File.query_writable_namespace() - to discover the settable attributes of a particular file at runtime. -

- gio.FileAttributeMatcher - allows for searching through a GFileInfo for attributes. -

Constructor

    gio.FileInfo()

Returns :

a new - gio.FileInfo -

- Creates a new gio.FileInfo -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-giofileinputstream.html b/docs/html/class-giofileinputstream.html deleted file mode 100644 index a4aedc7..0000000 --- a/docs/html/class-giofileinputstream.html +++ /dev/null @@ -1,65 +0,0 @@ -gio.FileInputStream

gio.FileInputStream

gio.FileInputStream — Base class for implementing streaming input

Synopsis

class gio.FileInputStream(gio.InputStream):
-    def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Implemented Interfaces

- gio.FileInputStream - implements - gio.Seekable -

Description

- gio.FileInputStream - provides input streams that take their content from a file. -

- gio.FileInputStream - implements gio.Seekable, - which allows the input stream to jump to arbitrary positions in the file, provided the filesystem - of the file allows it. In addition to the generic g_seekable_ API, - gio.FileInputStream - has its own API for seeking and positioning. To find the position of a file input stream, use - gio.Seekable.tell(). - To find out if a file input stream supports seeking, use - gio.Seekable.can_seek(). - To position a file input stream, use - gio.Seekable.seek(). -

Methods

gio.FileInputStream.query_info

    def query_info(attributes, cancellable=None)

attributes :

a file attribute query string. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a gio.FileInfo, - or None on error. -

- The query_info() method queries a file input stream - the given attributes. This function blocks while querying the stream. - For the asynchronous (non-blocking) version of this function, see - gio.FileInputStream.query_info_async(). - While the stream is blocked, the stream will set the pending flag internally, - and any other operations on the stream will fail with gio.ERROR_PENDING. -

gio.FileInputStream.query_info_async

    def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

attributes :

a file attribute query string. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The query_info_async() method queries the stream - information asynchronously. When the operation is finished callback will be - called. You can then call - gio.FileInputStream.query_info_finish() - to get the result of the operation. -

- For the synchronous version of this function, see - gio.FileInputStream.query_info(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set -

gio.FileInputStream.query_info_finish

    def query_info_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileInfo, - or None on error. -

- The query_info_finish() method finishes an asynchronous - file append operation started with - gio.FileInputStream.query_info_async(). -

diff --git a/docs/html/class-giofilemonitor.html b/docs/html/class-giofilemonitor.html deleted file mode 100644 index 187d822..0000000 --- a/docs/html/class-giofilemonitor.html +++ /dev/null @@ -1,21 +0,0 @@ -gio.FileMonitor

gio.FileMonitor

gio.FileMonitor — File Monitor

Synopsis

class gio.FileMonitor(gobject.GObject):
-    def cancel()
def emit_event(child, other_file, event_type)
def is_cancelled()
def set_rate_limit(limit_msecs)

Ancestry

+-- gobject.GObject
-  +-- gio.FileMonitor
-

gio.FileMonitor Properties

"cancelled"Read - Whether the monitor has been cancelled. Default value: False. -
"rate-limit"Read/Write - The limit of the monitor to watch for changes, in milliseconds. - Allowed values: >= 0. Default value: 800. -

gio.FileMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(filemonitor, file, other_file, event_type, user_param1, ...)

Description

- The gio.FileMonitor - monitors a file or directory for changes. -

- To obtain a gio.FileMonitor - for a file or directory, use - gio.FileMonitor.monitor(), - gio.FileMonitor.monitor_file(), or - gio.FileMonitor.monitor_directory(). -

- To get informed about changes to the file or directory you are monitoring, - connect to the "changed" signal. -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-giofileoutputstream.html b/docs/html/class-giofileoutputstream.html deleted file mode 100644 index f69c100..0000000 --- a/docs/html/class-giofileoutputstream.html +++ /dev/null @@ -1,84 +0,0 @@ -gio.FileOutputStream

gio.FileOutputStream

gio.FileOutputStream — Base class for implementing streaming input

Synopsis

class gio.FileOutputStream(gio.OutputStream):
-    def get_etag()
def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Implemented Interfaces

- gio.FileOutputStream - implements - gio.Seekable -

Description

- gio.FileOutputStream - provides output streams that write their content to a file. -

- gio.FileOutputStream - implements gio.Seekable, - which allows the output stream to jump to arbitrary positions in the file and to truncate - the file, provided the filesystem of the file supports these operations. In addition to the - generic gio.Seekable. API, - gio.FileOutputStream - has its own API for seeking and positioning. To find the position of a file output stream, use - gio.Seekable.tell(). - To find out if a file output stream supports seeking, use - gio.Seekable.can_seek(). - To position a file output stream, use - gio.Seekable.seek(). - To find out if a file output stream supports truncating, use - gio.FileOutputStream.can_truncate(). - To truncate a file output stream, use - gio.Seekable.truncate(). -

Methods

gio.FileOutputStream.get_etag

    def get_etag()

Returns :

the entity tag for the stream. -

- The get_etag() method gets the entity tag - for the file when it has been written. This must be called after the - stream has been written and closed, as the etag can change while writing. -

gio.FileOutputStream.query_info

    def query_info(attributes, cancellable=None)

attributes :

a file attribute query string. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a gio.FileInfo, - or None on error. -

- The query_info() method queries a file input stream - the given attributes. This function blocks while querying the stream. - For the asynchronous (non-blocking) version of this function, see - gio.FileOutputStream.query_info_async(). - While the stream is blocked, the stream will set the pending flag internally, - and any other operations on the stream will fail with gio.ERROR_PENDING. -

- Can fail if the stream was already closed (with error being set to gio.ERROR_CLOSED), - the stream has pending operations (with error being set to gio.ERROR_PENDING), or - if querying info is not supported for the stream's interface (with error being set to - gio.ERROR_NOT_SUPPORTED). In all cases of failure, NULL will be returned. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be set, and None will be returned. -

gio.FileOutputStream.query_info_async

    def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

attributes :

a file attribute query string. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The query_info_async() method queries the stream - information asynchronously. When the operation is finished callback will be - called. You can then call - gio.FileOutputStream.query_info_finish() - to get the result of the operation. -

- For the synchronous version of this function, see - gio.FileOutputStream.query_info(). -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set -

gio.FileOutputStream.query_info_finish

    def query_info_finish(result)

result :

a gio.AsyncResult. -

Returns :

a gio.FileInfo, - or None on error. -

- The query_info_finish() method finishes an asynchronous - file append operation started with - gio.FileOutputStream.query_info_async(). -

diff --git a/docs/html/class-giofilterinputstream.html b/docs/html/class-giofilterinputstream.html deleted file mode 100644 index 0cfcee6..0000000 --- a/docs/html/class-giofilterinputstream.html +++ /dev/null @@ -1,22 +0,0 @@ -gio.FilterInputStream

gio.FilterInputStream

gio.FilterInputStream — Filter Input Stream

Synopsis

class gio.FilterInputStream(gio.InputStream):
-    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

gio.FilterInputStream Properties

"base-stream"Read - Write - Construct onlyThe underlying base stream on which the io ops will be done.
"close-base-stream"Read - Write - Construct onlyIf the base stream should be closed when the filter stream is closed. - Default value: True.

Description

- Filter Input Stream. -

Methods

gio.FilterInputStream.get_base_stream

    def get_base_stream()

Returns :

A - gio.InputStream -

- The get_base_stream() method gets the base - stream for the filter stream. -

gio.FilterInputStream.get_close_base_stream

    def get_close_base_stream()

Returns :

True if the base stream - will be closed. -

- The get_close_base_stream() method returns - whether the base stream will be closed when stream is closed. -

gio.FilterInputStream.set_close_base_stream

    def set_close_base_stream(close_base)

close_base :

True to close the base stream. -

- The set_close_base_stream() method sets whether - the base stream will be closed when stream is closed. -

diff --git a/docs/html/class-giofilteroutputstream.html b/docs/html/class-giofilteroutputstream.html deleted file mode 100644 index e8781a5..0000000 --- a/docs/html/class-giofilteroutputstream.html +++ /dev/null @@ -1,22 +0,0 @@ -gio.FilterOutputStream

gio.FilterOutputStream

gio.FilterOutputStream — Filter Output Stream

Synopsis

class gio.FilterOutputStream(gio.OutputStream):
-    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

gio.FilterOutputStream Properties

"base-stream"Read - Write - Construct onlyThe underlying base stream on which the io ops will be done.
"close-base-stream"Read - Write - Construct onlyIf the base stream should be closed when the filter stream is closed. - Default value: True.

Description

- Filter Output Stream. -

Methods

gio.FilterOutputStream.get_base_stream

    def get_base_stream()

Returns :

A - gio.OutputStream -

- The get_base_stream() method gets the base - stream for the filter stream. -

gio.FilterOutputStream.get_close_base_stream

    def get_close_base_stream()

Returns :

True if the base stream - will be closed. -

- The get_close_base_stream() method returns - whether the base stream will be closed when stream is closed. -

gio.FilterOutputStream.set_close_base_stream

    def set_close_base_stream(close_base)

close_base :

True to close the base stream. -

- The set_close_base_stream() method sets whether - the base stream will be closed when stream is closed. -

diff --git a/docs/html/class-gioicon.html b/docs/html/class-gioicon.html deleted file mode 100644 index 4a15c7e..0000000 --- a/docs/html/class-gioicon.html +++ /dev/null @@ -1,81 +0,0 @@ -gio.Icon

gio.Icon

gio.Icon — Interface for icons.

Synopsis

class gio.Icon(gobject.GInterface):
-    def equal(icon2)
def to_string()
-Functions
- 
-    def gio.icon_new_from_string()

Ancestry

+-- gobject.GInterface
-  +-- gio.Icon
-

Known Derived Interfaces

- gio.Icon is required by - gio.LoadableIcon. -

Known Implementation

- gio.Icon is implemented by - gio.ThemedIcon, - gio.FileIcon, - gio.Emblem, - gio.EmblemedIcon. -

Description

- gio.Icon - is a very minimal interface for icons. It provides functions for checking - the equality of two icons, hashing of icons and serializing an icon to and from strings. -

- gio.Icon - does not provide the actual pixmap for the icon as this is out of GIO's - scope, however implementations of - gio.Icon - may contain the name of an icon (see - gio.ThemedIcon), - or the path to an icon (see - gio.LoadableIcon). -

- To check if two GIcons are equal, see - gio.Icon.equal(). -

- For serializing a gio.Icon, - use gio.Icon.to_string() and - gio.Icon.new_from_string(). -

- If your application or library provides one or more - gio.Icon - implementations you need to ensure that each GType is registered - with the type system prior to calling - gio.icon_new_from_string(). -

Methods

gio.Icon.equal

    def equal(icon2)

icon2 :

the second - gio.Icon -

- The equal() method checks if two icons are equal. -

gio.Icon.to_string

    def to_string()

Returns :

An UTF8 string or None - if icon can't be serialized. -

- The to_string() method generates a textual - representation of icon that can be used for serialization such as when - passing icon to a different process or saving it to persistent storage. Use - gio.icon_new_from_string() - to get icon back from the returned string. -

- The encoding of the returned string is proprietary to GIcon except in the following two cases -

- If icon is a gio.FileIcon, - the returned string is a native path (such as /path/to/my icon.png) without escaping - if the gio.File - for icon is a native file. If the file is not native, the returned string is the result of - gio.File.get_uri() - (such as sftp://path/to/my%20icon.png). -

- If icon is a gio.ThemedIcon - with exactly one name, the encoding is simply the name (such as network-server). -

Functions

gio.icon_new_from_string

    def icon_new_from_string(str)

str :

A string obtained via - gio.Icon.to_string(). -

Returns :

An object implementing the - gio.Icon - interface or None if error is set. -

- The icon_new_from_string() function generate a - gio.Icon - instance from str. This function can fail if str is not valid - see - gio.Icon.to_string() - for discussion. -

- If your application or library provides one or more GIcon implementations you need - to ensure that each GType is registered with the type system prior to calling - gio.icon_new_from_string(). -

diff --git a/docs/html/class-gioinputstream.html b/docs/html/class-gioinputstream.html deleted file mode 100644 index 7a4ee27..0000000 --- a/docs/html/class-gioinputstream.html +++ /dev/null @@ -1,242 +0,0 @@ -gio.InputStream

gio.InputStream

gio.InputStream — Base class for implementing streaming input

Synopsis

class gio.InputStream(gobject.GObject):
-    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def has_pending()
def is_closed()
def read(count=-1, cancellable=None)
def read_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_finish(result)
def read_part(count=-1, cancellable=None)
def set_pending()
def skip(count, cancellable=None)
def skip_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def skip_finish(result)

Ancestry

+-- gobject.GObject
-  +-- gio.InputStream
-

Description

- gio.InputStream - has functions to read from a stream ( - gio.InputStream.read() - ), to close a stream ( - gio.InputStream.close() - ) and to skip some content ( - gio.InputStream.skip() - ). -

- To copy the content of an input stream to an output stream without manually - handling the reads and writes, use - gio.OutputStream.splice(). -

- All of these functions have async variants too. -

Methods

gio.InputStream.clear_pending

    def clear_pending()

- The clear_pending() method clears the pending flag on stream. -

gio.InputStream.close

    def close(cancellable=None)

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

True on success - False on failure. -

- The close() method closes the stream, releasing - resources related to it. -

- Once the stream is closed, all other operations will return gio.ERROR_CLOSED. - Closing a stream multiple times will not return an error. -

- Streams will be automatically closed when the last reference is dropped, but - you might want to call this function to make sure resources are released as - early as possible. -

- Some streams might keep the backing store of the stream (e.g. a file descriptor) - open after the stream is closed. See the documentation for the individual - stream for details. -

- On failure the first error that happened will be reported, but the close operation - will finish as much as possible. A stream that failed to close will still return - gio.ERROR_CLOSED for all operations. Still, it is important to check and report - the error to the user. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. -

gio.InputStream.close_async

    def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The close_async() method asynchronously requests an - asynchronous closes of the stream, releasing resources related to it. -

- For more details, see - gio.InputStream.close() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.InputStream.close_finish() - to get the result of the operation. -

gio.InputStream.close_finish

    def close_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the stream was closed successfully. -

- The close_finish() method finishes an asynchronous - file append operation started with - gio.InputStream.close_async(). -

gio.InputStream.has_pending

    def has_pending()

Returns :

True if stream has pending actions. -

- The has_pending() method checks if an input stream has pending actions. -

gio.InputStream.is_closed

    def is_closed()

Returns :

True if the stream is closed. -

- The is_closed() method checks if an input stream is closed. -

gio.InputStream.read

    def read(count=-1, cancellable=None)

count :

optionally the number of bytes that will be read from the stream. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

The number of bytes read, or -1 on error. -

- The read() method tries to read count bytes from - the stream into the buffer starting at buffer. Will block during this read. -

- This function is similar to - gio.InputStream.read_part(), - except it tries to read as many bytes as requested, only stopping on an error or end of stream. -

- On a successful read of count bytes, or if we reached the end of the stream, - True is returned, and bytes_read is set to the number of bytes read into buffer. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. -

- If there is an error during the operation False is returned and error - is set to indicate the error status, bytes_read is updated to contain the number of - bytes read into buffer before the error occurred. -

gio.InputStream.read_async

    def read_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

count :

the number of bytes that will be read from the stream. -

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The read_async() method requests an asynchronous read - of count bytes from the stream into the buffer. -

- For more details, see - gio.InputStream.read() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.InputStream.read_finish() - to get the result of the operation. -

- During an async request no other sync and async calls are allowed, and - will result in gio.ERROR_PENDING errors. -

- A value of count larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. -

- On success, the number of bytes read into the buffer will be passed to the callback. - It is not an error if this is not the same as the requested size, as it can happen e.g. - near the end of a file, but generally we try to read as many bytes as requested. Zero - is returned on end of file (or if count is zero), but never otherwise. -

- Any outstanding i/o request with higher priority (lower numerical value) will be - executed before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. -

- The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so - they are optional for inheriting classes. However, if you override one you must override all. -

gio.InputStream.read_finish

    def read_finish(result)

result :

a gio.AsyncResult. -

Returns :

The number of bytes read in, or -1 on error. -

- The read_finish() method finishes an asynchronous - stream read operation started by - gio.InputStream.read_async(). -

gio.InputStream.read_part

    def read_part(count=-1, cancellable=None)

count :

optionally the number of bytes that will be read from the stream. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

The number of bytes read, or -1 on error. -

- The read_part() method tries to read count bytes from - the stream into the buffer starting at buffer. Will block during this read. -

- If count is zero returns zero and does nothing. A value of count larger than - G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. -

- On success, the number of bytes read into the buffer is returned. It is - not an error if this is not the same as the requested size, as it can - happen e.g. near the end of a file. Zero is returned on end of file - (or if count is zero), but never otherwise. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. -

- On error -1 is returned and error is set accordingly. -

Note

- This method roughly corresponds to C GIO g_input_stream_read. -

gio.InputStream.set_pending

    def set_pending()

Returns :

True if pending was previously - unset and is now set. -

- The set_pending() method sets stream to have actions pending. - If the pending flag is already set or stream is closed, - it will return False and set error. -

gio.InputStream.skip

    def skip(count, cancellable=None)

count :

the number of bytes that will be skipped from the stream. -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

The number of bytes skipped, or -1 on error -

- The skip() method tries to skip count bytes - from the stream. Will block during the operation. -

- This is identical to - read(), - from a behaviour standpoint, but the bytes that are skipped are not - returned to the user. Some streams have an implementation that is more - efficient than reading the data. -

- This function is optional for inherited classes, as the default implementation emulates it using read. -

- If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thskip. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. -

gio.InputStream.skip_async

    def skip_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)

count :

the number of bytes that will be skipped from the stream. -

callback :

a GAsyncskipyCallback to call when the request is satisfied. -

io_priority :

the - Glib Priority Constants - of the request. -

cancellable :

optional - gio.Cancellable - object, None to ignore.

user_data :

the data to pass to callback function. -

- The skip_async() method request an asynchronous - skip of count bytes from the stream. -

- For more details, see - gio.InputStream.skip() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.InputStream.skip_finish() - to get the result of the operation. -

- During an async request no other sync and async calls are allowed, and - will result in gio.ERROR_PENDING errors. -

- A value of count larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. -

- On success, the number of bytes skipped will be passed to the callback. It is - not an error if this is not the same as the requested size, as it can happen - e.g. near the end of a file, but generally we try to skip as many bytes as requested. - Zero is returned on end of file (or if count is zero), but never otherwise. -

- Any outstanding i/o request with higher priority (lower numerical value) will be - executed before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. -

- The asyncronous methods have a default fallback that uses thskips to implement asynchronicity, so - they are optional for inheriting classes. However, if you override one you must override all. -

gio.InputStream.skip_finish

    def skip_finish(result)

result :

a gio.AsyncResult. -

Returns :

The number of bytes skipped in, or -1 on error. -

- The skip_finish() method finishes an asynchronous - stream skip operation started by - gio.InputStream.skip_async(). -

diff --git a/docs/html/class-gioloadableicon.html b/docs/html/class-gioloadableicon.html deleted file mode 100644 index 8f84331..0000000 --- a/docs/html/class-gioloadableicon.html +++ /dev/null @@ -1,51 +0,0 @@ -gio.LoadableIcon

gio.LoadableIcon

gio.LoadableIcon — Interface for icons.

Synopsis

class gio.LoadableIcon(gobject.GInterface):
-    def load(size=0, cancellable=None)
def load_async(callback, size=0, cancellable=None, user_data=None)
def load_finish(res)

Prerequisites

- gio.LoadableIcon requires - gio.Icon. and - gobject.GObject -

Known Implementation

- gio.LoadableIcon is implemented by - gio.FileIcon -

Description

- gio.LoadableIcon - extends the gio.Icon - interface and adds the ability to load icons from streams. -

Methods

gio.LoadableIcon.load

    def load(size=0, cancellable=None)

size :

an integer -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

Returns :

a 2 tuple containing a - gio.InputStream - to read the icon from and a string containing the icon type. -

- The load() method loads a loadable icon. - For the asynchronous version of this function, see - gio.LoadableIcon.load_async(). -

gio.LoadableIcon.load_async

    def load_async(callback, size=0, cancellable=None, user_data=None)

callback :

a GAsyncReadyCallback to call when the request is satisfied. -

size :

an integer -

cancellable :

optional - gio.Cancellable - object, None to ignore. -

user_data :

the data to pass to callback function. -

- The load_async() method loads an icon asynchronously. -

- For more details, see - gio.LoadableIcon.load() - which is the synchronous version of this call. -

- When the operation is finished, callback will be called. You can then call - gio.LoadableIcon.load_finish() - to get the result of the operation. -

gio.LoadableIcon.load_finish

    def load_finish(res)

res :

a - gio.AsyncResult. -

Returns :

a 2 tuple containing a - gio.InputStream - to read the icon from and a string containing the icon type. -

- The load_finish() method finishes an asynchronous - icon load started in - gio.LoadableIcon.load_async(). -

diff --git a/docs/html/class-giomemoryinputstream.html b/docs/html/class-giomemoryinputstream.html deleted file mode 100644 index 5068dea..0000000 --- a/docs/html/class-giomemoryinputstream.html +++ /dev/null @@ -1,32 +0,0 @@ -gio.MemoryInputStream

gio.MemoryInputStream

gio.MemoryInputStream — Base class for implementing streaming input

Synopsis

class gio.MemoryInputStream(gio.InputStream):
-    gio.MemoryInputStream()
def add_data(data)
-Functions
- 
-    def gio.memory_input_stream_new_from_data(data)

Implemented Interfaces

- gio.MemoryInputStream - implements - gio.Seekable -

Description

- gio.MemoryInputStream - is a class for using arbitrary memory chunks as input for GIO streaming input operations. -

Constructor

    gio.MemoryInputStream(icon)

Returns :

a new - gio.MemoryInputStream. -

- Creates an empty - gio.MemoryInputStream. -

Methods

gio.MemoryInputStream.add_data

    def add_data(data)

data :

input data. -

- The add_data() method appends data to data - that can be read from the input stream -

Functions

gio.memory_input_stream_new_from_data

    def memory_input_stream_new_from_data(data)

data :

input data. -

Returns :

A new - gio.MemoryInputStream - read from data -

- The memory_input_stream_new_from_data() function creates - a new gio.MemoryInputStream - with data in memory. -

diff --git a/docs/html/class-giomemoryoutputstream.html b/docs/html/class-giomemoryoutputstream.html deleted file mode 100644 index 115bba7..0000000 --- a/docs/html/class-giomemoryoutputstream.html +++ /dev/null @@ -1,40 +0,0 @@ -gio.MemoryOutputStream

gio.MemoryOutputStream

gio.MemoryOutputStream — Streaming output operations on memory chunks

Synopsis

class gio.MemoryOutputStream(gio.OutputStream):
-    gio.MemoryOutputStream()
def get_contents()
def get_data_size()
def get_size()

Implemented Interfaces

- gio.MemoryOutputStream - implements - gio.Seekable -

Description

- gio.MemoryOutputStream - is a class for using arbitrary memory chunks as output for GIO streaming output operations. -

Constructor

    gio.MemoryOutputStream()

Returns :

a new - gio.MemoryOutputStream. -

- Creates a new - gio.MemoryOutputStream. -

Methods

gio.MemoryOutputStream.get_contents

    def get_contents()

Returns :

the stream's data -

- The get_contents() method gets any loaded data - from the ostream. -

- Note that the returned data may become invalid on the next write or truncate - operation on the stream. -

gio.MemoryOutputStream.get_data_size

    def get_data_size()

Returns :

the number of bytes written to the stream -

- The get_data_size() method returns the number - of bytes from the start up to including the last byte written in the - stream that has not been truncated away. -

gio.MemoryOutputStream.get_size

    def get_size()

Returns :

the number of bytes allocated for the data buffer -

- The get_size() method gets the size of the - currently allocated data area (availible from - gio.MemoryOutputStream.get_contents() - ). -

- Note that for growable streams the returned size may become invalid on the next write or truncate operation on the stream. -

- If you want the number of bytes currently written to the stream, use - gio.MemoryOutputStream.get_data_size(). -

diff --git a/docs/html/class-giomount.html b/docs/html/class-giomount.html deleted file mode 100644 index 574ebfd..0000000 --- a/docs/html/class-giomount.html +++ /dev/null @@ -1,242 +0,0 @@ -gio.Mount

gio.Mount

gio.Mount — Mount management

Synopsis

class gio.Mount(gobject.GInterface):
-    def can_eject()
def can_unmount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def get_drive()
def get_icon()
def get_name()
def get_root()
def get_uuid()
def get_volume()
def guess_content_type(callback, force_rescan, cancellable=None, user_data=None)
def guess_content_type_finish(result)
def guess_content_type_sync(force_rescan, cancellable=None)
def is_shadowed()
def remount(callback, flags=gio.MOUNT_UNMOUNT_NONE, mount_operation=None, cancellable=None, user_data=None)
def remount_finish(result)
def shadow()
def unmount(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def unmount_finish(result)
def unshadow()

Ancestry

+-- gobject.GInterface
-  +-- gio.Mount
-

Prerequisites

- gio.Mount requires - gobject.GObject -

gio.Mount Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mount, user_param1, ...)

"changed"

def callback(mount, user_param1, ...)

"unmounted"

def callback(mount, user_param1, ...)

Description

- The gio.Mount - interface represents user-visible mounts. Note, when porting from GnomeVFS, - gio.Mount - is the moral equivalent of GnomeVFSVolume. - -

- gio.Mount - is a "mounted" filesystem that you can access. Mounted is in quotes because - it's not the same as a unix mount, it might be a gvfs mount, but you can still - access the files on it if you use GIO. Might or might not be related to a volume object. -

- Unmounting a GMount instance is an asynchronous operation. For more information - about asynchronous operations, see GAsyncReady and GSimpleAsyncReady. To unmount - a gio.Mount instance, - first call - g_mount_unmount() - with (at least) the GMount instance and a GAsyncReadyCallback. The callback will - be fired when the operation has resolved (either with success or failure), and a - GAsyncReady structure will be passed to the callback. That callback should then call - g_mount_unmount_finish() - with the GMount and the GAsyncReady data to see if the operation was completed successfully. - If an error is present when g_mount_unmount_finish() is called, then it will be filled - with any error information. -

Methods

gio.Mount.can_eject

    def can_eject()

Returns :

True if the mount can be ejected, - False otherwise. -

- The can_eject() method checks if a mount can be ejected. -

gio.Mount.can_unmount

    def can_unmount()

Returns :

True if the mount can be unmounted, - False otherwise. -

- The can_eject() method checks if a mount can be unmounted. -

gio.Mount.eject

    def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

flags affecting the unmount if required for eject - Gio Mount Unmount Flags Constants. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The eject() method asynchronously ejects a mount. -

- When the operation is finished, callback will be called. You can then call - gio.Mount.eject_finish() - to obtain the result of the operation. -

gio.Mount.eject_finish

    def eject_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the mount has been ejected - successfully, False otherwise. -

- The eject_finish() method finishes ejecting a mount. -

gio.Mount.get_drive

    def get_drive()

Returns :

gio.Drive - or None if mount is not associated with a volume or a drive. -

- The get_drive() method gets the drive for the mount. -

- This is a convenience method for getting the - gio.Volume - and then using that object to get the - gio.Drive. -

gio.Mount.get_icon

    def get_icon()

Returns :

gio.Icon - for the mount. -

- The get_icon() method gets the icon for mount. -

gio.Mount.get_name

    def get_name()

Returns :

the name for the given mount. -

- The get_name() method gets the name of mount. -

gio.Mount.get_root

    def get_root()

Returns :

a gio.File. -

- The get_root() method gets the root directory on mount. -

gio.Mount.get_uuid

    def get_uuid()

Returns :

the UUID for mount or None - if no UUID can be computed. -

- The get_uuid() method gets the UUID for the mount. - The reference is typically based on the file system UUID for the mount in - question and should be considered an opaque string. Returns None - if there is no UUID available -

gio.Mount.get_volume

    def get_volume()

Returns :

a gio.Volume - or None if mount is not associated with a volume. -

- The get_volume() method gets the volume for the mount. -

gio.Mount.guess_content_type

    def guess_content_type(callback, force_rescan, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

force_rescan :

Whether to force a rescan of the content. Otherwise a cached result will be used if available. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The guess_content_type() method asynchronously tries to guess the type of - content stored on mount. Returns one or more textual identifiers of well-known content - types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory - cards. See the shared-mime-info specification for more on x-content types. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- When the operation is finished, callback will be called. You can then call - gio.Mount.guess_content_type_finish() - to obtain the result of the operation. -

gio.Mount.guess_content_type_finish

    def guess_content_type_finish(result)

result :

a gio.AsyncResult. -

Returns :

A list of types or None on error. -

- The guess_content_type_finish() method finishes guessing content - types of mount. If any errors occured during the operation, error will be set to - contain the errors and False will be returned. In particular, you may get an - gio.ERROR_NOT_SUPPORTED if the mount does not support content guessing. -

gio.Mount.guess_content_type_sync

    def guess_content_type_sync(force_rescan, cancellable=None)

force_rescan :

Whether to force a rescan of the content. Otherwise a cached result will be used if available. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

- The guess_content_type_sync() method tries to guess - the type of content stored on mount. Returns one or more textual identifiers - of well-known content types (typically prefixed with "x-content/"), e.g. - x-content/image-dcf for camera memory cards. See the shared-mime-info specification - for more on x-content types. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- This is an synchronous operation and as such may block doing IO; see - gio.Mount.guess_content_type() - for the asynchronous version. -

gio.Mount.is_shadowed

    def is_shadowed()

Returns :

True if mount is shadowed. -

- The is_shadowed() method determines if mount - is shadowed. Applications or libraries should avoid displaying mount - in the user interface if it is shadowed. -

- A mount is said to be shadowed if there exists one or more user visible - objects (currently - gio.Mount - objects) with a root that is inside the root of mount. -

- One application of shadow mounts is when exposing a single file system - that is used to address several logical volumes. In this situation, a - gio.VolumeMonitor - implementation would create two - gio.Volume - objects (for example, one for the camera functionality of the device - and one for a SD card reader on the device) with activation URIs - gphoto2://[usb:001,002]/store1/ and gphoto2://[usb:001,002]/store2/. - When the underlying mount (with root gphoto2://[usb:001,002]/) is - mounted, said - gio.VolumeMonitor - implementation would create two - gio.Mount - objects (each with their root matching the corresponding volume - activation root) that would shadow the original mount. -

- The proxy monitor in GVfs 2.26 and later, automatically creates and - manage shadow mounts (and shadows the underlying mount) if the activation - root on a gio.Volume - is set. -

gio.Mount.remount

    def remount(callback, flags=gio.MOUNT_UNMOUNT_NONE, mount_operation=None, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

flags affecting the unmount if required for eject - Gio Mount Unmount Flags Constants. -

mount_operation :

a gio.MountOperation - or None to avoid user interaction. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The remount() method asynchronously remounts a mount. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- When the operation is finished, callback will be called. You can then call - gio.Mount.remount_finish() - to obtain the result of the operation. -

gio.Mount.remount_finish

    def remount_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the mount has been remounted - successfully, False otherwise. -

- The remount_finish() method finishes remounting a mount. -

gio.Mount.shadow

    def shadow()

- The shadow() method increments the shadow - count on mount. Usually used by - gio.VolumeMonitor - implementations when creating a shadow mount for mount, see - gio.Mount.is_shadowed() - for more information. The caller will need to emit the "changed" - signal on mount manually. -

gio.Mount.unmount

    def unmount(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

flags affecting the unmount if required for eject - Gio Mount Unmount Flags Constants. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The unmount() method asynchronously unmounts a mount. -

- If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. -

- When the operation is finished, callback will be called. You can then call - gio.Mount.unmount_finish() - to obtain the result of the operation. -

gio.Mount.unmount_finish

    def unmount_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the mount has been unmounted - successfully, False otherwise. -

- The unmount_finish() method finishes unmounting a mount. -

gio.Mount.unshadow

    def unshadow()

- The unshadow() method decrements the shadow - count on mount. Usually used by - gio.VolumeMonitor - implementations when destroying a shadow mount for mount, see - gio.Mount.is_shadowed() - for more information. The caller will need to emit the "changed" - signal on mount manually. -

Signals

The "aborted" gio.Mount Signal

    def callback(mount, user_param1, ...)

mount :

the mount

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted by the backend when e.g. a device becomes unavailable while a - mount operation is in progress. -

- Implementations of gio.MountOperation - should handle this signal by dismissing open password dialogs. -

The "changed" gio.Mount Signal

    def callback(mount, user_param1, ...)

mount :

the mount

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when the mount has been changed. -

The "unmounted" gio.Mount Signal

    def callback(mount, user_param1, ...)

mount :

the mount

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- This signal is emitted when the - gio.Mount - have been unmounted. -

diff --git a/docs/html/class-giomountoperation.html b/docs/html/class-giomountoperation.html deleted file mode 100644 index fddc13b..0000000 --- a/docs/html/class-giomountoperation.html +++ /dev/null @@ -1,123 +0,0 @@ -gio.MountOperation

gio.MountOperation

gio.MountOperation — Authentication methods for mountable locations.

Synopsis

class gio.MountOperation(gobject.GObject):
-    gio.MountOperation()
def get_anonymous()
def get_choice()
def get_domain()
def get_password()
def get_password_save()
def get_username()
def replay(result)
def set_anonymous(anonymous)
def set_choice(choice)
def set_domain(domain)
def set_password(password)
def set_password_save(save)
def set_username(username)

gio.MountOperation Properties

"anonymous"Read/Write - Whether to use an anonymous user when authenticating. - Default value: False -
"choice"Read/Write - The index of the user's choice when a question is asked during - the mount operation. See the "ask-question" signal. - Allowed values: >= 0 Default value: 0 -
"domain"Read/Write - The domain to use for the mount operation. Default value: None -
"password"Read/Write - The password that is used for authentication when carrying out the - mount operation. Default value: None -
"password-save"Read/Write - Determines if and how the password information should be saved. - Default value: gio.PASSWORD_SAVE_NEVER -
"username"Read/Write - The user name that is used for authentication when carrying out the - mount operation. Default value: None -

gio.MountOperation Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mountoperation, user_param1, ...)

"ask-password"

def callback(mountoperation, message, default_user, default_domain, flags, user_param1, ...)

"ask-question"

def callback(mountoperation, message, choices, user_param1, ...)

"reply"

def callback(mountoperation, result, user_param1, ...)

Description

- The gio.MountOperation - provides a mechanism for authenticating mountable operations, such as loop mounting files, - hard drive partitions or server locations. -

- Mounting operations are handed a - gio.MountOperation - that then can use if they require any privileges or authentication for their volumes to be - mounted (e.g. a hard disk partition or an encrypted filesystem), or if they are implementing - a remote server protocol which requires user credentials such as FTP or WebDAV. -

- Users should instantiate a subclass of this that implements all the various callbacks - to show the required dialogs, such as - gtk.MountOperation. -

Constructor

    gio.MountOperation()

Returns :

a new - gio.MountOperation. -

- Creates a new mount operation. -

Methods

gio.MountOperation.get_anonymous

    def get_anonymous()

Returns :

True if mount operation is anonymous. -

- The get_anonymous() method check to see whether - the mount operation is being used for an anonymous user -

gio.MountOperation.get_choice

    def get_choice()

Returns :

an integer containing an index of the user's - choice from the choice's list, or 0. -

- The get_anonymous() method gets a choice - from the mount operation. -

gio.MountOperation.get_domain

    def get_domain()

Returns :

a string set to the domain. -

- The get_domain() method gets the domain - of the mount operation. -

gio.MountOperation.get_password

    def get_password()

Returns :

a string containing the password within - the mountoperation. -

- The get_password() method gets a password - from the mount operation. -

gio.MountOperation.get_password_save

    def get_password_save()

Returns :

a - Gio Password Save Constants - flag. -

- The get_password_save() method gets the state - of saving passwords for the mount operation. -

gio.MountOperation.get_username

    def get_username()

Returns :

a string containing the user name. -

- The get_username() method get the user - name from the mount operation. -

gio.MountOperation.reply

    def reply(result)

result :

a - Gio Mount Operation Result Constants -

- The reply() method emits the "reply" signal. -

gio.MountOperation.set_anonymous

    def set_anonymous(anonymous)

anonymous :

boolean value. -

- The set_anonymous() method sets the mount operation - to use an anonymous user if anonymous is True. -

gio.MountOperation.set_choice

    def set_choice(choice)

choice :

an integer. -

- The set_choice() method sets a default choice for the mount operation. -

gio.MountOperation.set_domain

    def set_domain(domain)

domain :

the domain to set. -

- The set_domain() method sets the mount operation's domain. -

gio.MountOperation.set_password

    def set_password(password)

password :

password to set. -

- The set_password() method sets the mount - operation's password to password. -

gio.MountOperation.set_password_save

    def set_password_save(save)

save :

a set of - Gio Password Save Constants -

- The set_password_save() method sets the state - of saving passwords for the mount operation. -

gio.MountOperation.set_username

    def set_username(username)

username :

input username. -

- The set_anonymous() method sets the user - name within op to username. -

Signals

The "aborted" gio.MountOperation Signal

    def callback(mountoperation, user_param1, ...)

mountoperation :

the mountoperation

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress. - Implementations of gio.MountOperation - should handle this signal by dismissing open password dialogs. -

The "ask-password" gio.MountOperation Signal

    def callback(mountoperation, message, default_user, default_domain, flags, user_param1, ...)

mountoperation :

the mountoperation

message :

string containing a message to display to the user.

default_user :

string containing the default user name.

default_domain :

string containing the default domain.

flags :

a set of - Gio Ask Password Flags Constants -

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- This signal is emitted when a mount operation asks the user for a password. - If the message contains a line break, the first line should be presented as a heading. - For example, it may be used as the primary text in a - gtk.MessageDialog. -

The "ask-question" gio.MountOperation Signal

    def callback(mountoperation, message, choices, user_param1, ...)

mountoperation :

the mountoperation

message :

string containing a message to display to the user.

choices :

a list of strings for each possible choice.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- This signal is emitted when asking the user a question and gives a list of choices - for the user to choose from. If the message contains a line break, the first line should be - presented as a heading. For example, it may be used as the primary text in a - gtk.MessageDialog. -

The "reply" gio.MountOperation Signal

    def callback(mountoperation, result, user_param1, ...)

mountoperation :

the mountoperation

result :

a - Gio Mount Operation Result Constants - indicating how the request was handled

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- This signal is emitted when the user has replied to the mount operation. -

diff --git a/docs/html/class-giooutputstream.html b/docs/html/class-giooutputstream.html deleted file mode 100644 index d4df1ab..0000000 --- a/docs/html/class-giooutputstream.html +++ /dev/null @@ -1,19 +0,0 @@ -gio.OutputStream

gio.OutputStream

gio.OutputStream — Base class for implementing streaming input

Synopsis

class gio.OutputStream(gobject.GObject):
-    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def flush(cancellable=None)
def flush_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def flush_finish(result)
def has_pending()
def is_closed()
def set_pending()
def splice(cancellable=None, flags=gio.OUTPUT_STREAM_SPLICE_NONE)
def splice_async(source, callback, flags=gio.OUTPUT_STREAM_SPLICE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def splice_finish(result)
def write(buffer, cancellable=None)
def write_async(buffer, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def write_finish(result)

Ancestry

+-- gobject.GObject
-  +-- gio.OutputStream
-

Description

- gio.OutputStream - has functions to write from a stream ( - gio.OutputStream.write() - ), to close a stream ( - gio.OutputStream.close() - ) and to flush pending writes ( - gio.OutputStream.flush() - ). -

- To copy the content of an input stream to an output stream without manually - handling the reads and writes, use - gio.OutputStream.splice(). -

- All of these functions have async variants too. -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-gioseekable.html b/docs/html/class-gioseekable.html deleted file mode 100644 index e7fdf1b..0000000 --- a/docs/html/class-gioseekable.html +++ /dev/null @@ -1,55 +0,0 @@ -gio.Seekable

gio.Seekable

gio.Seekable — Stream seeking interface.

Synopsis

class gio.Seekable(gobject.GInterface):
-    def tell()
def can_seek()
def seek(offset, type=0, cancellable=None)
def can_truncate()
def truncate(offset, cancellable=None)

Ancestry

+-- gobject.GInterface
-  +-- gio.Seekable
-

Known Implementation

- gio.Seekable is implemented by - gio.FileOutputStream, - gio.MemoryInputStream, - gio.FileInputStream and - gio.MemoryOutputStream. -

Description

- gio.Seekable - is implemented by streams (implementations of - gio.InputStream or - gio.OutputStream) - that support seeking. -

Methods

gio.Seekable.tell

    def tell()

Returns :

- the offset from the beginning of the buffer -

- Tells the current position within the stream. -

gio.Seekable.can_seek

    def can_seek()

Returns :

True if this - gio.Seekable can be seeked with - the seek() method, False - if not.

- The can_seek() method checks if the - seek() - can be used on this gio.Seekable. -

gio.Seekable.seek

    def seek(offset, type=0, cancellable=None)

offset :

the offset that is added to the position determined by the type parameter. -

type :

0=current position, 1=start of the file, 2=end of the file.

cancellable :

a gio.Cancellable - or None.

Returns :

True on successful seek, - False otherwise. -

- Seeks in the stream by the given offset, modified by type. -

- If cancellable is not None, then the - operation can be cancelled by triggering the cancellable object from another thread. -

gio.Seekable.can_truncate

    def can_truncate()

Returns :

True if this - gio.Seekable can be truncated with - the truncate() method, False - if not.

- The can_truncate() method checks if the - truncate() - can be used on this gio.Seekable. -

gio.Seekable.truncate

    def truncate(offset, cancellable=None)

offset :

the offset at which the stream should be truncated -

cancellable :

a gio.Cancellable - or None.

Returns :

True if successful, - False otherwise. -

- Truncates a stream with a given offset. -

- If cancellable is not None, then the - operation can be cancelled by triggering the cancellable object from another thread. -

- If an operation was partially finished when the operation was cancelled the - partial result will be returned, without an error. -

diff --git a/docs/html/class-giosimpleasyncresult.html b/docs/html/class-giosimpleasyncresult.html deleted file mode 100644 index 6119618..0000000 --- a/docs/html/class-giosimpleasyncresult.html +++ /dev/null @@ -1,87 +0,0 @@ -gio.SimpleAsyncResult

gio.SimpleAsyncResult

gio.SimpleAsyncResult — Simple asynchronous results implementation.

Synopsis

class gio.SimpleAsyncResult(gobject.GObject):
-    def complete()
def complete_in_idle()
def get_op_res_gboolean()
def get_op_res_gssize()
def propagate_error()
def set_handle_cancellation(handle_cancellation)
def set_op_res_gboolean(op_res)
def set_op_res_gssize(op_res)

Implemented Interface

- gio.SimpleAsyncResult implements - gio.AsyncResult. -

Description

- Implements gio.AsyncResult - for simple cases. Most of the time, this will be all an application needs, and will be used transparently - Because of this, GSimpleAsyncResult is used throughout GIO for handling asynchronous functions. -

- gio.SimpleAsyncResult - handles GAsyncReadyCallbacks, error reporting, operation cancellation and the final state of an - operation, completely transparent to the application. Results can be returned as a pointer e.g. - for functions that return data that is collected asynchronously, a boolean value for checking the - success or failure of an operation, or a gssize for operations which return the number of bytes modified - by the operation; all of the simple return cases are covered. -

- Most of the time, an application will not need to know of the details of this API; it is handled - transparently, and any necessary operations are handled by GAsyncResult's interface. However, if - implementing a new GIO module, for writing language bindings, or for complex applications that need - better control of how asynchronous operations are completed, it is important to understand this functionality. -

- gio.SimpleAsyncResult - are tagged with the calling function to ensure that asynchronous functions and - their finishing functions are used together correctly. -

- An asynchronous operation can be made to ignore a cancellation event by calling - gio.SimpleAsyncResult.set_handle_cancellation() - with a - gio.AsyncResult - for the operation and False. This is useful for operations that are dangerous to cancel, - such as close (which would cause a leak if cancelled before being run). -

- gio.AsyncResult - can integrate into GLib's event loop, GMainLoop, or it can use GThreads if available. - gio.SimpleAsyncResult.complete() - will finish an I/O task directly within the main event loop. - gio.SimpleAsyncResult.complete_in_idle() - will integrate the I/O task into the main event loop as an idle function. - -

- To set the results of an asynchronous function, - gio.SimpleAsyncResult.set_op_res_gboolean(), and - gio.SimpleAsyncResult.set_op_res_gssize() - are provided, setting the operation's result to a gboolean, or gssize, respectively. -

- Likewise, to get the result of an asynchronous function, - gio.SimpleAsyncResult.get_op_res_gboolean() and - gio.SimpleAsyncResult.get_op_res_gssize() - are provided, getting the operation's result as a gboolean and gssize, respectively. -

Methods

gio.SimpleAsyncResult.complete

    def complete()

- The complete() method completes an asynchronous I/O job. - Must be called in the main thread, as it invokes the callback that should be called - in the main thread. If you are in a different thread use - gio.SimpleAsyncResult.complete_in_idle(). -

gio.SimpleAsyncResult.complete_in_idle

    def complete_in_idle()

- The complete_in_idle() method completes an asynchronous - function in the main event loop using an idle function. -

gio.SimpleAsyncResult.get_op_res_gboolean

    def get_op_res_gboolean()

Returns :

True if the operation's result was - True, False if the operation's result - was False. -

- The get_op_res_gboolean() method gets the operation - result boolean from within the asynchronous result. -

gio.SimpleAsyncResult.get_op_res_gssize

    def get_op_res_gssize()

Returns :

a gssize returned from the asynchronous function. -

- The get_op_res_gssize() method gets a gssize - from the asynchronous result. -

gio.SimpleAsyncResult.propagate_error

    def propagate_error()

Returns :

True if the error was propegated - to dest. False otherwise. -

- The propagate_error() method propagates an error - from within the simple asynchronous result to a given destination. -

gio.SimpleAsyncResult.set_handle_cancellation

    def set_handle_cancellation(handle_cancellation)

handle_cancellation :

a boolean. -

- The set_handle_cancellation() method sets whether - to handle cancellation within the asynchronous operation. -

gio.SimpleAsyncResult.set_op_res_gboolean

    def set_op_res_gboolean(op_res)

op_res :

a boolean. -

- The set_op_res_gboolean() method sets the operation - result to a boolean within the asynchronous result. -

gio.SimpleAsyncResult.set_op_res_gssize

    def set_op_res_gssize(op_res)

op_res :

a gssize. -

- The set_op_res_gssize() method sets the operation - result within the asynchronous result to the given op_res. -

diff --git a/docs/html/class-giothemedicon.html b/docs/html/class-giothemedicon.html deleted file mode 100644 index 83d24de..0000000 --- a/docs/html/class-giothemedicon.html +++ /dev/null @@ -1,42 +0,0 @@ -gio.ThemedIcon

gio.ThemedIcon

gio.ThemedIcon — Icon theming support.

Synopsis

class gio.ThemedIcon(gobject.GObject):
-    gio.ThemedIcon()
def append_name()
def get_names()
def prepend_name()

Ancestry

+-- gobject.GObject
-  +-- gio.ThemedIcon
-

gio.ThemedIcon Properties

"name"Write/Contruct Only - The icon name. Default value: None -
"names"Read/Write/Contruct Only - A list of icon names. -
"use-default-fallbacks"Read/Write/Contruct Only - Whether to use the default fallbacks found by shortening the - icon name at '-' characters. If the "names" array has more - than one element, ignores any past the first. -

Description

- gio.ThemedIcon - is an implementation of gio.Icon - that supports icon themes. GThemedIcon contains a list of all of the icons present in an icon - theme, so that icons can be looked up quickly. -

- gio.ThemedIcon - does not provide actual pixmaps for icons, just the icon names. Ideally something like - gtk.IconTheme.choose_icon() - should be used to resolve the list of names so that fallback icons work nicely - with themes that inherit other themes -

Constructor

    gio.ThemedIcon(name, use_default_fallbacks=False)

name :

a string containing an icon name. -

Returns :

a new - gio.ThemedIcon. -

- Creates a new themed icon from icon name, if instead of an icon name you - provide a list of icon names, the gio.ThemedIcon - will be constructed using the items in the list. -

Methods

gio.ThemedIcon.append_name

    def append_name()

name :

name of icon to append to list of icons from within icon. -

- The append_name() method appends a name to - the list of icons from within icon. -

gio.ThemedIcon.get_names

    def get_names()

Returns :

a list of icon names. -

- The get_names() method gets the names - of icons from within icon. -

gio.ThemedIcon.prepend_name

    def prepend_name()

name :

name of icon to prepend to list of icons from within icon. -

- The prepend_name() method prepends a name to - the list of icons from within icon. -

diff --git a/docs/html/class-giounixinputstream.html b/docs/html/class-giounixinputstream.html deleted file mode 100644 index 4059661..0000000 --- a/docs/html/class-giounixinputstream.html +++ /dev/null @@ -1,37 +0,0 @@ -gio.unix.InputStream

gio.unix.InputStream

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.

Synopsis

class gio.unix.InputStream(gio.InputStream):
-    gio.unix.InputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

gio.unix.InputStream Properties

"close-fd"Read - WriteWhether to close the file descriptor when the stream is closed. - Default value: True.
"fd"Read - Write - Construct onlyThe file descriptor that the stream reads from. Default value: -1.

Description

- gio.unix.InputStream - implements gio.InputStream - for reading from a UNIX file descriptor, including asynchronous operations. - The file descriptor must be selectable, so it doesn't work with opened files. -

- Note that gio.unix.InputStream - belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file - when using it. -

Constructor

    gio.unix.InputStream(fd, close_fd)

fd :

a UNIX file descriptor. -

close_fd :

True - to close the file descriptor when done -

Returns :

a new - gio.unix.InputStream -

- Creates a new gio.unix.InputStream - from the given fd. -

- If close_fd is True, the file descriptor will be closed when the stream is closed. -

Methods

gio.unix.InputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done. -

- The get_close_fd() method returns whether the file - descriptor of stream will be closed when the stream is closed. -

gio.unix.InputStream.get_fd

    def get_fd()

Returns :

The file descriptor of stream. -

- The get_fd() method return the UNIX file descriptor - that the stream reads from. -

gio.unix.InputStream.set_close_fd

    def set_close_fd(close_fd)

close_fd :

True to close the file descriptor when done . -

- The set_close_fd() method sets whether the file descriptor - of stream shall be closed when the stream is closed. -

diff --git a/docs/html/class-giounixoutputstream.html b/docs/html/class-giounixoutputstream.html deleted file mode 100644 index 8b9b647..0000000 --- a/docs/html/class-giounixoutputstream.html +++ /dev/null @@ -1,37 +0,0 @@ -gio.unix.OutputStream

gio.unix.OutputStream

gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.

Synopsis

class gio.unix.OutputStream(gio.OutputStream):
-    gio.unix.OutputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

gio.unix.OutputStream Properties

"close-fd"Read - WriteWhether to close the file descriptor when the stream is closed. - Default value: True.
"fd"Read - Write - Construct onlyThe file descriptor that the stream writes to. Default value: -1.

Description

- gio.unix.OutputStream - implements gio.OutputStream - for writing to a UNIX file descriptor, including asynchronous operations. - The file descriptor must be selectable, so it doesn't work with opened files. -

- Note that gio.unix.OutputStream - belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file - when using it. -

Constructor

    gio.unix.OutputStream(fd, close_fd)

fd :

a UNIX file descriptor. -

close_fd :

True - to close the file descriptor when done -

Returns :

a new - gio.unix.OutputStream -

- Creates a new gio.unix.OutputStream - from the given fd. -

- If close_fd is True, the file descriptor will be closed when the stream is closed. -

Methods

gio.unix.OutputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done. -

- The get_close_fd() method returns whether the file - descriptor of stream will be closed when the stream is closed. -

gio.unix.OutputStream.get_fd

    def get_fd()

Returns :

The file descriptor of stream. -

- The get_fd() method return the UNIX file descriptor - that the stream reads from. -

gio.unix.OutputStream.set_close_fd

    def set_close_fd(close_fd)

close_fd :

True to close the file descriptor when done . -

- The set_close_fd() method sets whether the file descriptor - of stream shall be closed when the stream is closed. -

diff --git a/docs/html/class-giovolume.html b/docs/html/class-giovolume.html deleted file mode 100644 index ff6512a..0000000 --- a/docs/html/class-giovolume.html +++ /dev/null @@ -1,176 +0,0 @@ -gio.Volume

gio.Volume

gio.Volume — Volume management.

Synopsis

class gio.Volume(gobject.GInterface):
-    def can_eject()
def can_mount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_activation_root()
def get_drive()
def get_icon()
def get_identifier()
def get_mount()
def get_name()
def get_uuid()
def mount(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_finish(result)
def should_automount()

Ancestry

+-- gobject.GInterface
-  +-- gio.Volume
-

Prerequisites

- gio.Volume requires - gobject.GObject -

gio.Volume Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(volume, user_param1, ...)

"removed"

def callback(volume, user_param1, ...)

Description

- The gio.Volume - interface represents user-visible objects that can be mounted. Note, when porting - from GnomeVFS, gio.Volume - is the moral equivalent of GnomeVFSDrive. -

- Mounting a gio.Volume - instance is an asynchronous operation. For more information about asynchronous operations. - To mount a gio.Volume, first call - gio.Volume.mount() - with (at least) the gio.Volume - instance, optionally a - gio.MountOperation - object and a GAsyncReadyCallback. -

- Typically, one will only want to pass None for the GMountOperation - if automounting all volumes when a desktop session starts since it's not desirable - to put up a lot of dialogs asking for credentials. -

- The callback will be fired when the operation has resolved (either with success or failure), - and a GAsyncReady structure will be passed to the callback. That callback should then call - gio.Volume.mount_finish() - with the GVolume instance and the GAsyncReady data to see if the operation was completed - successfully. If an error is present when - gio.Volume.mount_finish() - is called, then it will be filled with any error information. -

- It is sometimes necessary to directly access the underlying operating system object behind a volume - (e.g. for passing a volume to an application via the commandline). For this purpose, GIO allows to obtain - an 'identifier' for the volume. There can be different kinds of identifiers, such as Hal UDIs, - filesystem labels, traditional Unix devices (e.g. /dev/sda2), uuids. GIO uses predefind strings - as names for the different kinds of identifiers: - "hal-udi", "label", etc. Use - gio.Volume.get_identifier() - to obtain an identifier for a volume. -

Methods

gio.Volume.can_eject

    def can_eject()

Returns :

True if the volume can be ejected, - False otherwise. -

- The can_eject() method checks if a volume can be ejected. -

gio.Volume.can_mount

    def can_mount()

Returns :

True if the volume can be mounted - for media changes, False otherwise. -

- The can_mount() method checks if a volume - can be mounted. -

gio.Volume.eject

    def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

flags affecting the unmount if required for eject. -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The eject() method asynchronously ejects a volume. -

- When the operation is finished, callback will be called. You can then call - gio.Volume.eject_finish() - to obtain the result of the operation. -

gio.Volume.eject_finish

    def eject_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the volume has been ejected - successfully, False otherwise. -

- The eject_finish() method finishes ejecting a volume. - If any errors occured during the operation, error will be set to contain the - errors and False will be returned. -

gio.Volume.enumerate_identifiers

    def enumerate_identifiers()

Returns :

a list of strings containing kinds of identifiers. -

- The enumerate_identifiers() method gets the kinds - of identifiers that volume has. Use - gio.Volume.get_identifier() - to obtain the identifiers themselves. -

gio.Volume.get_activation_root

    def get_activation_root()

Returns :

the activation root of volume or None. -

- The get_activation_root() method gets the activation - root for a gio.Volume - if it is known ahead of mount time. Returns None otherwise. - If not None and if volume is mounted, then the result of - gio.Mount.get_root() - on the GMount object obtained from - gio.Volume.get_mount() - will always either be equal or a prefix of what this function returns. - In other words, in code: -

-mount = volume.get_mount() # mounted, so never None
-mount_root = mount.get_root()
-volume_activation_root = volume.get_activation_root() # assume not None
-

- then the expression -

-volume_activation_root.has_prefix(mount_root) || volume_activation_root.equal(mount_root)
-

- will always be True. -

- Activation roots are typically used in - gio.VolumeMonitor - implementations to find the underlying mount to shadow, see - gio.Mount.is_shadowed() - for more details. -

gio.Volume.get_drive

    def get_drive()

Returns :

A gio.Drive - or None if volume is not associated with a drive. -

- The get_drive() method gets the drive for the volume. -

gio.Volume.get_icon

    def get_icon()

Returns :

gio.Icon - for the volume. -

- The get_icon() method gets the icon for volume. -

gio.Volume.get_identifier

    def get_identifier()

Returns :

A string containing the requested identfier, or - None if the - gio.Volume - doesn't have this kind of identifier. -

- The get_identifier() method gets the identifier of - the given kind for volume. -

gio.Volume.get_mount

    def get_mount()

Returns :

A - gio.Mount - or None if volume isn't mounted. -

- The get_mount() method gets the mount for the volume. -

gio.Volume.get_name

    def get_name()

Returns :

A string containing volume's name. -

- The get_name() method gets the name of volume. -

gio.Volume.get_uuid

    def get_uuid()

Returns :

the UUID for volume or None - if no UUID can be computed. -

- The get_uuid() method gets the UUID for the volume. - The reference is typically based on the file system UUID for the volume in - question and should be considered an opaque string. - Returns None if there is no UUID available. -

gio.Volume.mount

    def mount(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)

mount_operation :

A - gio.MountOperation - or None to avoid user interaction. -

callback :

A GAsyncReadyCallback to call when the request is satisfied. -

flags :

Flags affecting the operation -

cancellable :

Optional - gio.Cancellable - object, None to ignore. -

user_data :

The data to pass to callback function. -

- The mount() method mounts a volume. This is an - asynchronous operation, and is finished by calling - gio.Volume.mount_finish() - with the volume and GAsyncResult returned in the callback. -

gio.Volume.mount_finish

    def mount_finish(result)

result :

a gio.AsyncResult. -

Returns :

True if the volume has been mounted - successfully, False otherwise. -

- The mounted() method finishes mounting a volume. - If any errors occured during the operation, error will be set to contain - the errors and False will be returned. -

- If the mount operation succeeded, - get_mount() - on volume is guaranteed to return the mount right after calling this function; - there's no need to listen for the 'mount-added' signal on - gio.VolumeMonitor. -

gio.Volume.should_automount

    def should_automount()

Returns :

True if the volume should - be automatically mounted. -

- The should_automount() method returns whether - the volume should be automatically mounted. -

Signals

The "changed" gio.Volume Signal

    def callback(volume, user_param1, ...)

volume :

the volume

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when the volume has been changed. -

The "removed" gio.Volume Signal

    def callback(volume, user_param1, ...)

volume :

the volume

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- This signal is emitted when the - gio.Volume - have been removed. If the recipient is holding references to the object - they should release them so the object can be finalized. -

diff --git a/docs/html/class-giovolumemonitor.html b/docs/html/class-giovolumemonitor.html deleted file mode 100644 index bd59ccc..0000000 --- a/docs/html/class-giovolumemonitor.html +++ /dev/null @@ -1,135 +0,0 @@ -gio.VolumeMonitor

gio.VolumeMonitor

gio.VolumeMonitor — Volume Monitor.

Synopsis

class gio.VolumeMonitor(gobject.GObject):
-    def get_connected_drives()
def get_mount_for_uuid(uuid)
def get_mounts()
def get_volume_for_uuid(uuid)
def get_volumes()
-Functions
-    def gio.volume_monitor_adopt_orphan_mount()
def gio.volume_monitor_get()

gio.VolumeMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"drive-changed"

def callback(volume_monitor, drive, user_param1, ...)

"drive-connected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-disconnected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-eject-button"

def callback(volume_monitor, drive, user_param1, ...)

"mount-added"

def callback(volume_monitor, mount, user_param1, ...)

"mount-changed"

def callback(volume_monitor, mount, user_param1, ...)

"mount-pre-unmount"

def callback(volume_monitor, mount, user_param1, ...)

"mount-removed"

def callback(volume_monitor, mount, user_param1, ...)

"volume-added"

def callback(volume_monitor, volume, user_param1, ...)

"volume-changed"

def callback(volume_monitor, volume, user_param1, ...)

"volume-removed"

def callback(volume_monitor, volume, user_param1, ...)

Description

- The gio.VolumeMonitor - is for listing the user interesting devices and volumes on the computer. In other words, - what a file selector or file manager would show in a sidebar. -

Methods

gio.VolumeMonitor.get_connected_drives

    def get_connected_drives()

Returns :

a list of connected - gio.Drive objects. -

- The get_connected_drives() method gets a list - of drives connected to the system. -

gio.VolumeMonitor.get_mount_for_uuid

    def get_mount_for_uuid(uuid)

uuid :

The UUID to look for. -

Returns :

A - gio.Mount - or None if no such mount is available. -

- The get_mount_for_uuid() method finds a - gio.Mount - object by it's UUID (see - gio.Mount.get_uuid()) -

gio.VolumeMonitor.get_mounts

    def get_mounts()

Returns :

A list of - gio.Mount - objects. -

- The get_mounts() method gets a list of the mounts on the system. -

gio.VolumeMonitor.get_volume_for_uuid

    def get_volume_for_uuid(uuid)

uuid :

The UUID to look for. -

Returns :

A - gio.Volume - or None if no such volume is available. -

- The get_mount_for_uuid() method finds a - gio.Mount - object by it's UUID (see - gio.Mount.get_uuid()) -

gio.VolumeMonitor.get_volumes

    def get_volumes()

Returns :

A list of - gio.Volume - objects. -

- The get_volumes() method gets a list of the volumes on the system. -

Functions

gio.volume_monitor_adopt_orphan_mount

    def volume_monitor_adopt_orphan_mount()

Returns :

The gio.Volume - object that is the parent for mount or None if no wants to adopt the - gio.Mount. -

Warning

This method will be deprecated starting from GIO 2.20

- The volume_monitor_adopt_orphan_mount() function should - be called by any gio.VolumeMonitor - implementation when a new gio.Mount - object is created that is not associated with a - gio.Volume object. - It must be called just before emitting the mount_added signal. -

- If the return value is not None, the caller must associate the returned - gio.Volume - object with the - gio.Mount. - This involves returning it in it's - gio.Mount.get_volumes() - implementation. The caller must also listen for the "removed" signal on the - returned object and give up it's reference when handling that signal -

- Similary, if implementing - gio.volume_monitor_adopt_orphan_mount(), - the implementor must take a reference to mount and return it in it's - gio.Volume.get_mount() - implemented. Also, the implementor must listen for the "unmounted" signal - on mount and give up it's reference upon handling that signal. -

- There are two main use cases for this function. -

- One is when implementing a user space file system driver that reads blocks of - a block device that is already represented by the native volume monitor - (for example a CD Audio file system driver). Such a driver will generate it's own - gio.Mount - object that needs to be assoicated with the - gio.Volume - object that represents the volume. -

- The other is for implementing a - gio.VolumeMonitor - whose sole purpose is to return - gio.Volume - objects representing entries in the users "favorite servers" list or similar. -

gio.volume_monitor_get

    def volume_monitor_get()

Returns :

A reference to the - gio.VolumeMonitor - used by gio. -

- The volume_monitor_get() function gets the - volume monitor used by gio. -

Signals

The "drive-changed" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive that changed

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a drive changes. -

The "drive-connected" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive that was connected

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a drive is connected to the system. -

The "drive-disconnected" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive that was disconnected

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a drive is disconnected from the system. -

The "drive-eject-button" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive where the eject button was pressed

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when the eject button is pressed on drive. -

The "mount-added" gio.Volume Signal

    def callback(volume, mount, user_param1, ...)

volume_monitor :

the volume monitor

mount :

a Mount that was added.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mount is added. -

The "mount-changed" gio.Volume Signal

    def callback(volume_monitor, mount, user_param1, ...)

volume_monitor :

the volume monitor

mount :

the Mount that changed.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mount changes. -

The "mount-pre-unmount" gio.Volume Signal

    def callback(volume_monitor, mount, user_param1, ...)

volume_monitor :

the volume monitor

mount :

the Mount that is being unmounted.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mount is about to be removed. -

The "mount-removed" gio.Volume Signal

    def callback(volume_monitor, mount, user_param1, ...)

volume_monitor :

the volume monitor

mount :

the Mount that was removed.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mount is removed. -

The "volume-added" gio.Volume Signal

    def callback(volume_monitor, volume, user_param1, ...)

volume_monitor :

the volume monitor

volume :

a Volume that was added.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mountable volume is added to the system. -

The "volume-changed" gio.Volume Signal

    def callback(volume_monitor, volume, user_param1, ...)

volume_monitor :

the volume monitor

volume :

a Volume that changed.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when mountable volume is changed. -

The "volume-removed" gio.Volume Signal

    def callback(volume_monitor, volume, user_param1, ...)

volume_monitor :

the volume monitor

volume :

a Volume that was removed.

user_param1 :

the first user parameter (if any) specified - with the connect() - method

... :

additional user parameters (if any)

- Emitted when a mountable volume is removed from the system. -

diff --git a/docs/html/class-glibmaincontext.html b/docs/html/class-glibmaincontext.html index 9f815f6..48cf28b 100644 --- a/docs/html/class-glibmaincontext.html +++ b/docs/html/class-glibmaincontext.html @@ -1,7 +1,7 @@ glib.MainContext

glib.MainContext

glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.

Synopsis

class glib.MainContext:
-    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
-

Description

A glib.MainContext +in a glib.MainLoop.

Synopsis

class glib.MainContext:
+    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
+

Description

A glib.MainContext represents a set of event sources that can be run in a single thread. File descriptors (plain files, pipes or sockets) and timeouts are the standard event sources for GTK and PyGTK though @@ -13,7 +13,7 @@ events from lower priority sources. Single iterations of a iteration() method.

Constructor

    glib.MainContext()

Returns :

a new glib.MainContext object.

Creates a new glib.MainContext -object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block +object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block waiting for an event.

Returns :

True if events were dispatched.

The iteration() method runs a single iteration. This involves:

  • checking to see if any associated event sources are ready diff --git a/docs/html/class-glibmainloop.html b/docs/html/class-glibmainloop.html index f5ba208..38df43a 100644 --- a/docs/html/class-glibmainloop.html +++ b/docs/html/class-glibmainloop.html @@ -1,7 +1,7 @@ glib.MainLoop

    glib.MainLoop

    glib.MainLoop — an object representing the main event loop of a PyGTK - application.

    Synopsis

    class glib.MainLoop:
    -    glib.MainLoop(context=None, is_running=0)
    def get_context()
    def is_running()
    def quit()
    def run()

    Ancestry

    +-- glib.MainLoop
    -

    Description

    glib.MainLoop + application.

    Synopsis

    class glib.MainLoop:
    +    glib.MainLoop(context=None, is_running=0)
    def get_context()
    def is_running()
    def quit()
    def run()

    Ancestry

    +-- glib.MainLoop
    +

    Description

    glib.MainLoop represents a main event loop. A glib.MainLoop is created with the glib.MainLoop() constructor. After adding the initial event sources, the run() @@ -24,7 +24,7 @@ functions.

Returns :

a new glib.MainLoop object.

Creates a new glib.MainLoop -object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext +object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext the mainloop is associated with

The get_context() method returns the glib.MainContext that the mainloop was created with.

glib.MainLoop.is_running

    def is_running()

Returns :

True if the mainloop is diff --git a/docs/html/class-gobject.html b/docs/html/class-gobject.html index 1a71df7..e8eae25 100644 --- a/docs/html/class-gobject.html +++ b/docs/html/class-gobject.html @@ -1,6 +1,6 @@ -gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
-    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
-

Attributes

"props"Read/Write +gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
+    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
+

Attributes

"props"Read/Write

This attribute gives full access to GObject properties as simple attributes. It can be used to iterate over all the object properties, and can be used both on class or instance objects.

@@ -17,12 +17,12 @@ button_label = button.get_property(label_pspec.name)
"__doc__"ReadThe documentation for the object type. Uses "__gdoc__" if no specific documentation set.
"__gdoc__"ReadThe generated documentation for the underlying GObject - type.
"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject + type.

"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject class is the base class providing the common attributes and methods for the PyGTK classes. The gobject.GObject class is not a user interface widget class.

The gobject.GObject class provides the signal management methods, the object property access - methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the + methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the GObject

Returns :

a Python object containing the value of the property

The get_property() method returns the value of the property specified by property_name or @@ -161,7 +161,7 @@ still to be run will not be invoked.

emit_stop_by_name() method stops the current emission of the signal specified by detailed_signal. Any signal handlers in the list -still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the +still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the signal

property_spec :

the gobject.GParamSpec of the property that was changed

user_param1 :

the first user parameter (if any) specified with the connect() diff --git a/docs/html/class-gobjectgboxed.html b/docs/html/class-gobjectgboxed.html index 30b7dc5..0d4a4cb 100644 --- a/docs/html/class-gobjectgboxed.html +++ b/docs/html/class-gobjectgboxed.html @@ -1,9 +1,9 @@ -gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
-    def copy()

Ancestry

+-- gobject.GBoxed
-

Description

gobject.GBoxed +gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
+    def copy()

Ancestry

+-- gobject.GBoxed
+

Description

gobject.GBoxed is an abstract base class that encapsulates an opaque chunk of data to provide an object-oriented interface and a type that is registered with the GLIB type system. A boxed type is registered with functions that provide for the copying and freeing of the underlying data -structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed +structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed object

The copy() method makes and returns a copy of the boxed object.

diff --git a/docs/html/class-gobjectginterface.html b/docs/html/class-gobjectginterface.html index 5156c43..ab948f4 100644 --- a/docs/html/class-gobjectginterface.html +++ b/docs/html/class-gobjectginterface.html @@ -1,4 +1,4 @@ -gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
-

Ancestry

+-- gobject.GInterface
-

Description

gobject.GInterface +gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
+

Ancestry

+-- gobject.GInterface
+

Description

gobject.GInterface is an abstract base class that encapsulates a GInterface.

diff --git a/docs/html/class-gobjectgpointer.html b/docs/html/class-gobjectgpointer.html index 258a160..2d01e39 100644 --- a/docs/html/class-gobjectgpointer.html +++ b/docs/html/class-gobjectgpointer.html @@ -1,7 +1,7 @@ gobject.GPointer

gobject.GPointer

gobject.GPointer — an object containing a completely opaque chunk of - data

Synopsis

class gobject.GPointer:
-

Ancestry

+-- gobject.GPointer
-

Description

gobject.GPointer + data

Synopsis

class gobject.GPointer:
+

Ancestry

+-- gobject.GPointer
+

Description

gobject.GPointer is an abstract base class that encapsulates an opaque chunk of data and registers it with the GLIB type system. A pointer type has no methods and generic ways of copying and freeing the data. It diff --git a/docs/html/gio-class-reference.html b/docs/html/gio-class-reference.html deleted file mode 100644 index 9b0f9b6..0000000 --- a/docs/html/gio-class-reference.html +++ /dev/null @@ -1 +0,0 @@ -PyGio Class Reference

PyGio Class Reference

Table of Contents

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).
gio.AppLaunchContext — Application launch context.
gio.AsyncResult — Asynchronous Function Results.
gio.BufferedInputStream — Buffered Input Stream
gio.BufferedOutputStream — Buffered Output Stream
gio.Cancellable — Thread-safe Operation Cancellation Stack.
gio.DataInputStream — Data Input Stream
gio.DataOutputStream — Data Output Stream
gio.Drive — Virtual File System drive management.
gio.Emblem — An object for emblems.
gio.EmblemedIcon — Icon with emblems.
gio.File — File and Directory Handling.
gio.FileAttributeInfo — Information about a specific attribute.
gio.FileEnumerator — Enumerated Files Routines.
gio.FileIcon — Icons pointing to an image file.
gio.FileInfo — File Information and Attributes
gio.FileInputStream — Base class for implementing streaming input
gio.FileMonitor — File Monitor
gio.FileOutputStream — Base class for implementing streaming input
gio.FilterInputStream — Filter Input Stream
gio.FilterOutputStream — Filter Output Stream
gio.Icon — Interface for icons.
gio.InputStream — Base class for implementing streaming input
gio.LoadableIcon — Interface for icons.
gio.MemoryInputStream — Base class for implementing streaming input
gio.MemoryOutputStream — Streaming output operations on memory chunks
gio.Mount — Mount management
gio.MountOperation — Authentication methods for mountable locations.
gio.OutputStream — Base class for implementing streaming input
gio.Seekable — Stream seeking interface.
gio.SimpleAsyncResult — Simple asynchronous results implementation.
gio.ThemedIcon — Icon theming support.
gio.Volume — Volume management.
gio.VolumeMonitor — Volume Monitor.
gio Functions
gio Constants — the built-in constants of the gio module
diff --git a/docs/html/gio-constants.html b/docs/html/gio-constants.html deleted file mode 100644 index 074b1d4..0000000 --- a/docs/html/gio-constants.html +++ /dev/null @@ -1,414 +0,0 @@ -gio Constants

gio Constants

gio Constants — the built-in constants of the gio module

Description

Gio Ask Password Flags Constants

- Flags that are used to request specific information from the user, or to - notify the user of their choices in an authentication situation. -

gio.ASK_PASSWORD_ANONYMOUS_SUPPORTED

operation supports anonymous users.

gio.ASK_PASSWORD_NEED_DOMAIN

operation requires a domain.

gio.ASK_PASSWORD_NEED_PASSWORD

operation requires a password.

gio.ASK_PASSWORD_NEED_USERNAME

operation requires a username.

gio.ASK_PASSWORD_SAVING_SUPPORTED

operation supports saving settings.

Gio AppInfo Create Flags Constants

- Flags used when creating a gio.AppInfo -

gio.APP_INFO_CREATE_NONE

No flags.

gio.APP_INFO_CREATE_NEEDS_TERMINAL

Application opens in a terminal window.

gio.APP_INFO_CREATE_SUPPORTS_URIS

Application supports URI arguments.

Gio Data Stream Byte Order Constants

- Used to ensure proper endianness of streaming data sources across various machine architectures. -

gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN

Selects Big Endian byte order.

gio.DATA_STREAM_BYTE_ORDER_HOST_ENDIAN

Selects endianness based on host machine's architecture.

gio.DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN

Selects Little Endian byte order.

Gio Data Stream Newline Type Constants

- Used when checking for or setting the line endings for a given file. -

gio.DATA_STREAM_NEWLINE_TYPE_LF

Selects "LF" line endings, common on most modern UNIX platforms.

gio.DATA_STREAM_NEWLINE_TYPE_CR

Selects "CR" line endings.

gio.DATA_STREAM_NEWLINE_TYPE_CR_LF

Selects "CR, LF" line ending, common on Microsoft Windows.

gio.DATA_STREAM_NEWLINE_TYPE_ANY

Automatically try to handle any line ending type.

Gio Emblem Origin Constants

- GEmblemOrigin is used to add information about the origin of the emblem to GEmblem. -

gio.EMBLEM_ORIGIN_DEVICE

Embleme adds device-specific information.

gio.EMBLEM_ORIGIN_LIVEMETADATA

Emblem depicts live metadata, such as "readonly".

gio.EMBLEM_ORIGIN_TAG

Emblem comes from a user-defined tag, e.g. set by nautilus (in the future).

gio.EMBLEM_ORIGIN_UNKNOWN

Emblem of unknown origin.

Gio Error Constants

- GIOError Error codes returned by GIO functions. -

gio.ERROR_ALREADY_MOUNTED

File is already mounted.

gio.ERROR_BUSY

File is busy.

gio.ERROR_CANCELLED

Operation was cancelled. See - gio.Cancellable. -

gio.ERROR_CANT_CREATE_BACKUP

Backup couldn't be created.

gio.ERROR_CLOSED

File was closed.

gio.ERROR_EXISTS

File already exists error.

gio.ERROR_FAILED

Generic error condition for when any operation fails.

gio.ERROR_FAILED_HANDLED

Operation failed and a helper program has already interacted with - the user. Do not display any error dialog.

gio.ERROR_FILENAME_TOO_LONG

Filename is too many characters.

gio.ERROR_HOST_NOT_FOUND

Host couldn't be found (remote operations).

gio.ERROR_INVALID_ARGUMENT

Invalid argument.

gio.ERROR_INVALID_FILENAME

Filename is invalid or contains invalid characters.

gio.ERROR_IS_DIRECTORY

File is a directory error.

gio.ERROR_NOT_DIRECTORY

File is not a directory.

gio.ERROR_NOT_EMPTY

File is a directory that isn't empty.

gio.ERROR_NOT_FOUND

File not found error.

gio.ERROR_NOT_MOUNTABLE_FILE

File cannot be mounted.

gio.ERROR_NOT_MOUNTED

File isn't mounted.

gio.ERROR_NOT_REGULAR_FILE

File is not a regular file.

gio.ERROR_NOT_SUPPORTED

Operation not supported for the current backend.

gio.ERROR_NOT_SYMBOLIC_LINK

File is not a symbolic link.

gio.ERROR_NO_SPACE

No space left on drive.

gio.ERROR_PENDING

Operations are still pending.

gio.ERROR_PERMISSION_DENIED

Permission denied.

gio.ERROR_READ_ONLY

File is read only.

gio.ERROR_TIMED_OUT

Operation timed out.

gio.ERROR_TOO_MANY_LINKS

File contains too many symbolic links.

gio.ERROR_TOO_MANY_OPEN_FILES

The current process has too many files open and can't open any - more. Duplicate descriptors do count toward this limit. Since 2.20

gio.ERROR_WOULD_BLOCK

Operation would block.

gio.ERROR_WOULD_MERGE

Operation would merge files.

gio.ERROR_WOULD_RECURSE

Operation would be recursive.

gio.ERROR_WRONG_ETAG

File's Entity Tag was incorrect.

Gio File Attribute Constants

- The file attributes. -

gio.FILE_ATTRIBUTE_STANDARD_TYPE

- "standard::type" A key in the "standard" namespace for storing file types. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. The value for this key should contain a - Gio File Type Constants -

gio.FILE_ATTRIBUTE_STANDARD_IS_HIDDEN

- "standard::is-hidden" A key in the "standard" namespace for checking if a file is hidden. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_STANDARD_IS_BACKUP

- "standard::is-backup" A key in the "standard" namespace for checking if a file is a backup file. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_STANDARD_IS_SYMLINK

- "standard::is-symlink" A key in the "standard" namespace for checking if the file is a symlink. - Typically the actual type is something else, if we followed the symlink to get the type. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL

- "standard::is-virtual" A key in the "standard" namespace for checking if a file is virtual. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_STANDARD_NAME

- "standard::name" A key in the "standard" namespace for getting the name of the file. - The name is the on-disk filename which may not be in any known encoding, - and can thus not be generally displayed as is. Use - gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the name in a user - interface. Corresponding GFileAttributeType is gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME

- "standard::display-name" A key in the "standard" namespace for getting the display - name of the file. A display name is guaranteed to be in UTF8 and can thus be displayed - in the UI. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_EDIT_NAME

- "standard::edit-name" A key in the "standard" namespace for edit name of the file. - An edit name is similar to the display name, but it is meant to be used when you want - to rename the file in the UI. The display name might contain information you don't - want in the new filename (such as "(invalid unicode)" if the filename was in an - invalid encoding). Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_COPY_NAME

- "standard::copy-name" A key in the "standard" namespace for getting the copy - name of the file. The copy name is an optional version of the name. If available - it's always in UTF8, and corresponds directly to the original filename (only transcoded - to UTF8). This is useful if you want to copy the file to another filesystem that might - have a different encoding. If the filename is not a valid string in the encoding selected - for the filesystem it is in then the copy name will not be set. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_ICON

- "standard::icon" A key in the "standard" namespace for getting the icon for the file. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a - gio.Icon. -

gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE

- "standard::content-type" A key in the "standard" namespace for getting the content type of the file. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. The value for this key should contain a valid content type. -

gio.FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE

- "standard::fast-content-type" A key in the "standard" namespace for getting the fast - content type. The fast content type isn't as reliable as the regular one, as it - only uses the filename to guess it, but it is faster to calculate than the regular - content type. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_SIZE

- "standard::size" A key in the "standard" namespace for getting the file's size (in bytes). Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT64. -

gio.FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET

- "standard::symlink-target" A key in the "standard" namespace for getting the target URI - for the file, in the case of gio.FILE_TYPE_SHORTCUT or gio.FILE_TYPE_MOUNTABLE files. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_STANDARD_SORT_ORDER

- "standard::sort-order" A key in the "standard" namespace for setting the sort order of a file. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_INT32. An example use would be in file managers, which would use this - key to set the order files are displayed. Files with smaller sort order should be sorted first, - and files without sort order as if sort order was zero. -

gio.FILE_ATTRIBUTE_ETAG_VALUE

- "etag::value" A key in the "etag" namespace for getting the value of the file's entity tag. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_ID_FILE

- "id::file" A key in the "id" namespace for getting a file identifier. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. An example use would be during listing files, - to avoid recursive directory scanning. -

gio.FILE_ATTRIBUTE_ID_FILESYSTEM

- "id::filesystem" A key in the "id" namespace for getting the file system identifier. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. An example use would be during drag and - drop to see if the source and target are on the same filesystem (default to move) or not (default to copy). -

gio.FILE_ATTRIBUTE_ACCESS_CAN_READ

- "access::can-read" A key in the "access" namespace for getting read privileges. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to read the file. -

gio.FILE_ATTRIBUTE_ACCESS_CAN_WRITE

- "access::can-write" A key in the "access" namespace for getting write privileges.Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to write to the file. -

gio.FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE

- "access::can-execute" A key in the "access" namespace for getting execution privileges. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to execute the file. -

gio.FILE_ATTRIBUTE_ACCESS_CAN_DELETE

- "access::can-delete" A key in the "access" namespace for checking deletion privileges. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to delete the file. -

gio.FILE_ATTRIBUTE_ACCESS_CAN_TRASH

- "access::can-trash" A key in the "access" namespace for checking trashing privileges. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to move the file to the trash. -

gio.FILE_ATTRIBUTE_ACCESS_CAN_RENAME

- "access::can-rename" A key in the "access" namespace for checking renaming privileges. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to rename the file. -

gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT

- "mountable::can-mount" A key in the "mountable" namespace for checking if - a file (of type G_FILE_TYPE_MOUNTABLE) is mountable. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT

- "mountable::can-unmount" A key in the "mountable" namespace for checking if a file - (of type G_FILE_TYPE_MOUNTABLE) is unmountable. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT

- "mountable::can-eject" A key in the "mountable" namespace for checking if a file - (of type G_FILE_TYPE_MOUNTABLE) can be ejected. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE

- "mountable::unix-device" A key in the "mountable" namespace for getting the unix device. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI

- "mountable::hal-udi" A key in the "mountable" namespace for getting the - HAL UDI for the mountable file. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_TIME_MODIFIED

- "time::modified" A key in the "time" namespace for getting the time the file was last modified. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was modified. -

gio.FILE_ATTRIBUTE_TIME_MODIFIED_USEC

- "time::modified-usec" A key in the "time" namespace for getting the miliseconds - of the time the file was last modified. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_TIME_ACCESS

- "time::access" A key in the "time" namespace for getting the time the file was last accessed. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was last accessed. -

gio.FILE_ATTRIBUTE_TIME_ACCESS_USEC

- "time::access-usec" A key in the "time" namespace for getting the microseconds of - the time the file was last accessed. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_TIME_CHANGED

- "time::changed" A key in the "time" namespace for getting the time the - file was last changed. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was last changed. - This corresponds to the traditional UNIX ctime. -

gio.FILE_ATTRIBUTE_TIME_CHANGED_USEC

- "time::changed-usec" A key in the "time" namespace for getting the microseconds - of the time the file was last changed. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_TIME_CREATED

- "time::created" A key in the "time" namespace for getting the time the file was created. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was created. - This corresponds to the NTFS ctime. -

gio.FILE_ATTRIBUTE_TIME_CREATED_USEC

- "time::created-usec" A key in the "time" namespace for getting the microseconds of the time the - file was created. This should be used in conjunction with G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_DEVICE

- "unix::device" A key in the "unix" namespace for getting the device id of the device the file - is located on (see stat() documentation). This attribute is only available - for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_INODE

- "unix::inode" A key in the "unix" namespace for getting the inode of the file. This attribute is only - available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT64. -

gio.FILE_ATTRIBUTE_UNIX_MODE

- "unix::mode" A key in the "unix" namespace for getting the mode of the file (e.g. - whether the file is a regular file, symlink, etc). See lstat() documentation. - This attribute is only available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_NLINK

- "unix::nlink" A key in the "unix" namespace for getting the number of hard links - for a file. See lstat() documentation. This attribute is only available for UNIX - file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_UID

- "unix::uid" A key in the "unix" namespace for getting the user ID for the file. This attribute - is only available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_GID

- "unix::gid" A key in the "unix" namespace for getting the group ID for the file. - This attribute is only available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_RDEV

- "unix::rdev" A key in the "unix" namespace for getting the device ID for the file - (if it is a special file). See lstat() documentation. This attribute is only available - for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_BLOCK_SIZE

- "unix::block-size" A key in the "unix" namespace for getting the block size for - the file system. This attribute is only available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is gio.FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_UNIX_BLOCKS

- "unix::blocks" A key in the "unix" namespace for getting the number of blocks allocated - for the file. This attribute is only available for UNIX file systems. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT64. -

gio.FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT

- "unix::is-mountpoint" A key in the "unix" namespace for checking if the file represents - a UNIX mount point. This attribute is True if the file is a UNIX mount point. - This attribute is only available for UNIX file systems. Corresponding - GFileAttributeType - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_DOS_IS_ARCHIVE

- "dos::is-archive" A key in the "dos" namespace for checking if the file's archive - flag is set. This attribute is True if the archive flag is set. - This attribute is only available for DOS file systems. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_DOS_IS_SYSTEM

- "dos::is-system" A key in the "dos" namespace for checking if the file's backup - flag is set. This attribute is True if the backup flag is set. - This attribute is only available for DOS file systems. Corresponding - Gio File Attribute Type Constants is - G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_OWNER_USER

- "owner::user" A key in the "owner" namespace for getting the user name - of the file's owner. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_OWNER_USER_REAL

- "owner::user-real" A key in the "owner" namespace for getting the real name - of the user that owns the file. Corresponding - Gio File Attribute Type Constants is - G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_OWNER_GROUP

- "owner::group" A key in the "owner" namespace for getting the file owner's - group. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_THUMBNAIL_PATH

- "thumbnail::path" A key in the "thumbnail" namespace for getting the path - to the thumbnail image. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_BYTE_STRING. -

gio.FILE_ATTRIBUTE_THUMBNAILING_FAILED

- "thumbnail::failed" A key in the "thumbnail" namespace for checking if thumbnailing failed. This attribute - is True if thumbnailing failed. Corresponding - Gio File Attribute Type Constants is - G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_PREVIEW_ICON

- "preview::icon" A key in the "preview" namespace for getting a - gio.Icon - that can be used to get preview of the file. For example, it - may be a low resolution thumbnail without metadata. Corresponding - Gio File Attribute Type Constants is - G_FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a GIcon. -

gio.FILE_ATTRIBUTE_FILESYSTEM_SIZE

- "filesystem::size" A key in the "filesystem" namespace for getting the total - size (in bytes) of the file system, used in - query_filesystem_info(). - Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT64. -

gio.FILE_ATTRIBUTE_FILESYSTEM_FREE

- "filesystem::free" A key in the "filesystem" namespace for getting the number of bytes of free space left - on the file system. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT64. -

gio.FILE_ATTRIBUTE_FILESYSTEM_TYPE

- "filesystem::type" A key in the "filesystem" namespace for getting the file system's type. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_FILESYSTEM_READONLY

- "filesystem::readonly" A key in the "filesystem" namespace for checking if the - file system is read only. Is set to True if the file system - is read only. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. -

gio.FILE_ATTRIBUTE_GVFS_BACKEND

- "gvfs::backend" A key in the "gvfs" namespace that gets the name of the current GVFS backend in use. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

gio.FILE_ATTRIBUTE_SELINUX_CONTEXT

- "selinux::context" A key in the "selinux" namespace for getting the file's SELinux context. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. - Note that this attribute is only available if GLib has been built with SELinux support. -

gio.FILE_ATTRIBUTE_TRASH_ITEM_COUNT

- "trash::item-count" A key in the "trash" namespace. When requested against "trash:///" returns the number - of (toplevel) items in the trash folder. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_UINT32. -

gio.FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW

- "filesystem::use-preview" A key in the "filesystem" namespace for hinting a file manager - application whether it should preview (e.g. thumbnail) files on the file system. - The value for this key contain a GFilesystemPreviewType. -

gio.FILE_ATTRIBUTE_STANDARD_DESCRIPTION

- "standard::description" A key in the "standard" namespace for getting the description - of the file. The description is a utf8 string that describes the file, generally containing - the filename, but can also contain furter information. Example descriptions could be - "filename (on hostname)" for a remote file or "filename (in trash)" for a - file in the trash. This is useful for instance as the window title when - displaying a directory or for a bookmarks menu. Corresponding - Gio File Attribute Type Constants - is G_FILE_ATTRIBUTE_TYPE_STRING. -

Gio File Attribute Type Constants

- The data types for file attributes. -

gio.FILE_ATTRIBUTE_TYPE_BOOLEAN

a boolean value.

gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING

a zero terminated string of non-zero bytes.

gio.FILE_ATTRIBUTE_TYPE_INT32

a signed 4-byte/32-bit integer.

gio.FILE_ATTRIBUTE_TYPE_INT64

a signed 8-byte/64-bit integer.

gio.FILE_ATTRIBUTE_TYPE_INVALID

indicates an invalid or uninitalized type.

gio.FILE_ATTRIBUTE_TYPE_OBJECT

a gobject.GObject.

gio.FILE_ATTRIBUTE_TYPE_STRING

a null terminated UTF8 string.

gio.FILE_ATTRIBUTE_TYPE_UINT32

an unsigned 4-byte/32-bit integer.

gio.FILE_ATTRIBUTE_TYPE_UINT64

an unsigned 8-byte/64-bit integer.

Gio File Attribute Flags Constants

- Flags specifying the behaviour of an attribute. -

gio.FILE_ATTRIBUTE_INFO_NONE

no flags set.

gio.FILE_ATTRIBUTE_INFO_COPY_WITH_FILE

copy the attribute values when the file is copied.

gio.FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED

copy the attribute values when the file is moved.

Gio File Create Flags Constants

- Flags used when an operation may create a file. -

gio.FILE_CREATE_NONE

No flags set.

gio.FILE_CREATE_PRIVATE

Create a file that can only be accessed by the current user.

gio.FILE_CREATE_REPLACE_DESTINATION

- Replace the destination as if it didn't exist before. Don't try - to keep any old permissions, replace instead of following links. This is - generally useful if you're doing a "copy over" rather than a "save new version of" - replace operation. You can think of it as "unlink destination" before writing - to it, although the implementation may not be exactly like that. -

Gio File Copy Flags Constants

- Flags used when copying or moving files. -

gio.FILE_COPY_NONE

No flags set.

gio.FILE_COPY_OVERWRITE

Overwrite any existing files.

gio.FILE_COPY_BACKUP

Make a backup of any existing files.

gio.FILE_COPY_NOFOLLOW_SYMLINKS

Don't follow symlinks.

gio.FILE_COPY_ALL_METADATA

Copy all file metadata instead of just default set used for copy - (see gio.FileInfo).

gio.FILE_COPY_NO_FALLBACK_FOR_MOVE

Don't use copy and delete fallback if native move not supported.

gio.FILE_COPY_TARGET_DEFAULT_PERMS

Leaves target file with default perms, instead of setting the source file perms.

Gio File Monitor Flags Constants

- Flags used to set what a - gio.FileMonitor - will watch for. -

gio.FILE_MONITOR_NONE

No flags set.

gio.FILE_MONITOR_WATCH_MOUNTS

Watch for mount events.

Gio File Query Info Flags Constants

- Flags used when querying a - gio.FileInfo. -

gio.FILE_QUERY_INFO_NONE

No flags set.

gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS

Don't follow symlinks.

Gio File Type Constants

- Indicates the file's on-disk type. -

gio.FILE_TYPE_DIRECTORY

File handle represents a directory.

gio.FILE_TYPE_MOUNTABLE

File is a mountable location.

gio.FILE_TYPE_REGULAR

File handle represents a regular file.

gio.FILE_TYPE_SHORTCUT

File is a shortcut (Windows systems).

gio.FILE_TYPE_SPECIAL

File is a "special" file, such as a socket, fifo, block device, or character device.

gio.FILE_TYPE_SYMBOLIC_LINK

File handle represents a symbolic link (Unix systems).

gio.FILE_TYPE_UNKNOWN

File's type is unknown.

Gio Mount Mount Flags Constants

- Flags used when mounting a mount. -

gio.MOUNT_MOUNT_NONE

No flags set.

Gio Mount Unmount Flags Constants

- Flags used when unmounting a mount. -

gio.MOUNT_UNMOUNT_NONE

No flags set.

gio.MOUNT_UNMOUNT_FORCE

Unmount even if there are outstanding file operations on the mount.

Gio Mount Operation Result Constants

- returned as a result when a request for information is send by the mounting operation. -

gio.MOUNT_OPERATION_HANDLED

The request was fulfilled and the user specified data is now available.

gio.MOUNT_OPERATION_ABORTED

The user requested the mount operation to be aborted.

gio.MOUNT_OPERATION_UNHANDLED

The request was unhandled (i.e. not implemented).

Gio Password Save Constants

- is used to indicate the lifespan of a saved password. -

- Gvfs stores passwords in the Gnome keyring when this flag allows it to, - and later retrieves it again from there. -

gio.PASSWORD_SAVE_FOR_SESSION

save a password for the session.

gio.PASSWORD_SAVE_NEVER

never save a password.

gio.PASSWORD_SAVE_PERMANENTLY

save a password permanently.
diff --git a/docs/html/gio-functions.html b/docs/html/gio-functions.html deleted file mode 100644 index 77a4ff7..0000000 --- a/docs/html/gio-functions.html +++ /dev/null @@ -1,74 +0,0 @@ -gio Functions

gio Functions

gio Functions

Description

- These functions are part of the PyGObject gio module - but are not directly associated with a specific class -

Functions

gio.content_type_can_be_executable

    def content_type_can_be_executable(type)

type :

a content type string. -

Returns :

True if the file type corresponds - to a type that can be executable, False otherwise. -

- The content_type_can_be_executable() function checks - if a content type can be executable. Note that for instance things like text files - can be executables (i.e. scripts and batch files). -

gio.content_type_equals

    def content_type_equals(type1, type2)

type1 :

a content type string. -

type2 :

a content type string. -

Returns :

True if the two strings are - identical or equivalent, False otherwise. -

- The content_type_equals() function compares - two content types for equality. -

gio.content_type_from_mime_type

    def content_type_from_mime_type(mime_type)

mime_type :

a mime type string. -

Returns :

The content type or None when does not know. -

- The content_type_from_mime_type() function tries - to find a content type based on the mime type name. -

gio.content_type_get_description

    def content_type_get_description(type)

type :

a content type string. -

Returns :

a short description of the content type type. -

- The content_type_get_description() function - gets the human readable description of the content type. -

gio.content_type_get_icon

    def content_type_get_icon(type)

type :

a content type string. -

Returns :

A gio.Icon - corresponding to the content type. -

- The content_type_get_icon() function - gets the icon for a content type. -

gio.content_type_get_mime_type

    def content_type_get_mime_type(type)

type :

a content type string. -

Returns :

the registered mime-type for the given type, - or None if unknown. -

- The content_type_get_mime_type() function - gets the mime-type for the content type. If one is registered -

gio.content_type_guess

    def content_type_guess(filename, data, want_uncertain)

filename :

a string, or None. -

data :

a stream of data, or None. -

want_uncertain :

a flag indicating the certainty of the result. -

Returns :

a string indicating a guessed content type for the given data. -

- The content_type_guess() function guesses - the content type based on example data. If the function is uncertain, - result_uncertain will be set to True. Either filename - or data may be None, in which case the guess will be - based solely on the other argument. -

gio.content_type_is_a

    def content_type_is_a(type, supertype)

type :

a content type string. -

supertype :

a string. -

Returns :

True if type is a kind of - supertype, False otherwise. -

- The content_type_is_a() function determines - if type is a subset of supertype. -

gio.content_type_is_unknown

    def content_type_is_unknown(type)

type :

a content type string. -

Returns :

True if the type is the unknown type. -

- The content_type_is_unknown() function checks if - the content type is the generic "unknown" type. On unix this is the - "application/octet-stream" mimetype, while on win32 it is "*". -

gio.content_types_get_registered

    def content_types_get_registered()

Returns :

a list of the registered content types. -

- The content_types_get_registered() function - gets a list of strings containing all the registered content types - known to the system. -

gio.io_error_from_errno

    def io_error_from_errno(err_no)

err_no :

Error number. -

Returns :

a - Gio Error Constants -

- The io_error_from_errno() function converts - error codes into GIO error codes. -

diff --git a/docs/html/giounix-class-reference.html b/docs/html/giounix-class-reference.html deleted file mode 100644 index e91aa73..0000000 --- a/docs/html/giounix-class-reference.html +++ /dev/null @@ -1 +0,0 @@ -PyGio Unix Class Reference

PyGio Unix Class Reference

Table of Contents

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.
gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.
diff --git a/docs/html/glib-constants.html b/docs/html/glib-constants.html index 4e56956..4589a6b 100644 --- a/docs/html/glib-constants.html +++ b/docs/html/glib-constants.html @@ -1,4 +1,4 @@ -glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

+glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

 Glib IO Condition Constants
 Glib Priority Constants
 Glib Spawn Flag Constants
diff --git a/docs/html/glib-functions.html b/docs/html/glib-functions.html
index ffb796f..d59f6ec 100644
--- a/docs/html/glib-functions.html
+++ b/docs/html/glib-functions.html
@@ -1,6 +1,6 @@
-glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

-    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib -module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when +glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

+    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib +module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when PyGTK is idle

... :

optionals arguments to be passed to callback

Returns :

an integer ID

The glib.idle_add() function adds a function (specified by callback) to be called diff --git a/docs/html/gobject-constants.html b/docs/html/gobject-constants.html index 6ff3ee5..e7d56e1 100644 --- a/docs/html/gobject-constants.html +++ b/docs/html/gobject-constants.html @@ -1,4 +1,4 @@ -gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

+gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

 GObject Param Flag Constants
 GObject Signal Flag Constants
 GObject Built-in Type Constants
@@ -60,4 +60,4 @@ by gobject.

GObject Version Constants

The Version constants specify the version of GLIB used by PyGTK as a 3-tuple containing the major, minor and patch release numbers.

gobject.glib_version

A 3-tuple containing (major, minor, patch) release - numbers.
+ numbers.
diff --git a/docs/html/gobject-functions.html b/docs/html/gobject-functions.html index 3853a06..c1cc6fc 100644 --- a/docs/html/gobject-functions.html +++ b/docs/html/gobject-functions.html @@ -1,12 +1,12 @@ -gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

+gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

     def gobject.type_name(type)
def gobject.type_from_name(type_name)
def gobject.type_parent(type)
def gobject.type_is_a(type, parent_type)
def gobject.type_children(type)
def gobject.type_interfaces(type)
def gobject.type_register(class)
def gobject.signal_new(signal_name, type, flags, return_type, param_types)
def gobject.signal_list_names(type)
def gobject.signal_list_ids(type)
def gobject.signal_lookup(name, type)
def gobject.signal_name(signal_id)
def gobject.signal_query(name, type)
def gobject.signal_query(signal_id)
def gobject.list_properties(type)
def gobject.new(type, ...)
def gobject.signal_accumulator_true_handled()
def gobject.add_emission_hook(type, name, callback, ...)
def gobject.remove_emission_hook(type, name, hook_id)
def gobject._install_metaclass(metaclass) -

Description

These functions are part of the PyGTK gobject +

Description

These functions are part of the PyGTK gobject module but are not directly associated with a specific class.

Note

Many functions that previously were in this namespace got moved to glib namespace instead. They are still available in gobject for backward compatibility, but not documented here. If you miss documentation for some function, be sure to check glib first. -

Functions

gobject.type_name

    def gobject.type_name(type)
- - "buffer-size" - Read - Write - Construct - The size of the backend buffer. Allowed values: >= 1. Default value: 4096. - - - - - - - - - - Description - - - gio.BufferedInputStream - implements gio.FilterInputStream - and provides for buffered reads. - - - By default, - gio.BufferedInputStream's - buffer size is set at 4 kilobytes. - - - To create a buffered input stream, use - gio.BufferedInputStream(), - or gio.buffered_input_stream_new_sized() - to specify the buffer's size at construction. - - - To get the size of a buffer within a buffered input stream, use - get_buffer_size(). - To change the size of a buffered input stream's buffer, use - set_buffer_size(). - Note that the buffer's size cannot be reduced below the size of the data within the buffer. - - - - - Constructor - - - gio.BufferedInputStream - base_stream - - - - base_stream : - a - gio.InputStream. - - - - Returns : - a new - gio.InputStream - for the given base_stream. - - - - - - Creates a new gio.InputStream - from the given base_stream, with a buffer set to the default size (4 kilobytes). - - - - - - Methods - - - gio.BufferedInputStream.fill - - - fill - count - cancellableNone - - - - - count : - the number of bytes that will be read from the stream. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - the number of bytes read into stream's buffer, - up to count, or -1 on error. - - - - - - The fill() method tries to read count bytes - from the stream into the buffer. Will block during this read. - - - If count is zero, returns zero and does nothing. A value of count - larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. - - - On success, the number of bytes read into the buffer is returned. It - is not an error if this is not the same as the requested size, as it can - happen e.g. near the end of a file. Zero is returned on end of file - (or if count is zero), but never otherwise. - - - If count is -1 then the attempted read size is equal to the number - of bytes that are required to fill the buffer. - - - If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. - - - On error -1 is returned and error is set accordingly. - - - For the asynchronous, non-blocking, version of this function, see - gio.BufferedInputStream.fill_async(). - - - - - gio.BufferedInputStream.fill_async - - - fill_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - count : - the number of bytes that will be read from the stream. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The fill_async() method reads data into stream's - buffer asynchronously, up to count size. io_priority can be used to - prioritize reads. - - - For the synchronous version of this function, see - gio.BufferedInputStream.fill(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set - - - If count is -1 then the attempted read size is equal to the number of bytes - that are required to fill the buffer. - - - - - gio.BufferedInputStream.fill_finish - - - fill_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - the size of the read stream, or -1 on an error. - - - - - - The fill_finish() method finishes an asynchronous - file append operation started with - gio.BufferedInputStream.fill_async(). - - - - - gio.BufferedInputStream.get_available - - - get_available - - - - - - Returns : - size of the available stream. - - - - - - The get_available() method gets the size of - the available data within the stream. - - - - - gio.BufferedInputStream.get_buffer_size - - - get_buffer_size - - - - - - Returns : - the current buffer size. - - - - - - The get_buffer_size() method gets the size - of the input buffer. - - - - - gio.BufferedInputStream.read_byte - - - read_byte - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - the byte read from the stream, or -1 on end of stream or error. - - - - - - The read_byte() method tries to read a single - byte from the stream or the buffer. Will block during this read. - - - On success, the byte read from the stream is returned. On end of stream -1 - is returned but it's not an exceptional error and error is not set. - - - If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. - - - On error -1 is returned and error is set accordingly. - - - - - gio.BufferedInputStream.set_buffer_size - - - set_buffer_size - size - - - - - size : - the new buffer size. - - - - - - The set_buffer_size() method sets the size - of the internal buffer of stream to size, or to the size of the contents - of the buffer. The buffer can never be resized smaller than its current contents. - - - - - - Functions - - - gio.buffered_input_stream_new_sized - - - buffered_input_stream_new_sized - size - - - - - size : - the requested buffer size. - - - - Returns : - A new - gio.InputStream. - - - - - - The buffered_input_stream_new_sized() function creates - a new gio.BufferedInputStream - from the given base_stream, with a buffer set to size. - - - - diff --git a/docs/reference/pygio-bufferedoutputstream.xml b/docs/reference/pygio-bufferedoutputstream.xml deleted file mode 100644 index 6d7900f..0000000 --- a/docs/reference/pygio-bufferedoutputstream.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - gio.BufferedOutputStream - Buffered Output Stream - - - - Synopsis - - - gio.BufferedOutputStream - gio.FilterOutputStream - - - gio.BufferedOutputStream - base_stream - - - - get_auto_grow - - - - get_buffer_size - - - - set_auto_grow - auto_grow - - - set_buffer_size - size - - - - - -Functions - - - gio.buffered_output_stream_new_sized - size - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.FilterOutputStream - +-- gio.BufferedOutputStream - - - - - - gio.BufferedOutputStream Properties - -
- - - - - -
- - "auto-grow" - Read - Write - Whether the buffer should automatically grow. Default value: False. - - - "buffer-size" - Read - Write - Construct - The size of the backend buffer. Allowed values: >= 1. Default value: 4096. - - - - - - - - - - Description - - - gio.BufferedOutputStream - implements gio.FilterOutputStream - and provides for buffered writes. - - - By default, - gio.BufferedOutputStream's - buffer size is set at 4 kilobytes. - - - To create a buffered output stream, use - gio.BufferedOutputStream(), - or gio.buffered_output_stream_new_sized() - to specify the buffer's size at construction. - - - To get the size of a buffer within a buffered output stream, use - gio.BufferedOutputStream.get_buffer_size(). - To change the size of a buffered output stream's buffer, use - gio.BufferedOutputStream.set_buffer_size(). - Note that the buffer's size cannot be reduced below the size of the data within the buffer. - - - - - Constructor - - - gio.BufferedOutputStream - base_stream - - - - base_stream : - a - gio.OutputStream. - - - - Returns : - a new - gio.OutputStream - for the given base_stream. - - - - - - Creates a new buffered output stream for a base stream. - - - - - - Methods - - - gio.BufferedOutputStream.get_auto_grow - - - get_auto_grow - - - - - - Returns : - True if the stream's - buffer automatically grows, False otherwise. - - - - - - The get_auto_grow() method checks if the - buffer automatically grows as data is added. - - - - - gio.BufferedOutputStream.get_buffer_size - - - get_buffer_size - - - - - - Returns : - the current buffer size. - - - - - - The get_buffer_size() method gets the size - of the buffer in the stream. - - - - - gio.BufferedOutputStream.set_auto_grow - - - set_auto_grow - auto_grow - - - - - auto_grow : - a boolean. - - - - - - The set_auto_grow() method sets whether or not - the stream's buffer should automatically grow. If auto_grow is true, - then each write will just make the buffer larger, and you must manually - flush the buffer to actually write out the data to the underlying stream. - - - - - gio.BufferedOutputStream.set_buffer_size - - - set_buffer_size - size - - - - - size : - the new buffer size. - - - - - - The set_buffer_size() method sets the size of - the internal buffer to size. - - - - - - Functions - - - gio.buffered_output_stream_new_sized - - - buffered_output_stream_new_sized - size - - - - - size : - the requested buffer size. - - - - Returns : - A new - gio.OutputStream - with an internal buffer set to size.. - - - - - - The buffered_output_stream_new_sized() function creates - a new gio.BufferedOutputStream - from the given base_stream, with a buffer set to size. - - - - diff --git a/docs/reference/pygio-cancellable.xml b/docs/reference/pygio-cancellable.xml deleted file mode 100644 index c35388d..0000000 --- a/docs/reference/pygio-cancellable.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - gio.Cancellable - Thread-safe Operation Cancellation Stack. - - - - Synopsis - - - gio.Cancellable - gobject.GObject - - - gio.Cancellable - - - - - cancel - - - - get_fd - - - - is_cancelled - - - - pop_current - - - - push_current - - - - reset - - - - set_error_if_cancelled - - - - - - -Functions - - - gio.cancellable_get_current - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.Cancellable - - - - - - Description - - - The gio.Cancellable - is a thread-safe operation cancellation stack used throughout GIO to allow for - cancellation of synchronous and asynchronous operations. - - - - - Constructor - - - gio.Cancellable - - - - - Returns : - a new - gio.Cancellable. - - - - - - Creates a new gio.Cancellable object. - - - Applications that want to start one or more operations that should be cancellable should create a - gio.Cancellable - and pass it to the operations. - - - One gio.Cancellable - can be used in multiple consecutive operations, but not in multiple concurrent operations. - - - - - - Methods - - - gio.Cancellable.cancel - - - cancel - - - - - - - - The cancel() method will set cancellable to cancelled, - and will emit the "cancelled" signal. (However, see the warning about race conditions - in the documentation for that signal if you are planning to connect to it.) - - - This function is thread-safe. In other words, you can safely call it from a thread - other than the one running the operation that was passed the cancellable. - - - The convention within gio is that cancelling an asynchronous operation causes it - to complete asynchronously. That is, if you cancel the operation from the same thread - in which it is running, then the operation's GAsyncReadyCallback will not be invoked - until the application returns to the main loop. - - - - - gio.Cancellable.get_fd - - - get_fd - - - - - - Returns : - A valid file descriptor. -1 if the file descriptor - is not supported, or on errors. - - - - - The get_fd() method gets the file descriptor - for a cancellable job. This can be used to implement cancellable operations - on Unix systems. The returned fd will turn readable when cancellable is cancelled. - - - - - gio.Cancellable.is_cancelled - - - is_cancelled - - - - - - Returns : - True if cancellable is cancelled, - False if called with None or if - item is not cancelled. - - - - - The get_fd() method gets the file descriptor - for a cancellable job. This can be used to implement cancellable operations - on Unix systems. The returned fd will turn readable when cancellable is cancelled. - - - - - gio.Cancellable.pop_current - - - pop_current - - - - - - - - The pop_current() method pops cancellable off - the cancellable stack (verifying that cancellable is on the top of the stack). - - - - - gio.Cancellable.push_current - - - push_current - - - - - - - - The push_current() method pushes cancellable onto - the cancellable stack. The current cancllable can then be recieved using - gio.cancellable_get_current(). - - - - - gio.Cancellable.reset - - - reset - - - - - - - - The reset() method resets cancellable to its uncancelled state. - - - - - gio.Cancellable.set_error_if_cancelled - - - set_error_if_cancelled - - - - - - Returns : - True if cancellable was cancelled, - False if it was not. - - - - - The set_error_if_cancelled() method, if the cancellable - is cancelled, sets the error to notify that the operation was cancelled. - - - - - - Functions - - - gio.cancellable_get_current - - - cancellable_get_current - - - - - - Returns : - A gio.Cancellable - from the top of the stack, or None if the stack is empty. - - - - - The cancellable_get_current() function gets the top cancellable from the stack. - - - - diff --git a/docs/reference/pygio-classes.xml b/docs/reference/pygio-classes.xml deleted file mode 100644 index 17761f8..0000000 --- a/docs/reference/pygio-classes.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - -PyGio Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/reference/pygio-constants.xml b/docs/reference/pygio-constants.xml deleted file mode 100644 index 343927e..0000000 --- a/docs/reference/pygio-constants.xml +++ /dev/null @@ -1,1540 +0,0 @@ - - - - - - gio Constants - the built-in constants of the gio module - - - - Synopsis - - - - - - - - - - - - - - - - - - - - - - - - - - Description - - - Gio Ask Password Flags Constants - - - Flags that are used to request specific information from the user, or to - notify the user of their choices in an authentication situation. - - - - - gio.ASK_PASSWORD_ANONYMOUS_SUPPORTED - - operation supports anonymous users. - - - - gio.ASK_PASSWORD_NEED_DOMAIN - - operation requires a domain. - - - - gio.ASK_PASSWORD_NEED_PASSWORD - - operation requires a password. - - - - gio.ASK_PASSWORD_NEED_USERNAME - - operation requires a username. - - - - gio.ASK_PASSWORD_SAVING_SUPPORTED - - operation supports saving settings. - - - - - - - Gio AppInfo Create Flags Constants - - - Flags used when creating a gio.AppInfo - - - - - gio.APP_INFO_CREATE_NONE - - No flags. - - - - gio.APP_INFO_CREATE_NEEDS_TERMINAL - - Application opens in a terminal window. - - - - gio.APP_INFO_CREATE_SUPPORTS_URIS - - Application supports URI arguments. - - - - - - - Gio Data Stream Byte Order Constants - - - Used to ensure proper endianness of streaming data sources across various machine architectures. - - - - - gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN - - Selects Big Endian byte order. - - - - gio.DATA_STREAM_BYTE_ORDER_HOST_ENDIAN - - Selects endianness based on host machine's architecture. - - - - gio.DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN - - Selects Little Endian byte order. - - - - - - - Gio Data Stream Newline Type Constants - - - Used when checking for or setting the line endings for a given file. - - - - - gio.DATA_STREAM_NEWLINE_TYPE_LF - - Selects "LF" line endings, common on most modern UNIX platforms. - - - - gio.DATA_STREAM_NEWLINE_TYPE_CR - - Selects "CR" line endings. - - - - gio.DATA_STREAM_NEWLINE_TYPE_CR_LF - - Selects "CR, LF" line ending, common on Microsoft Windows. - - - - gio.DATA_STREAM_NEWLINE_TYPE_ANY - - Automatically try to handle any line ending type. - - - - - - - Gio Emblem Origin Constants - - - GEmblemOrigin is used to add information about the origin of the emblem to GEmblem. - - - - - gio.EMBLEM_ORIGIN_DEVICE - - Embleme adds device-specific information. - - - - gio.EMBLEM_ORIGIN_LIVEMETADATA - - Emblem depicts live metadata, such as "readonly". - - - - gio.EMBLEM_ORIGIN_TAG - - Emblem comes from a user-defined tag, e.g. set by nautilus (in the future). - - - - gio.EMBLEM_ORIGIN_UNKNOWN - - Emblem of unknown origin. - - - - - - - Gio Error Constants - - - GIOError Error codes returned by GIO functions. - - - - - gio.ERROR_ALREADY_MOUNTED - - File is already mounted. - - - - gio.ERROR_BUSY - - File is busy. - - - - gio.ERROR_CANCELLED - - Operation was cancelled. See - gio.Cancellable. - - - - - gio.ERROR_CANT_CREATE_BACKUP - - Backup couldn't be created. - - - - gio.ERROR_CLOSED - - File was closed. - - - - gio.ERROR_EXISTS - - File already exists error. - - - - gio.ERROR_FAILED - - Generic error condition for when any operation fails. - - - - gio.ERROR_FAILED_HANDLED - - Operation failed and a helper program has already interacted with - the user. Do not display any error dialog. - - - - gio.ERROR_FILENAME_TOO_LONG - - Filename is too many characters. - - - - gio.ERROR_HOST_NOT_FOUND - - Host couldn't be found (remote operations). - - - - gio.ERROR_INVALID_ARGUMENT - - Invalid argument. - - - - gio.ERROR_INVALID_FILENAME - - Filename is invalid or contains invalid characters. - - - - gio.ERROR_IS_DIRECTORY - - File is a directory error. - - - - gio.ERROR_NOT_DIRECTORY - - File is not a directory. - - - - gio.ERROR_NOT_EMPTY - - File is a directory that isn't empty. - - - - gio.ERROR_NOT_FOUND - - File not found error. - - - - gio.ERROR_NOT_MOUNTABLE_FILE - - File cannot be mounted. - - - - gio.ERROR_NOT_MOUNTED - - File isn't mounted. - - - - gio.ERROR_NOT_REGULAR_FILE - - File is not a regular file. - - - - gio.ERROR_NOT_SUPPORTED - - Operation not supported for the current backend. - - - - gio.ERROR_NOT_SYMBOLIC_LINK - - File is not a symbolic link. - - - - gio.ERROR_NO_SPACE - - No space left on drive. - - - - gio.ERROR_PENDING - - Operations are still pending. - - - - gio.ERROR_PERMISSION_DENIED - - Permission denied. - - - - gio.ERROR_READ_ONLY - - File is read only. - - - - gio.ERROR_TIMED_OUT - - Operation timed out. - - - - gio.ERROR_TOO_MANY_LINKS - - File contains too many symbolic links. - - - - gio.ERROR_TOO_MANY_OPEN_FILES - - The current process has too many files open and can't open any - more. Duplicate descriptors do count toward this limit. Since 2.20 - - - - gio.ERROR_WOULD_BLOCK - - Operation would block. - - - - gio.ERROR_WOULD_MERGE - - Operation would merge files. - - - - gio.ERROR_WOULD_RECURSE - - Operation would be recursive. - - - - gio.ERROR_WRONG_ETAG - - File's Entity Tag was incorrect. - - - - - - - Gio File Attribute Constants - - - The file attributes. - - - - - gio.FILE_ATTRIBUTE_STANDARD_TYPE - - - "standard::type" A key in the "standard" namespace for storing file types. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. The value for this key should contain a - - - - - - gio.FILE_ATTRIBUTE_STANDARD_IS_HIDDEN - - - "standard::is-hidden" A key in the "standard" namespace for checking if a file is hidden. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_STANDARD_IS_BACKUP - - - "standard::is-backup" A key in the "standard" namespace for checking if a file is a backup file. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_STANDARD_IS_SYMLINK - - - "standard::is-symlink" A key in the "standard" namespace for checking if the file is a symlink. - Typically the actual type is something else, if we followed the symlink to get the type. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL - - - "standard::is-virtual" A key in the "standard" namespace for checking if a file is virtual. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_STANDARD_NAME - - - "standard::name" A key in the "standard" namespace for getting the name of the file. - The name is the on-disk filename which may not be in any known encoding, - and can thus not be generally displayed as is. Use - gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the name in a user - interface. Corresponding GFileAttributeType is gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME - - - "standard::display-name" A key in the "standard" namespace for getting the display - name of the file. A display name is guaranteed to be in UTF8 and can thus be displayed - in the UI. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_EDIT_NAME - - - "standard::edit-name" A key in the "standard" namespace for edit name of the file. - An edit name is similar to the display name, but it is meant to be used when you want - to rename the file in the UI. The display name might contain information you don't - want in the new filename (such as "(invalid unicode)" if the filename was in an - invalid encoding). Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_COPY_NAME - - - "standard::copy-name" A key in the "standard" namespace for getting the copy - name of the file. The copy name is an optional version of the name. If available - it's always in UTF8, and corresponds directly to the original filename (only transcoded - to UTF8). This is useful if you want to copy the file to another filesystem that might - have a different encoding. If the filename is not a valid string in the encoding selected - for the filesystem it is in then the copy name will not be set. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_ICON - - - "standard::icon" A key in the "standard" namespace for getting the icon for the file. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a - gio.Icon. - - - - - gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE - - - "standard::content-type" A key in the "standard" namespace for getting the content type of the file. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. The value for this key should contain a valid content type. - - - - - gio.FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE - - - "standard::fast-content-type" A key in the "standard" namespace for getting the fast - content type. The fast content type isn't as reliable as the regular one, as it - only uses the filename to guess it, but it is faster to calculate than the regular - content type. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_SIZE - - - "standard::size" A key in the "standard" namespace for getting the file's size (in bytes). Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT64. - - - - - gio.FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET - - - "standard::symlink-target" A key in the "standard" namespace for getting the target URI - for the file, in the case of gio.FILE_TYPE_SHORTCUT or gio.FILE_TYPE_MOUNTABLE files. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_STANDARD_SORT_ORDER - - - "standard::sort-order" A key in the "standard" namespace for setting the sort order of a file. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_INT32. An example use would be in file managers, which would use this - key to set the order files are displayed. Files with smaller sort order should be sorted first, - and files without sort order as if sort order was zero. - - - - - gio.FILE_ATTRIBUTE_ETAG_VALUE - - - "etag::value" A key in the "etag" namespace for getting the value of the file's entity tag. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_ID_FILE - - - "id::file" A key in the "id" namespace for getting a file identifier. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. An example use would be during listing files, - to avoid recursive directory scanning. - - - - - gio.FILE_ATTRIBUTE_ID_FILESYSTEM - - - "id::filesystem" A key in the "id" namespace for getting the file system identifier. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. An example use would be during drag and - drop to see if the source and target are on the same filesystem (default to move) or not (default to copy). - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_READ - - - "access::can-read" A key in the "access" namespace for getting read privileges. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to read the file. - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_WRITE - - - "access::can-write" A key in the "access" namespace for getting write privileges.Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to write to the file. - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE - - - "access::can-execute" A key in the "access" namespace for getting execution privileges. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to execute the file. - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_DELETE - - - "access::can-delete" A key in the "access" namespace for checking deletion privileges. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to delete the file. - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_TRASH - - - "access::can-trash" A key in the "access" namespace for checking trashing privileges. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to move the file to the trash. - - - - - gio.FILE_ATTRIBUTE_ACCESS_CAN_RENAME - - - "access::can-rename" A key in the "access" namespace for checking renaming privileges. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be True - if the user is able to rename the file. - - - - - gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT - - - "mountable::can-mount" A key in the "mountable" namespace for checking if - a file (of type G_FILE_TYPE_MOUNTABLE) is mountable. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT - - - "mountable::can-unmount" A key in the "mountable" namespace for checking if a file - (of type G_FILE_TYPE_MOUNTABLE) is unmountable. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT - - - "mountable::can-eject" A key in the "mountable" namespace for checking if a file - (of type G_FILE_TYPE_MOUNTABLE) can be ejected. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE - - - "mountable::unix-device" A key in the "mountable" namespace for getting the unix device. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI - - - "mountable::hal-udi" A key in the "mountable" namespace for getting the - HAL UDI for the mountable file. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_TIME_MODIFIED - - - "time::modified" A key in the "time" namespace for getting the time the file was last modified. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was modified. - - - - - gio.FILE_ATTRIBUTE_TIME_MODIFIED_USEC - - - "time::modified-usec" A key in the "time" namespace for getting the miliseconds - of the time the file was last modified. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_TIME_ACCESS - - - "time::access" A key in the "time" namespace for getting the time the file was last accessed. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was last accessed. - - - - - gio.FILE_ATTRIBUTE_TIME_ACCESS_USEC - - - "time::access-usec" A key in the "time" namespace for getting the microseconds of - the time the file was last accessed. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_TIME_CHANGED - - - "time::changed" A key in the "time" namespace for getting the time the - file was last changed. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was last changed. - This corresponds to the traditional UNIX ctime. - - - - - gio.FILE_ATTRIBUTE_TIME_CHANGED_USEC - - - "time::changed-usec" A key in the "time" namespace for getting the microseconds - of the time the file was last changed. This should be used in conjunction - with G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_TIME_CREATED - - - "time::created" A key in the "time" namespace for getting the time the file was created. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the file was created. - This corresponds to the NTFS ctime. - - - - - gio.FILE_ATTRIBUTE_TIME_CREATED_USEC - - - "time::created-usec" A key in the "time" namespace for getting the microseconds of the time the - file was created. This should be used in conjunction with G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_DEVICE - - - "unix::device" A key in the "unix" namespace for getting the device id of the device the file - is located on (see stat() documentation). This attribute is only available - for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_INODE - - - "unix::inode" A key in the "unix" namespace for getting the inode of the file. This attribute is only - available for UNIX file systems. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT64. - - - - - gio.FILE_ATTRIBUTE_UNIX_MODE - - - "unix::mode" A key in the "unix" namespace for getting the mode of the file (e.g. - whether the file is a regular file, symlink, etc). See lstat() documentation. - This attribute is only available for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_NLINK - - - "unix::nlink" A key in the "unix" namespace for getting the number of hard links - for a file. See lstat() documentation. This attribute is only available for UNIX - file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_UID - - - "unix::uid" A key in the "unix" namespace for getting the user ID for the file. This attribute - is only available for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_GID - - - "unix::gid" A key in the "unix" namespace for getting the group ID for the file. - This attribute is only available for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_RDEV - - - "unix::rdev" A key in the "unix" namespace for getting the device ID for the file - (if it is a special file). See lstat() documentation. This attribute is only available - for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_BLOCK_SIZE - - - "unix::block-size" A key in the "unix" namespace for getting the block size for - the file system. This attribute is only available for UNIX file systems. Corresponding - - is gio.FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_UNIX_BLOCKS - - - "unix::blocks" A key in the "unix" namespace for getting the number of blocks allocated - for the file. This attribute is only available for UNIX file systems. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT64. - - - - - gio.FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT - - - "unix::is-mountpoint" A key in the "unix" namespace for checking if the file represents - a UNIX mount point. This attribute is True if the file is a UNIX mount point. - This attribute is only available for UNIX file systems. Corresponding - GFileAttributeType - is gio.FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_DOS_IS_ARCHIVE - - - "dos::is-archive" A key in the "dos" namespace for checking if the file's archive - flag is set. This attribute is True if the archive flag is set. - This attribute is only available for DOS file systems. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_DOS_IS_SYSTEM - - - "dos::is-system" A key in the "dos" namespace for checking if the file's backup - flag is set. This attribute is True if the backup flag is set. - This attribute is only available for DOS file systems. Corresponding - is - G_FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_OWNER_USER - - - "owner::user" A key in the "owner" namespace for getting the user name - of the file's owner. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_OWNER_USER_REAL - - - "owner::user-real" A key in the "owner" namespace for getting the real name - of the user that owns the file. Corresponding - is - G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_OWNER_GROUP - - - "owner::group" A key in the "owner" namespace for getting the file owner's - group. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_THUMBNAIL_PATH - - - "thumbnail::path" A key in the "thumbnail" namespace for getting the path - to the thumbnail image. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_BYTE_STRING. - - - - - gio.FILE_ATTRIBUTE_THUMBNAILING_FAILED - - - "thumbnail::failed" A key in the "thumbnail" namespace for checking if thumbnailing failed. This attribute - is True if thumbnailing failed. Corresponding - is - G_FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_PREVIEW_ICON - - - "preview::icon" A key in the "preview" namespace for getting a - gio.Icon - that can be used to get preview of the file. For example, it - may be a low resolution thumbnail without metadata. Corresponding - is - G_FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a GIcon. - - - - - gio.FILE_ATTRIBUTE_FILESYSTEM_SIZE - - - "filesystem::size" A key in the "filesystem" namespace for getting the total - size (in bytes) of the file system, used in - query_filesystem_info(). - Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT64. - - - - - gio.FILE_ATTRIBUTE_FILESYSTEM_FREE - - - "filesystem::free" A key in the "filesystem" namespace for getting the number of bytes of free space left - on the file system. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT64. - - - - - gio.FILE_ATTRIBUTE_FILESYSTEM_TYPE - - - "filesystem::type" A key in the "filesystem" namespace for getting the file system's type. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_FILESYSTEM_READONLY - - - "filesystem::readonly" A key in the "filesystem" namespace for checking if the - file system is read only. Is set to True if the file system - is read only. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_BOOLEAN. - - - - - gio.FILE_ATTRIBUTE_GVFS_BACKEND - - - "gvfs::backend" A key in the "gvfs" namespace that gets the name of the current GVFS backend in use. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - gio.FILE_ATTRIBUTE_SELINUX_CONTEXT - - - "selinux::context" A key in the "selinux" namespace for getting the file's SELinux context. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - Note that this attribute is only available if GLib has been built with SELinux support. - - - - - gio.FILE_ATTRIBUTE_TRASH_ITEM_COUNT - - - "trash::item-count" A key in the "trash" namespace. When requested against "trash:///" returns the number - of (toplevel) items in the trash folder. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_UINT32. - - - - - gio.FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW - - - "filesystem::use-preview" A key in the "filesystem" namespace for hinting a file manager - application whether it should preview (e.g. thumbnail) files on the file system. - The value for this key contain a GFilesystemPreviewType. - - - - - gio.FILE_ATTRIBUTE_STANDARD_DESCRIPTION - - - "standard::description" A key in the "standard" namespace for getting the description - of the file. The description is a utf8 string that describes the file, generally containing - the filename, but can also contain furter information. Example descriptions could be - "filename (on hostname)" for a remote file or "filename (in trash)" for a - file in the trash. This is useful for instance as the window title when - displaying a directory or for a bookmarks menu. Corresponding - - is G_FILE_ATTRIBUTE_TYPE_STRING. - - - - - - - - Gio File Attribute Type Constants - - - The data types for file attributes. - - - - - gio.FILE_ATTRIBUTE_TYPE_BOOLEAN - - a boolean value. - - - - gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING - - a zero terminated string of non-zero bytes. - - - - gio.FILE_ATTRIBUTE_TYPE_INT32 - - a signed 4-byte/32-bit integer. - - - - gio.FILE_ATTRIBUTE_TYPE_INT64 - - a signed 8-byte/64-bit integer. - - - - gio.FILE_ATTRIBUTE_TYPE_INVALID - - indicates an invalid or uninitalized type. - - - - gio.FILE_ATTRIBUTE_TYPE_OBJECT - - a gobject.GObject. - - - - gio.FILE_ATTRIBUTE_TYPE_STRING - - a null terminated UTF8 string. - - - - gio.FILE_ATTRIBUTE_TYPE_UINT32 - - an unsigned 4-byte/32-bit integer. - - - - gio.FILE_ATTRIBUTE_TYPE_UINT64 - - an unsigned 8-byte/64-bit integer. - - - - - - - Gio File Attribute Flags Constants - - - Flags specifying the behaviour of an attribute. - - - - - gio.FILE_ATTRIBUTE_INFO_NONE - - no flags set. - - - - gio.FILE_ATTRIBUTE_INFO_COPY_WITH_FILE - - copy the attribute values when the file is copied. - - - - gio.FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED - - copy the attribute values when the file is moved. - - - - - - - Gio File Create Flags Constants - - - Flags used when an operation may create a file. - - - - - gio.FILE_CREATE_NONE - - No flags set. - - - - gio.FILE_CREATE_PRIVATE - - Create a file that can only be accessed by the current user. - - - - gio.FILE_CREATE_REPLACE_DESTINATION - - - Replace the destination as if it didn't exist before. Don't try - to keep any old permissions, replace instead of following links. This is - generally useful if you're doing a "copy over" rather than a "save new version of" - replace operation. You can think of it as "unlink destination" before writing - to it, although the implementation may not be exactly like that. - - - - - - - - Gio File Copy Flags Constants - - - Flags used when copying or moving files. - - - - - gio.FILE_COPY_NONE - - No flags set. - - - - gio.FILE_COPY_OVERWRITE - - Overwrite any existing files. - - - - gio.FILE_COPY_BACKUP - - Make a backup of any existing files. - - - - gio.FILE_COPY_NOFOLLOW_SYMLINKS - - Don't follow symlinks. - - - - gio.FILE_COPY_ALL_METADATA - - Copy all file metadata instead of just default set used for copy - (see gio.FileInfo). - - - - gio.FILE_COPY_NO_FALLBACK_FOR_MOVE - - Don't use copy and delete fallback if native move not supported. - - - - gio.FILE_COPY_TARGET_DEFAULT_PERMS - - Leaves target file with default perms, instead of setting the source file perms. - - - - - - - Gio File Monitor Flags Constants - - - Flags used to set what a - gio.FileMonitor - will watch for. - - - - - gio.FILE_MONITOR_NONE - - No flags set. - - - - gio.FILE_MONITOR_WATCH_MOUNTS - - Watch for mount events. - - - - - - - Gio File Query Info Flags Constants - - - Flags used when querying a - gio.FileInfo. - - - - - gio.FILE_QUERY_INFO_NONE - - No flags set. - - - - gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS - - Don't follow symlinks. - - - - - - - Gio File Type Constants - - - Indicates the file's on-disk type. - - - - - gio.FILE_TYPE_DIRECTORY - - File handle represents a directory. - - - - gio.FILE_TYPE_MOUNTABLE - - File is a mountable location. - - - - gio.FILE_TYPE_REGULAR - - File handle represents a regular file. - - - - gio.FILE_TYPE_SHORTCUT - - File is a shortcut (Windows systems). - - - - gio.FILE_TYPE_SPECIAL - - File is a "special" file, such as a socket, fifo, block device, or character device. - - - - gio.FILE_TYPE_SYMBOLIC_LINK - - File handle represents a symbolic link (Unix systems). - - - - gio.FILE_TYPE_UNKNOWN - - File's type is unknown. - - - - - - - Gio Mount Mount Flags Constants - - - Flags used when mounting a mount. - - - - - gio.MOUNT_MOUNT_NONE - - No flags set. - - - - - - - Gio Mount Unmount Flags Constants - - - Flags used when unmounting a mount. - - - - - gio.MOUNT_UNMOUNT_NONE - - No flags set. - - - - gio.MOUNT_UNMOUNT_FORCE - - Unmount even if there are outstanding file operations on the mount. - - - - - - - Gio Mount Operation Result Constants - - - returned as a result when a request for information is send by the mounting operation. - - - - - gio.MOUNT_OPERATION_HANDLED - - The request was fulfilled and the user specified data is now available. - - - - gio.MOUNT_OPERATION_ABORTED - - The user requested the mount operation to be aborted. - - - - gio.MOUNT_OPERATION_UNHANDLED - - The request was unhandled (i.e. not implemented). - - - - - - - Gio Password Save Constants - - - is used to indicate the lifespan of a saved password. - - - Gvfs stores passwords in the Gnome keyring when this flag allows it to, - and later retrieves it again from there. - - - - - gio.PASSWORD_SAVE_FOR_SESSION - - save a password for the session. - - - - gio.PASSWORD_SAVE_NEVER - - never save a password. - - - - gio.PASSWORD_SAVE_PERMANENTLY - - save a password permanently. - - - - - - - diff --git a/docs/reference/pygio-datainputstream.xml b/docs/reference/pygio-datainputstream.xml deleted file mode 100644 index 403bb3e..0000000 --- a/docs/reference/pygio-datainputstream.xml +++ /dev/null @@ -1,799 +0,0 @@ - - - - - - gio.DataInputStream - Data Input Stream - - - - Synopsis - - - gio.DataInputStream - gio.BufferedInputStream - - - gio.DataInputStream - base_stream - - - - get_byte_order - - - - get_newline_type - - - - read_byte - cancellableNone - - - read_int16 - cancellableNone - - - read_int32 - cancellableNone - - - read_int64 - cancellableNone - - - read_line - cancellableNone - - - read_line_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - read_line_finish - result - - - read_uint16 - cancellableNone - - - read_uint32 - cancellableNone - - - read_uint64 - cancellableNone - - - read_until - stop_chars - cancellableNone - - - read_until_async - stop_chars - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - read_until_finish - result - - - set_byte_order - order - - - set_newline_type - type - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.FilterInputStream - +-- gio.BufferedInputStream - +-- gio.DataInputStream - - - - - - gio.DataInputStream Properties - -
- - - - - -
- - "byte-order" - Read - Write - The byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN. - - - "newline-type" - Read - Write - The accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF. - - - - - - - - - - Description - - - gio.DataInputStream - implements gio.InputStream - and includes functions for reading structured data directly from a binary input stream. - - - - - Constructor - - - gio.DataInputStream - base_stream - - - - base_stream : - a - gio.InputStream. - - - - Returns : - a new - gio.DataInputStream - - - - - - Creates a new gio.DataInputStream - from the given base_stream. - - - - - - Methods - - - gio.DataInputStream.get_byte_order - - - get_byte_order - - - - - - Returns : - the stream's current - . - - - - - - The get_byte_order() method gets the byte - order for the data input stream. - - - - - gio.DataInputStream.get_newline_type - - - get_newline_type - - - - - - Returns : - - for the given stream. - - - - - - The get_newline_type() method gets the current - newline type for the stream. - - - - - gio.DataInputStream.read_byte - - - read_byte - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - an unsigned 8-bit/1-byte value read from the - stream or 0 if an error occurred. - - - - - - The read_byte() method reads an unsigned 8-bit/1-byte value from stream. - - - - - gio.DataInputStream.read_int16 - - - read_int16 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 16-bit/2-byte value read from stream or 0 if an error occurred. - - - - - - The read_int16() method reads a 16-bit/2-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_int32 - - - read_int32 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 32-bit/4-byte value read from the stream - or 0 if an error occurred. - - - - - - The read_int32() method reads a signed 32-bit/4-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_int64 - - - read_int64 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 64-bit/8-byte value read from the stream - or 0 if an error occurred. - - - - - - The read_int64() method reads a signed 64-bit/8-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_line - - - read_line - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a string with the line that was read in (without the newlines). - Set length to a gsize to get the length of the read line. On an error, it will return - None and error will be set. If there's no content to read, it - will still return None, but error won't be set. - - - - - - The read_line() reads a line from the data input stream. - - - If cancellable is not None, then the operation can - be cancelled by triggering the cancellable object from another thread. - If the operation was cancelled, the error gio.ERROR_CANCELLED will be - returned. If an operation was partially finished when the operation was - cancelled the partial result will be returned, without an error. - - - - - gio.DataInputStream.read_line_async - - - read_line_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The read_line_async() method is the asynchronous version of - gio.DataInputStream.read_line(). - It is an error to have two outstanding calls to this function. - - - For the synchronous version of this function, see - gio.DataInputStream.read_line(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set - - - - - gio.DataInputStream.read_line_finish - - - read_line_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a string with the line that was read in (without the newlines). - On an error, it will return None and error will be set. - If there's no content to read, it will still return None, - but error won't be set. - - - - - - The read_line_finish() method finishes an asynchronous - file append operation started with - gio.DataInputStream.read_line_async(). - - - - - gio.DataInputStream.read_uint16 - - - read_uint16 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 16-bit/2-byte value read from stream or 0 if an error occurred. - - - - - - The read_uint16() method reads a 16-bit/2-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_uint32 - - - read_uint32 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 32-bit/4-byte value read from the stream - or 0 if an error occurred. - - - - - - The read_uint32() method reads a signed 32-bit/4-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_uint64 - - - read_uint64 - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a signed 64-bit/8-byte value read from the stream - or 0 if an error occurred. - - - - - - The read_uint64() method reads a signed 64-bit/8-byte value from stream. - - - In order to get the correct byte order for this read operation, see - gio.DataInputStream.get_byte_order() - and - gio.DataInputStream.set_byte_order(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataInputStream.read_until - - - read_until - stop_chars - cancellableNone - - - - - stop_chars : - characters to terminate the read. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a string with the data that was read before encountering - any of the stop characters. This function will return NULL on an error. - - - - - - The read_until() reads a string from the data input - stream, up to the first occurrence of any of the stop characters. - - - - - gio.DataInputStream.read_until_async - - - read_until_async - stop_chars - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - stop_chars : - characters to terminate the read. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The read_until_async() method it's the asynchronous version of - gio.DataInputStream.read_until(). - It is an error to have two outstanding calls to this function. - - - For the synchronous version of this function, see - gio.DataInputStream.read_until(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set - - - When the operation is finished, callback will be called. You can then call - gio.DataInputStream.read_until_finish() - to get the result of the operation. - - - - - gio.DataInputStream.read_until_finish - - - read_until_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a string with the data that was read before encountering - any of the stop characters. This function will return None on an error. - - - - - - The read_until_finish() method finishes an asynchronous - file append operation started with - gio.DataInputStream.read_until_async(). - - - - - gio.DataInputStream.set_byte_order - - - set_byte_order - order - - - - - order : - a - to set. - - - - - - The set_byte_order() method sets the byte order for - the given stream. All subsequent reads from the stream will be read in the given order. - - - - - gio.DataInputStream.set_newline_type - - - set_newline_type - type - - - - - type : - a - to set. - - - - - - The set_newline_type() method sets the newline type for the stream. - - - Note that using gio.DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a - read chunk ends in "CR" we must read an additional byte to know if this is - "CR" or "CR LF", and this might block if there is no more data availible. - - - - diff --git a/docs/reference/pygio-dataoutputstream.xml b/docs/reference/pygio-dataoutputstream.xml deleted file mode 100644 index 4cbc904..0000000 --- a/docs/reference/pygio-dataoutputstream.xml +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - gio.DataOutputStream - Data Output Stream - - - - Synopsis - - - gio.DataOutputStream - gio.BufferedOutputStream - - - gio.DataOutputStream - base_stream - - - - get_byte_order - - - - put_byte - cancellableNone - - - put_int16 - cancellableNone - - - put_int32 - cancellableNone - - - put_int64 - cancellableNone - - - put_string - cancellableNone - - - put_uint16 - cancellableNone - - - put_uint32 - cancellableNone - - - put_uint64 - cancellableNone - - - set_byte_order - order - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.FilterOutputStream - +-- gio.BufferedOutputStream - +-- gio.DataOutputStream - - - - - - gio.DataOutputStream Properties - -
- - - - - -
- - "byte-order" - Read - Write - Determines the byte ordering that is used when writing - multi-byte entities (such as integers) to the stream. - Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN. - - - - - - - - - - Description - - - gio.DataOutputStream - implements gio.InputStream - and includes functions for writing data directly to an output stream. - - - - - Constructor - - - gio.DataOutputStream - base_stream - - - - base_stream : - a - gio.OutputStream. - - - - Returns : - a new - gio.DataOutputStream - - - - - - Creates a new gio.DataOutputStream - from the given base_stream. - - - - - - Methods - - - gio.DataOutputStream.get_byte_order - - - get_byte_order - - - - - - Returns : - the stream's current - . - - - - - - The get_byte_order() method gets the byte - order for the stream. - - - - - gio.DataOutputStream.put_byte - - - put_byte - data - cancellableNone - - - - - data : - a char. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_byte() method puts a byte into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_int16 - - - put_int16 - data - cancellableNone - - - - - data : - a gint16. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_int16() method puts a signed 16-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_int32 - - - put_int32 - data - cancellableNone - - - - - data : - a gint32. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_int32() method puts a signed 32-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_int64 - - - put_int64 - data - cancellableNone - - - - - data : - a gint64. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_int64() method puts a signed 64-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_string - - - put_string - str - cancellableNone - - - - - str : - a string. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if string was successfully added to the stream. - - - - - - The put_string() method puts a string into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_uint16 - - - put_uint16 - data - cancellableNone - - - - - data : - a guint16. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_uint16() method puts an unsigned 16-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_uint32 - - - put_uint32 - data - cancellableNone - - - - - data : - a guint32. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_uint32() method puts an unsigned 32-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.put_uint64 - - - put_uint64 - data - cancellableNone - - - - - data : - a guint64. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True if data was successfully added to the stream. - - - - - - The put_uint64() method puts an unsigned 64-bit integer into the output stream. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.DataOutputStream.set_byte_order - - - set_byte_order - order - - - - - order : - a - to set. - - - - - - The set_byte_order() method sets the byte order for - the given stream. All subsequent reads from the stream will be read in the given order. - - - - diff --git a/docs/reference/pygio-drive.xml b/docs/reference/pygio-drive.xml deleted file mode 100644 index 73766cd..0000000 --- a/docs/reference/pygio-drive.xml +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - gio.Drive - Virtual File System drive management. - - - - Synopsis - - - gio.Drive - gobject.GInterface - - - can_eject - - - - can_poll_for_media - - - - eject - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - eject_finish - result - - - enumerate_identifiers - - - - get_icon - - - - get_identifier - - - - get_name - - - - get_volumes - - - - has_media - - - - has_volumes - - - - is_media_check_automatic - - - - is_media_removable - - - - poll_for_media - callback - cancellableNone - user_dataNone - - - poll_for_media_finish - result - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.Drive - - - - - - Prerequisites - - gio.Drive requires - gobject.GObject - - - - - Description - - - gio.Drive - - this represent a piece of hardware connected to the machine. Its generally - only created for removable hardware or hardware with removable media. - - - gio.Drive - is a container class for GVolume objects that stem from the same piece of media. - As such, gio.Drive - abstracts a drive with (or without) removable media and provides operations for - querying whether media is available, determing whether media change is automatically - detected and ejecting the media. - - - If the gio.Drive - reports that media isn't automatically detected, one can poll for media; typically - one should not do this periodically as a poll for media operation is potententially - expensive and may spin up the drive creating noise. - - - For porting from GnomeVFS note that there is no equivalent of - gio.Drive - in that API. - - - - - Methods - - - gio.Drive.can_eject - - - can_eject - - - - - - Returns : - True if the drive can be ejected, - False otherwise. - - - - - - The can_eject() method checks if a drive can be ejected. - - - - - gio.Drive.can_poll_for_media - - - can_poll_for_media - - - - - - Returns : - True if the drive can be polled - for media changes, False otherwise. - - - - - - The can_poll_for_media() method checks if a drive - can be polled for media changes. - - - - - gio.Drive.eject - - - eject - - callback - - - flagsgio.MOUNT_UNMOUNT_NONE - - - cancellableNone - - - user_dataNone - - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - flags affecting the unmount if required for eject. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The eject() method asynchronously ejects a drive. - - - When the operation is finished, callback will be called. You can then call - gio.Drive.eject_finish() - to obtain the result of the operation. - - - - - gio.Drive.eject_finish - - - eject_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the drive has been ejected - successfully, False otherwise. - - - - - - The eject_finish() method finishes ejecting a drive. - - - - - gio.Drive.enumerate_identifiers - - - enumerate_identifiers - - - - - - Returns : - a list of strings containing kinds of identifiers. - - - - - - The enumerate_identifiers() method gets the kinds - of identifiers that drive has. Use - gio.Drive.get_identifier() - to obtain the identifiers themselves. - - - - - gio.Drive.get_icon - - - get_icon - - - - - - Returns : - gio.Icon - for the drive. - - - - - - The get_icon() method gets the icon for drive. - - - - - gio.Drive.get_identifier - - - get_identifier - - - - - - Returns : - A string containing the requested identfier, or - None if the - gio.Drive - doesn't have this kind of identifier. - - - - - - The get_identifier() method gets the identifier of - the given kind for drive. - - - - - gio.Drive.get_name - - - get_name - - - - - - Returns : - A string containing drive's name. - - - - - - The get_name() method gets the name of drive. - - - - - gio.Drive.get_volumes - - - get_volumes - - - - - - Returns : - A list containing any - gio.Volume - objects on the given drive. - - - - - - The get_volumes() method get a list of mountable - volumes for drive. - - - - - gio.Drive.has_media - - - has_media - - - - - - Returns : - True if drive has media, - False otherwise. - - - - - The has_media() method checks if the drive - has media. Note that the OS may not be polling the drive for media changes; see - gio.Drive.is_media_check_automatic() - for more details. - - - - - gio.Drive.has_volumes - - - has_volumes - - - - - - Returns : - True if drive contains volumes, - False otherwise. - - - - - The has_volumes() method check if drive has any mountable volumes. - - - - - gio.Drive.is_media_check_automatic - - - is_media_check_automatic - - - - - - Returns : - True if drive is capabable - of automatically detecting media changes, - False otherwise. - - - - - The is_media_check_automatic() method checks if - drive is capabable of automatically detecting media changes. - - - - - gio.Drive.is_media_removable - - - is_media_removable - - - - - - Returns : - True if drive supports removable media, - False otherwise. - - - - - The is_media_removable() method checks if the - drive supports removable media. - - - - - gio.Drive.poll_for_media - - - poll_for_media - - callback - - - cancellableNone - - - user_dataNone - - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The poll_for_media() method asynchronously polls - drive to see if media has been inserted or removed. - - - When the operation is finished, callback will be called. You can then call - gio.Drive.poll_for_media_finish() - to obtain the result of the operation. - - - - - gio.Drive.poll_for_media_finish - - - poll_for_media_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the drive has been poll_for_mediaed - successfully, False otherwise. - - - - - - The poll_for_media_finish() method finishes - an operation started with - gio.Drive.poll_for_media() - on a drive. - - - - diff --git a/docs/reference/pygio-emblem.xml b/docs/reference/pygio-emblem.xml deleted file mode 100644 index 032b0ff..0000000 --- a/docs/reference/pygio-emblem.xml +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - gio.Emblem - An object for emblems. - - - - Synopsis - - - gio.Emblem - gobject.GObject - gio.Icon - - - gio.Emblem - icon - origingio.EMBLEM_ORIGIN_UNKNOWN - - - - get_icon - - - - get_origin - - - - - - -Functions - - - gio.emblem_new_with_origin - icon - origin - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.Emblem - - - - - - Implemented Interfaces - - gio.Emblem - implements - gio.Icon - - - - - gio.Emblem Properties - -
- - - - - -
- - "icon" - Read - Write - Construct Only - The actual icon of the emblem. - - - "origin" - Read - Write - Construct Only - Tells which origin the emblem is derived from. - - - - - - - - - - Description - - - The gio.Emblem - class is an implementation of gio.Icon - that supports having an emblem, which is an icon with additional properties. - It can then be added to a - gio.EmblemedIcon. - - - Currently, only metainformation about the emblem's origin is supported. - More may be added in the future. - - - - - Constructor - - - gio.Emblem - icon - origingio.EMBLEM_ORIGIN_UNKNOWN - - - - icon : - a - gio.Icon containing the icon. - - - - origin : - - origin of the emblem. - - - - Returns : - a new - gio.Emblem. - - - - - - Parameter origin is available since PyGObject 2.20. - - - - Creates a new gio.Emblem for icon. - - - - - - Methods - - - gio.Emblem.get_icon - - - get_icon - - - - - - Returns : - a - gio.Icon. - - - - - - The get_icon() method gives back the icon from emblem. - - - - - gio.Emblem.get_origin - - - get_origin - - - - - - Returns : - the origin of the emblem. - - - - - - The get_origin() method gets the origin of the emblem. - - - - - - Functions - - - gio.emblem_new_with_origin - - - emblem_new_with_origin - icon - origin - - - - - origin : - a - defining the emblem's origin. - - - - Returns : - A gio.Emblem. - - - - - - While this method is not deprecated, with 2.20 and up it is recommended - to use the constructor instead. - - - - - The emblem_new_with_origin() function creates - a new emblem for icon. - - - - diff --git a/docs/reference/pygio-emblemedicon.xml b/docs/reference/pygio-emblemedicon.xml deleted file mode 100644 index 9b5ef8a..0000000 --- a/docs/reference/pygio-emblemedicon.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - gio.EmblemedIcon - Icon with emblems. - - - - Synopsis - - - gio.EmblemedIcon - gobject.GObject - gio.Icon - - - gio.EmblemedIcon - icon - emblem - - - - - add_emblem - emblem - - - get_icon - - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.EmblemedIcon - - - - - - Implemented Interfaces - - gio.EmblemedIcon - implements - gio.Icon - - - - - Description - - - The gio.EmblemedIcon - class is an implementation of gio.Icon - that supports adding an emblem to an icon. Adding multiple emblems to an icon is ensured via - gio.EmblemedIcon.add_emblem(). - - - Note that - gio.EmblemedIcon - allows no control over the position of the emblems. See also - gio.Emblem - for more information. - - - - - Constructor - - - gio.EmblemedIcon - icon - emblem - - - - icon : - a - gio.Icon. - - - - emblem : - a - gio.Emblem. - - - - Returns : - a new - gio.Icon. - - - - - - Creates a new gio.Icon - for icon with the emblem emblem. - - - - - - Methods - - - gio.EmblemedIcon.add_emblem - - - add_emblem - emblem - - - - - emblem : - a - gio.Emblem - - - - - - The add_emblem() method adds emblem to the - list of gio.Emblems. - - - - - gio.EmblemedIcon.get_icon - - - get_icon - - - - - - Returns : - a - gio.Icon - that is owned by emblemed. - - - - - - The get_icon() method gets the main icon for emblemed. - - - - diff --git a/docs/reference/pygio-file.xml b/docs/reference/pygio-file.xml deleted file mode 100644 index ac85840..0000000 --- a/docs/reference/pygio-file.xml +++ /dev/null @@ -1,4534 +0,0 @@ - - - - - - gio.File - File and Directory Handling. - - - - Synopsis - - - gio.File - gobject.GInterface - - - gio.File - commandline - pathNone - uriNone - - - - append_to - flagsgio.FILE_CREATE_NONE - cancellableNone - - - append_to_async - callback - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - append_to_finish - result - - - copy - destination - progress_callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - copy_async - destination - callback - progress_callbackNone - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - progress_callback_dataNone - - - copy_attributes - destination - flagsgio.FILE_COPY_NONE - cancellableNone - - - copy_finish - result - - - create - flagsgio.FILE_CREATE_NONE - cancellableNone - - - create_async - callback - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - create_finish - result - - - delete - cancellableNone - - - dup - - - - eject_mountable - callback - flagsgio.FILE_CREATE_NONE - cancellableNone - user_dataNone - - - eject_mountable_finish - result - - - enumerate_children - attributes - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - enumerate_children_async - attributes - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - enumerate_children_finish - result - - - equal - file2 - - - find_enclosing_mount - cancellable - - - find_enclosing_mount_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - find_enclosing_mount_finish - result - - - get_basename - - - - get_child - name - - - get_child_for_display_name - display_name - - - get_parent - - - - get_parse_name - - - - get_path - - - - get_relative_path - descendant - - - get_uri - - - - get_uri_scheme - - - - has_prefix - prefix - - - has_uri_scheme - uri_scheme - - - is_native - - - - load_contents - cancellable - - - load_contents_async - callback - cancellableNone - user_dataNone - - - load_contents_finish - result - - - make_directory - cancellableNone - - - make_directory_with_parents - cancellableNone - - - make_symbolic_link - symlink_value - cancellable - - - monitor - flagsgio.FILE_MONITOR_NONE - cancellableNone - - - monitor_directory - flags - cancellableNone - - - monitor_file - flags - cancellableNone - - - mount_enclosing_volume - mount_operation - callback - flagsgio.MOUNT_MOUNT_NONE - cancellableNone - user_dataNone - - - mount_enclosing_volume_finish - result - - - mount_mountable - mount_operation - callback - flagsgio.MOUNT_MOUNT_NONE - cancellableNone - user_dataNone - - - mount_mountable_finish - result - - - move - destination - progress_callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - query_default_handler - cancellable - - - query_exists - cancellable - - - query_file_type - flags - cancellable - - - query_filesystem_info - attributes - cancellable - - - query_filesystem_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - query_filesystem_info_finish - result - - - query_info - attributes - flags - cancellable - - - query_info_async - attributes - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - query_info_finish - result - - - query_settable_attributes - cancellableNone - - - query_writable_namespace - cancellableNone - - - read - cancellableNone - - - read_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - read_finish - resultNone - - - replace - etag - make_backup - flagsgio.FILE_CREATE_NONE - cancellableNone - - - replace_async - callback - etagNone - make_backupTrue - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - replace_contents - contents - etagNone - make_backupTrue - flagsgio.FILE_CREATE_NONE - cancellableNone - - - replace_contents_async - contents - callback - etagNone - make_backupTrue - flagsgio.FILE_CREATE_NONE - cancellableNone - user_dataNone - - - replace_contents_finish - resultNone - - - replace_finish - resultNone - - - resolve_relative_path - relative_path - - - set_attribute - attribute - type - value_p - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_byte_string - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_int32 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_int64 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_string - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_uint32 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attribute_uint64 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_attributes_async - info - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - set_attributes_finish - result - - - set_attributes_from_info - info - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - set_dispay_name - display_name - cancellableNone - - - set_display_name_async - display_name - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - set_display_name_finish - result - - - trash - cancellableNone - - - unmount_mountable - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - unmount_mountable_finish - cancellableNone - - - - - -Functions - - gio.file_parse_name - parse_name - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.File - - - - - - Prerequisites - - gio.File is implemented by - gobject.GObject - - - - - Description - - - gio.File is a high - level abstraction for manipulating files on a virtual file system. - gio.Files are lightweight, - immutable objects that do no I/O upon creation. It is necessary to understand that - gio.File - objects do not represent files, merely an identifier for a file. All file content - I/O is implemented as streaming operations (see - gio.InputStream and - gio.OutputStream). - - - To construct a gio.File, you can use - it's constructor either with a path, an uri or a commandline argument. - gio.file_parse_name() - from a utf8 string gotten from - gio.File.get_parse_name(). - - - One way to think of a gio.File is as - an abstraction of a pathname. For normal files the system pathname is what is stored internally, - but as gio.Files are extensible it - could also be something else that corresponds to a pathname in a userspace implementation of a filesystem. - - - gio.Files make up hierarchies of - directories and files that correspond to the files on a filesystem. You can move through the - file system with GFile using - gio.File.get_parent() - to get an identifier for the parent directory, - gio.File.get_child() - to get a child within a directory, - gio.File.resolve_relative_path() - to resolve a relative path between two gio.Files. - There can be multiple hierarchies, so you may not end up at the same root if you repeatedly call - gio.File.get_parent() - on two different files. - - - All gio.Files have a basename (get with - gio.File.get_basename() - ). These names are byte strings that are used to identify the file on the filesystem - (relative to its parent directory) and there is no guarantees that they have any particular charset - encoding or even make any sense at all. If you want to use filenames in a user interface you should - use the display name that you can get by requesting the gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with - gio.File.query_info(). - This is guaranteed to be in utf8 and can be used in a user interface. But always store the real basename or the - GFile to use to actually access the file, because there is no way to go from a display name to the actual name. - - - Using gio.File as an identifier has the same - weaknesses as using a path in that there may be multiple aliases for the same file. For instance, - hard or soft links may cause two different gio.Files - to refer to the same file. Other possible causes for aliases are: case insensitive filesystems, short and - long names on Fat/NTFS, or bind mounts in Linux. If you want to check if two GFiles point to the same file - you can query for the gio.FILE_ATTRIBUTE_ID_FILE attribute. Note that - gio.File does some trivial canonicalization - of pathnames passed in, so that trivial differences in the path string used at creation - (duplicated slashes, slash at end of path, "." or ".." path segments, etc) does not create different - gio.Files. - - - Many gio.File operations have both synchronous - and asynchronous versions to suit your application. Asynchronous versions of synchronous functions simply - have _async() appended to their function names. The asynchronous I/O functions call a - GAsyncReadyCallback which is then used to finalize the operation, producing a GAsyncResult - which is then passed to the function's matching _finish() operation. - - - Some gio.File operations do not have - synchronous analogs, as they may take a very long time to finish, and blocking may leave an application - unusable. Notable cases include: - gio.File.mount_mountable() - to mount a mountable file. - gio.File.unmount_mountable() - to unmount a mountable file. - gio.File.eject_mountable() - to eject a mountable file. - - - One notable feature of gio.Files are - entity tags, or "etags" for short. Entity tags are somewhat like a more abstract - version of the traditional mtime, and can be used to quickly determine if the file - has been modified from the version on the file system. See the HTTP 1.1 - specification for HTTP Etag headers, which are a very similar concept. - - - - - Constructor - - - gio.File - commandline - pathNone - uriNone - - - - commandline : - a command line string. - - - - path : - a string containing a relative or absolute path. - - - - uri : - a string containing a URI. - - - - Returns : - a new - gio.File. - - - - - - Creates a new gio.File either from a commandline, - a path or an uri. - - - - - - Methods - - - gio.File.append_to - - - append_to - flagsgio.FILE_CREATE_NONE - cancellableNone - - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.FileOutputStream - or None on error. - - - - - - The append_to() method gets an output stream for - appending data to the file. If the file doesn't already exist it is created. - - - By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to the - current user, to the level that is supported on the target filesystem. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If - the operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - Some file systems don't allow all file names, and may return an - gio.ERROR_INVALID_FILENAME error. If the file is a directory the - gio.ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, - and depend on what kind of filesystem the file is on. - - - - - gio.File.append_to_async - - - append_to_async - callback - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - . - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The append_to_async() method asynchronously opens file for appending. - - - For more details, see - gio.File.append_to() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.append_to_finish() - to get the result of the operation. - - - - - gio.File.append_to_finish - - - append_to_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a valid - gio.OutputStream - or None on error. - - - - - - The append_to_finish() method finishes an asynchronous - file append operation started with - gio.File.append_to_async(). - - - - - gio.File.copy - - - copy - destination - progress_callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - - - destination : - destination gio.File. - - - - progress_callback : - function to callback with progress information. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to the progress callback function. - - - - Returns : - True on success, - False otherwise. - - - - - - The copy() method copies the file source to - the location specified by destination. Can not handle recursive copies of directories. - - - If the flag gio.FILE_COPY_OVERWRITE is specified an already existing - destination file is overwritten. - - - If the flag gio.FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will - be copied as symlinks, otherwise the target of the source symlink will be copied. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - If progress_callback is not None, then the operation can be - monitored by setting this to a GFileProgressCallback function. user_data - will be passed to this function. It is guaranteed that this callback will be - called after all data has been transferred with the total number of bytes - copied during the operation. - - - If the source file does not exist then the gio.ERROR_NOT_FOUND error is returned, - independent on the status of the destination. - - - If gio.FILE_COPY_OVERWRITE is not specified and the target exists, - then the error gio.ERROR_EXISTS is returned. - - - If trying to overwrite a file over a directory the gio.ERROR_IS_DIRECTORY error - is returned. If trying to overwrite a directory with a directory the - gio.ERROR_WOULD_MERGE error is returned. - - - If the source is a directory and the target does not exist, or gio.FILE_COPY_OVERWRITE - is specified and the target is a file, then the gio.ERROR_WOULD_RECURSE error is returned. - - - If you are interested in copying the - gio.File object - itself (not the on-disk file), see - gio.File.dup(). - - - - - gio.File.copy_async - - - append_to_async - destination - callback - progress_callbackNone - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - progress_callback_dataNone - - - - - destination : - destination gio.File. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - progress_callback : - function to callback with progress information. - - - - flags : - a set of - . - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - progress_callback_data : - the data to pass to the progress callback function. - - - - - - The copy_async() method copies the file source to - the location specified by destination asynchronously. For details of the behaviour, - see gio.File.copy(). - - - If progress_callback is not None, then that function that will - be called just like in - gio.File.copy(), - however the callback will run in the main loop, not in the thread that is doing the I/O operation. - - - When the operation is finished, callback will be called. You can then call - gio.File.copy_finish() - to get the result of the operation. - - - - - gio.File.copy_attributes - - - copy_attributes - destination - flagsgio.FILE_COPY_NONE - cancellableNone - - - - - destination : - destination gio.File - to copy attributes to. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attributes were copied successfully, - False otherwise. - - - - - - The copy_attributes() method copies the file attributes - from source to destination. - - - Normally only a subset of the file attributes are copied, those that are copies - in a normal file copy operation (which for instance does not include e.g. owner). - However if gio.FILE_COPY_ALL_METADATA is specified in flags, then all the metadata - that is possible to copy is copied. This is useful when implementing move by copy + delete source. - - - - - gio.File.copy_finish - - - copy_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True on success, - False on error. - - - - - - The copy_finish() method finishes an asynchronous - copy operation started with - gio.File.copy_async(). - - - - - gio.File.create - - - create - flagsgio.FILE_CREATE_NONE - cancellableNone - - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.FileOutputStream - or None on error. - - - - - - The create() method creates a new file and returns - an output stream for writing to it. The file must not already exist. - - - By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to the - current user, to the level that is supported on the target filesystem. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - If a file or directory with this name already exists the gio.ERROR_EXISTS - error will be returned. Some file systems don't allow all file names, and - may return an gio.ERROR_INVALID_FILENAME error, and if the name is to long - gio.ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible too, - and depend on what kind of filesystem the file is on. - - - - - gio.File.create_async - - - create_async - callback - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - . - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The create_async() method asynchronously creates a new - file and returns an output stream for writing to it. The file must not already exist. - - - For more details, see - gio.File.create() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.create_finish() - to get the result of the operation. - - - - - gio.File.create_finish - - - create_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a - gio.FileOutputStream - or None on error. - - - - - - The create_finish() method finishes an asynchronous - copy operation started with - gio.File.create_async(). - - - - - gio.File.delete - - - delete - cancellable - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the file was deleted, - False otherwise. - - - - - - The deleted() method deletes a file. If the file is a - directory, it will only be deleted if it is empty. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.dup - - - dup - - - - - - Returns : - a new gio.File - that is a duplicate of the given gio.File. - - - - - - The dup() method duplicates a - gio.File - handle. This operation does not duplicate the actual file or directory represented - by the gio.File; see - gio.File.copy() - if attempting to copy a file. - - - This call does no blocking i/o. - - - - - gio.File.eject_mountable - - - eject_mountable - callback - flagsgio.FILE_CREATE_NONE - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - . - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The eject_mountable() method starts an asynchronous eject on a - mountable. When this operation has completed, callback will be called with - user_user data, and the operation can be finalized with - gio.File.eject_mountable_finish(). - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.eject_mountable_finish - - - eject_mountable_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the file was ejected successfully, - False on error. - - - - - - The create_finish() method finishes an asynchronous - copy operation started with - gio.File.create_async(). - - - - - gio.File.enumerate_children - - - enumerate_children - attributes - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attributes : - an attribute query string. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.FileEnumerator - or None on error. - - - - - - The enumerate_children() method gets the requested information - about the files in a directory. The result is a GFileEnumerator object that will give out - gio.FileInfo objects - for all the files in the directory. - - - The attribute value is a string that specifies the file attributes that should be gathered. - It is not an error if it's not possible to read a particular requested attribute from a file - - it just won't be set. attribute should be a comma-separated list of attribute or attribute - wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all - attributes in the standard namespace. An example attribute query be "standard::*,owner::user". - The standard attributes are available as defines, like gio.FILE_ATTRIBUTE_STANDARD_NAME. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. If the file - is not a directory, the gio.FILE_ERROR_NOTDIR error will be returned. - Other errors are possible too. - - - - - gio.File.enumerate_children_async - - - enumerate_children_async - attributes - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - attributes : - an attribute query string. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - . - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The enumerate_children_async() method asynchronously gets the - requested information about the files in a directory. The result is a - gio.FileEnumerator - object that will give out gio.FileInfo - objects for all the files in the directory. - - - For more details, see - enumerate_children() - which is the synchronous version of this call. - - - - - gio.File.eject_mountable_finish - - - enumerate_children_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileEnumerator - or None if an error occurred. - - - - - - The enumerate_children_finish() method finishes an asynchronous - copy operation started with - gio.File.enumerate_children_async(). - - - - - gio.File.equal - - - equal - file2 - - - - - file2 : - a gio.File. - - - - Returns : - True if file1 and file2 are equal. - False if either is not a - gio.File. - - - - - - The equal() method checks equality of two given - gio.Files. - Note that two gio.Files - that differ can still refer to the same file on the filesystem due to various - forms of filename aliasing. - - - This call does no blocking i/o. - - - - - gio.File.find_enclosing_mount - - - enumerate_children - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.Mount - or None on error. - - - - - - The find_enclosing_mount() method gets a - gio.Mount for the - gio.File. - - - If the interface for file does not have a mount (e.g. possibly a remote share), - error will be set to gio.ERROR_NOT_FOUND and None will be returned. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.find_enclosing_mount_async - - - find_enclosing_mount_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The find_enclosing_mount_async() method asynchronously - gets the mount for the file. - - - For more details, see - gio.File.find_enclosing_mount() - which is the synchronous version of this call. - - - - - gio.File.find_enclosing_mount_finish - - - find_enclosing_mount_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.Mount - or None if an error occurred. - - - - - - The find_enclosing_mount_finish() method finishes an asynchronous - find mount started with - gio.File.find_enclosing_mount_async(). - - - - - gio.File.get_basename - - - get_basename - - - - - - Returns : - string containing the - gio.File's - base name, or None if given - gio.File is invalid. - - - - - - The get_basename() method gets the base name - (the last component of the path) for a given - gio.File. - - - If called for the top level of a system (such as the filesystem root or - a uri like sftp://host/) it will return a single directory separator - (and on Windows, possibly a drive letter). - - - The base name is a byte string (*not* UTF-8). It has no defined encoding - or rules other than it may not contain zero bytes. If you want to use filenames - in a user interface you should use the display name that you can get by requesting - the gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with - gio.File.query_info(). - - - This call does no blocking i/o. - - - - - gio.File.get_child - - - get_child - name - - - - - name : - string containing the child's basename. - - - - Returns : - a - gio.File - to a child specified by name. - - - - - - The get_child() method gets a child of file - with basename equal to name. - - - Note that the file with that specific name might not exist, but you can - still have a gio.File - that points to it. You can use this for instance to create that file. - - - This call does no blocking i/o. - - - - - gio.File.get_child_for_display_name - - - get_child_for_display_name - display_name - - - - - display_name : - string to a possible child. - - - - Returns : - a - gio.File - to the specified child or None - if the display name couldn't be converted. - - - - - - The get_child_for_display_name() method gets the - child of file for a given display_name (i.e. a UTF8 version of the name). - If this function fails, it returns NULL and error will be set. This is very - useful when constructing a GFile for a new file and the user entered the filename - in the user interface, for instance when you select a directory and type a filename - in the file selector. - - - This call does no blocking i/o. - - - - - gio.File.get_parent - - - get_parent - - - - - - Returns : - a - gio.File - structure to the parent of the given - gio.File or - None if there is no parent. - - - - - - The get_parent() method gets the parent directory for the file. - If the file represents the root directory of the file system, then None - will be returned. - - - This call does no blocking i/o. - - - - - gio.File.get_parse_name - - - get_parse_name - - - - - - Returns : - a string containing the - gio.File's parse name. - - - - - - The get_parse_name() method gets the parse name - of the file. A parse name is a UTF-8 string that describes the file such - that one can get the gio.File - back using - gio.file_parse_name(). - - - This is generally used to show the gio.File - as a nice full-pathname kind of string in a user interface, like in a location entry. - - - For local files with names that can safely be converted to UTF8 the pathname is used, - otherwise the IRI is used (a form of URI that allows UTF8 characters unescaped). - - - This call does no blocking i/o. - - - - - gio.File.get_path - - - get_path - - - - - - Returns : - a string containing the - gio.File's path, - or None if no such path exists. - - - - - - The get_path() method gets the local pathname for - gio.File, if one exists. - - - This call does no blocking i/o. - - - - - gio.File.get_relative_path - - - get_relative_path - descendant - - - - - descendant : - input gio.File. - - - - Returns : - string with the relative path from descendant to parent, - or None if descendant doesn't have parent as prefix. - - - - - - The get_relative_path() method gets the path for - descendant relative to parent. - - - This call does no blocking i/o. - - - - - gio.File.get_uri - - - get_uri - - - - - - Returns : - a string containing the - gio.File's URI. - - - - - - The get_uri() method gets the URI for the file. - - - This call does no blocking i/o. - - - - - gio.File.get_uri_scheme - - - get_uri_scheme - - - - - - Returns : - a string containing the URI scheme for the - gio.File. - - - - - - The get_uri_scheme() method gets the URI scheme for a - gio.File. - RFC 3986 decodes the scheme as: - - -URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] - - - Common schemes include "file", "http", "ftp", etc. - - - This call does no blocking i/o. - - - - - gio.File.has_prefix - - - has_prefix - prefix - - - - - prefix : - input gio.File. - - - - Returns : - True if the files's parent, grandparent, - etc is prefix. False otherwise. - - - - - - The has_prefix() method checks whether file has the prefix - specified by prefix. In other word, if the names of inital elements of files pathname - match prefix. Only full pathname elements are matched, so a path like /foo is not - considered a prefix of /foobar, only of /foo/bar. - - - This call does no blocking i/o, as it works purely on names. As such it can sometimes - return False even if file is inside a prefix (from a filesystem point - of view), because the prefix of file is an alias of prefix. - - - - - gio.File.has_uri_scheme - - - has_uri_scheme - uri_scheme - - - - - uri_scheme : - a string containing a URI scheme. - - - - Returns : - True if - gio.File's - backend supports the given URI scheme, False if URI scheme - is None, not supported, or - gio.File is invalid. - - - - - - The has_uri_scheme() method checks to see if a - gio.File - has a given URI scheme. - - - This call does no blocking i/o. - - - - - gio.File.is_native - - - is_native - - - - - - Returns : - True if file is native. - - - - - - The is_native() method checks to see if a file - is native to the platform. - - - A native file s one expressed in the platform-native filename format, e.g. - "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it - might be on a locally mounted remote filesystem. - - - On some systems non-native files may be available using the native filesystem - via a userspace filesystem (FUSE), in these cases this call will return - False, but - gio.File.get_path() - will still return a native path. - - - This call does no blocking i/o. - - - - - gio.File.load_contents - - - load_contents - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a three tuple containing the contents of the file, - the length of the contents of the file and the current entity tag for the file. - - - - - - The load_contents() method loads the content of the file into memory. - The data is always zero-terminated, but this is not included in the resultant length. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.load_contents_async - - - load_contents_async - callback - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The load_contents_async() method starts an asynchronous load of the file's contents. - - - For more details, see - gio.File.load_contents() - which is the synchronous version of this call. - - - When the load operation has completed, callback will be called with user data. To finish - the operation, call - gio.File.load_contents_finish() - with the GAsyncResult returned by the callback. - - - - - gio.File.load_contents_finish - - - load_contents_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a three tuple containing the contents of the file, - the length of the contents of the file and the current entity tag for the file. - - - - - - The load_contents_finish() method finishes an asynchronous - find mount started with - gio.File.load_contents_async(). - - - - - gio.File.make_directory - - - make_directory - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True on successful creation, - False otherwise. - - - - - - The make_directory() method creates a directory. - Note that this will only create a child directory of the immediate parent directory - of the path or URI given by the gio.File. - To recursively create directories, see - gio.File.make_directory_with_parents(). - This function will fail if the parent directory does not exist, setting error to - gio.ERROR_NOT_FOUND. If the file system doesn't support creating directories, this - function will fail, setting error to gio.ERROR_NOT_SUPPORTED. - - - For a local gio.File the newly - created directory will have the default (current) ownership and permissions of the current process. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.make_directory_with_parents - - - make_directory_with_parents - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if all directories have been successfully created, - False otherwise. - - - - - - The make_directory_with_parents() method creates a directory - and any parent directories that may not exist similar to 'mkdir -p'. If the file system - does not support creating directories, this function will fail, setting error to gio.ERROR_NOT_SUPPORTED. - - - For a local gio.File the newly - created directories will have the default (current) ownership and permissions of the current process. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.make_symbolic_link - - - make_symbolic_link - symlink_value - cancellableNone - - - - - symlink_value : - a string with the value of the new symlink. - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True on the creation of a new symlink, - False otherwise. - - - - - - The make_symbolic_link() method creates a symbolic link. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.monitor - - - monitor - flagsgio.FILE_MONITOR_NONE - cancellableNone - - - - - flags : - - a - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.FileMonitor - for the given file, or None on error - - - - - - The monitor() method obtains a file or directory - monitor for the given file, depending on the type of the file. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.monitor_directory - - - monitor_directory - flagsgio.FILE_MONITOR_NONE - cancellableNone - - - - - flags : - - a - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.FileMonitor - for the given file, or None on error - - - - - - The monitor_directory() method obtains a directory monitor - for the given file. This may fail if directory monitoring is not supported. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.monitor_file - - - monitor_file - flagsgio.FILE_MONITOR_NONE - cancellableNone - - - - - flags : - - a - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.FileMonitor - for the given file, or None on error - - - - - - The monitor_file() method obtains a file monitor for the - given file. If no file notification mechanism exists, then regular polling - of the file is used. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.mount_enclosing_volume - - - mount_enclosing_volume - mount_operation - callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - - - mount_operation : - a - gio.MountOperation - or None to avoid user interaction. - - - - callback : - a GAsyncReadyCallback to call when the request - is satisfied, or None. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to the progress callback function. - - - - - - The mount_enclosing_volume() method starts a mount_operation, - mounting the volume that contains the file location. - - - When this operation has completed, callback will be called with user_user data, - and the operation can be finalized with - gio.File.mount_enclosing_volume_finish(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.mount_enclosing_volume_finish - - - mount_enclosing_volume_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if successful. If an error has occurred, - this function will return False and set error appropriately if present. - - - - - - The mount_enclosing_volume_finish() method finishes an asynchronous - find mount started with - gio.File.mount_enclosing_volume(). - - - - - gio.File.mount_mountable - - - mount_mountable - mount_operation - callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - - - mount_operation : - a - gio.MountOperation - or None to avoid user interaction. - - - - callback : - a GAsyncReadyCallback to call when the request - is satisfied, or None. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to the progress callback function. - - - - - - The mount_mountable() method mounts a file of type - gio.FILE_TYPE_MOUNTABLE. Using mount_operation, you can request callbacks when, - for instance, passwords are needed during authentication. - - - When this operation has completed, callback will be called with user_user data, - and the operation can be finalized with - gio.File.mount_mountable_finish(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.mount_mountable_finish - - - mount_mountable_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.File - or None on error. - - - - - - The mount_mountable_finish() method finishes an asynchronous - find mount started with - gio.File.mount_mountable(). - - - - - gio.File.move - - - copy - destination - progress_callback - flagsgio.FILE_COPY_NONE - cancellableNone - user_dataNone - - - - - destination : - destination gio.File. - - - - progress_callback : - function to callback with progress information. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to the progress callback function. - - - - Returns : - True on success, - False otherwise. - - - - - - The move() method tries to move the file or directory - source to the location specified by destination. If native move operations are - supported then this is used, otherwise a copy + delete fallback is used. The native - implementation may support moving directories (for instance on moves inside the same - filesystem), but the fallback code does not. - - - If the flag gio.FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten. - - - If the flag gio.FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied - as symlinks, otherwise the target of the source symlink will be copied. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - If progress_callback is not None, then the operation can be monitored - by setting this to a GFileProgressCallback function. progress_callback_data will be passed - to this function. It is guaranteed that this callback will be called after all data has been - transferred with the total number of bytes copied during the operation. - - - If the source file does not exist then the gio.ERROR_NOT_FOUND error is returned, - independent on the status of the destination. - - - If gio.FILE_COPY_OVERWRITE is not specified and the target exists, then the error - gio.ERROR_EXISTS is returned. - - - If trying to overwrite a file over a directory the gio.ERROR_IS_DIRECTORY error is returned. - If trying to overwrite a directory with a directory the gio.ERROR_WOULD_MERGE error is returned. - - - If the source is a directory and the target does not exist, or gio.FILE_COPY_OVERWRITE is specified - and the target is a file, then the gio.ERROR_WOULD_RECURSE error may be returned - (if the native move operation isn't available). - - - - - gio.File.query_default_handler - - - query_default_handler - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.AppInfo - if the handle was found, None if there were errors. - - - - - - The query_default_handler() method returns the - gio.AppInfo that - is registered as the default application to handle the file specified by file. - - - If cancellable is not None, then the operation can be - cancelled by triggering the cancellable object from another thread. If the - operation was cancelled, the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.query_exists - - - query_exists - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the file exists (and can be detected - without error), False otherwise (or if cancelled). - - - - - - The query_exists() method is an tility function to check - if a particular file exists. This is implemented using - gio.File.query_info() - and as such does blocking I/O. - - - Note that in many cases it is racy to first check for file existence and then execute - something based on the outcome of that, because the file might have been created or - removed in between the operations. The general approach to handling that is to not check, - but just do the operation and handle the errors as they come. - - - As an example of race-free checking, take the case of reading a file, and if it doesn't - exist, creating it. There are two racy versions: read it, and on error create it; and: - check if it exists, if not create it. These can both result in two processes creating the - file (with perhaps a partially written file as the result). The correct approach is to - always try to create the file with - gio.File.create() - which will either atomically create the file or fail with a gio.ERROR_EXISTS error. - - - However, in many cases an existence check is useful in a user interface, for instance - to make a menu item sensitive/insensitive, so that you don't have to fool users that - something is possible and then just show and error dialog. If you do this, you should - make sure to also handle the errors that can happen due to races when you execute the operation. - - - - - gio.File.query_file_type - - - query_file_type - flagsgio.FILE_MONITOR_NONE - cancellableNone - - - - - flags : - - a - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - - - - - - - - The query_file_type() method it's an utility function to inspect - the - of a file. This is implemented using - gio.File.query_info() - and as such does blocking I/O. - - - The primary use case of this method is to check if a file is a regular file, directory, or symlink. - - - - - gio.File.query_filesystem_info - - - query_filesystem_info - attributes - cancellableNone - - - - - attributes : - an attribute query string. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.FileInfo - or None if there was an error. - - - - - - The query_filesystem_info() method it's similar to - gio.File.query_info(), - but obtains information about the filesystem the file is on, rather than the - file itself. For instance the amount of space available and the type of the filesystem. - - - The attribute value is a string that specifies the file attributes that should be gathered. - It is not an error if it's not possible to read a particular requested attribute from a file - - it just won't be set. attribute should be a comma-separated list of attribute or attribute - wildcards. The wildcard "*" means all attributes, and a wildcard like "fs:*" means all attributes - in the fs namespace. The standard namespace for filesystem attributes is "fs". Common attributes - of interest are gio.FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem in bytes), - gio.FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available), and gio.FILE_ATTRIBUTE_FILESYSTEM_TYPE - (type of the filesystem). - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. Other errors - are possible too, and depend on what kind of filesystem the file is on. - - - - - gio.File.query_filesystem_info_async - - - query_filesystem_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - attributes : - an attribute query string. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The query_filesystem_info_async() method asynchronously - gets the requested information about the filesystem that the specified file is on. - The result is a GFileInfo object that contains key-value attributes - (such as type or size for the file). - - - For more details, see - query_filesystem_info() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.query_filesystem_info_finish() - to get the result of the operation. - - - - - gio.File.query_filesystem_info_finish - - - query_filesystem_info_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileInfo - or None if an error occurred. - - - - - - The query_filesystem_info_finish() method finishes an asynchronous - copy operation started with - gio.File.query_filesystem_info_async(). - - - - - gio.File.query_filesystem_info - - - query_info - attributes - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attributes : - an attribute query string. - - - - flags : - - a - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.FileInfo - for the given file or None if there was an error. - - - - - - The query_info() method gets the requested - information about specified file. The result is a - gio.FileInfo - object that contains key-value attributes (such as the type or size of the file). - - - The attribute value is a string that specifies the file attributes that should - be gathered. It is not an error if it's not possible to read a particular - requested attribute from a file - it just won't be set. attribute should be - a comma-separated list of attribute or attribute wildcards. The wildcard "*" - means all attributes, and a wildcard like "standard::*" means all attributes - in the standard namespace. An example attribute query be "standard::*,owner::user". - The standard attributes are available as defines, like gio.FILE_ATTRIBUTE_STANDARD_NAME. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - For symlinks, normally the information about the target of the symlink is returned, - rather than information about the symlink itself. However if you pass - gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in flags the information about - the symlink itself will be returned. Also, for symlinks that point to non-existing - files the information about the symlink itself will be returned. - - - If the file does not exist, the gio.ERROR_NOT_FOUND error will be - returned. Other errors are possible too, and depend on what kind of - filesystem the file is on. - - - - - gio.File.query_info_async - - - query_info_async - attributes - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - attributes : - an attribute query string. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - - a - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The query_info_async() method asynchronously gets the - requested information about specified file. The result is a - gio.FileInfo - object that contains key-value attributes (such as type or size for the file). - - - For more details, see - query_info() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.query_info_finish() - to get the result of the operation. - - - - - gio.File.query_info_finish - - - query_info_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileInfo - for the given file or None if an error occurred. - - - - - - The query_info_finish() method finishes an asynchronous - copy operation started with - gio.File.query_info_async(). - - - - - gio.File.query_settable_attributes - - - query_settable_attributes - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a list of - gio.FileAttributeInfo - describing the settable attributes. - - - - - - The query_settable_attributes() method obtain the - list of settable attributes for the file. - - - Returns the type and full attribute name of all the attributes that can be - set on this file. This doesn't mean setting it will always succeed though, - you might get an access failure, or some specific file may not support a specific attribute. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.query_writable_namespace - - - query_writable_namespace - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a list of - gio.FileAttributeInfo - describing the writable namespaces. - - - - - - The query_writable_namespace() method obtain the - list of attribute namespaces where new attributes can be created by a user. - An example of this is extended attributes (in the "xattr" namespace). - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.read - - - read - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.FileInputStream - or None on error. - - - - - - The read() method opens a file for reading. The result - is a gio.FileInputStream - that can be used to read the contents of the file. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - If the file does not exist, the gio.ERROR_NOT_FOUND error will be returned. - If the file is a directory, the gio.ERROR_IS_DIRECTORY error will be returned. - Other errors are possible too, and depend on what kind of filesystem the file is on. - - - - - gio.File.read_async - - - read_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The read_async() method asynchronously opens file for reading. - - - For more details, see - read() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.read_finish() - to get the result of the operation. - - - - - gio.File.read_finish - - - read_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileInputStream - file or None if an error occurred. - - - - - - The read_finish() method finishes an asynchronous - copy operation started with - gio.File.read_async(). - - - - - gio.File.replace - - - replace - etag - make_backup - flagsgio.FILE_CREATE_NONE - cancellableNone - - - - - etag : - an optional entity tag for the current - gio.File, - or None to ignore. - - - - make_backup : - True if a backup should be created. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a - gio.FileOutputStream - or None on error. - - - - - - The replace() method returns an output stream for - overwriting the file, possibly creating a backup copy of the file first. - If the file doesn't exist, it will be created. - - - This will try to replace the file in the safest way possible so that any - errors during the writing will not affect an already existing copy of the file. - For instance, for local files it may write to a temporary file and then atomically - rename over the destination when the stream is closed. - - - By default files created are generally readable by everyone, but if you pass - gio.FILE_CREATE_PRIVATE in flags the file will be made readable only to - the current user, to the level that is supported on the target filesystem. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - If you pass in a non-None etag value, then this value is compared - to the current entity tag of the file, and if they differ an gio.ERROR_WRONG_ETAG error - is returned. This generally means that the file has been changed since you last read it. - You can get the new etag from - gio.FileOutputStream.get_etag() - after you've finished writing and closed the GFileOutputStream. When you load a new file you can use - gio.FileInputStream.query_info() - to get the etag of the file. - - - If make_backup is True, this function will attempt to make a backup - of the current file before overwriting it. If this fails a gio.ERROR_CANT_CREATE_BACKUP - error will be returned. If you want to replace anyway, try again - with make_backup set to False. - - - If the file is a directory the gio.ERROR_IS_DIRECTORY error will be returned, and - if the file is some other form of non-regular file then a gio.ERROR_NOT_REGULAR_FILE - error will be returned. Some file systems don't allow all file names, and may return an - gio.ERROR_INVALID_FILENAME error, and if the name is to long gio.ERROR_FILENAME_TOO_LONG - will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. - - - - - gio.File.replace_async - - - replace_async - callback - etagNone - make_backupTrue - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - etag : - an optional entity tag for the current - gio.File, - or None to ignore. - - - - make_backup : - True if a backup should be created. - - - - flags : - a set of - - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The replace_async() method asynchronously overwrites the file, - replacing the contents, possibly creating a backup copy of the file first. - - - For more details, see - replace() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.replace_finish() - to get the result of the operation. - - - - - gio.File.replace_contents - - - replace_contents - contents - etag - make_backup - flagsgio.FILE_CREATE_NONE - cancellableNone - - - - - contents : - a string containing the new contents for file. - - - - etag : - the old entity tag for the document - or None to ignore. - - - - make_backup : - True if a backup should be created. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - the new entity tag for the document. - - - - - - The replace_contents() method replaces the contents - of file with contents of length bytes. If etag is specified (not NULL) any existing - file must have that etag, or the error gio.ERROR_WRONG_ETAG will be returned. - - - If make_backup is True, this function will attempt to make a backup of file. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - The returned etag can be used to verify that the file hasn't changed the next time it is saved over. - - - - - gio.File.replace_contents_async - - - replace_contents_async - contents - callback - etagNone - make_backupTrue - flagsgio.FILE_CREATE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - contents : - a string containing the new contents for file. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - etag : - an optional entity tag for the current - gio.File, - or None to ignore. - - - - make_backup : - True if a backup should be created. - - - - flags : - a set of - - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The replace_contents_async() method starts an asynchronous - replacement of file with the given contents of length bytes. etag will - replace the document's current entity tag. - - - For more details, see - replace_contents() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.replace_contents_finish() - to get the result of the operation. - - - - - gio.File.replace_contents_finish - - - replace_contents_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - the new entity tag for the document. - - - - - - The replace_contents_finish() method finishes an asynchronous - copy operation started with - gio.File.replace_contents_async(). - - - - - gio.File.replace_finish - - - replace_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileOutputStream - or None if an error occurred. - - - - - - The replace_finish() method finishes an asynchronous - copy operation started with - gio.File.replace_async(). - - - - - gio.File.resolve_relative_path - - - resolve_relative_path - relative_path - - - - - relative_path : - a given relative path string. - - - - Returns : - a gio.File - to the resolved path. None if relative_path is None - or if file is invalid. - - - - - - The resolve_relative_path() method resolves a - relative path for file to an absolute path. - - - This call does no blocking i/o. - - - - - gio.File.set_attribute - - - set_attribute - attribute - type - value_p - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - type : - the type of the attribute . - - - - value_p : - the value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute() method sets an attribute in - the file with attribute name attribute to value. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_byte_string - - - set_attribute_byte_string - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - a string containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_byte_string() method Sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_BYTE_STRING to value. If attribute is of a different type, - this operation will fail, returning False. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_int32 - - - set_attribute_int32 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - an int containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_int32() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_INT32 to value. If attribute is of a different type, - this operation will fail. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_int64 - - - set_attribute_int64 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - a long containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_int64() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_INT64 to value. If attribute is of a different type, - this operation will fail. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_string - - - set_attribute_string - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - a string containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_string() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_STRING to value. If attribute is of a different type, - this operation will fail. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_uint32 - - - set_attribute_uint32 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - an int containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_uint32() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_UINT32 to value. If attribute is of a different type, - this operation will fail. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attribute_uint64 - - - set_attribute_uint64 - attribute - value - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - attribute : - a string containing the attribute's name. - - - - value : - a long containing the attribute's new value. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attribute was set, - False otherwise. - - - - - - The set_attribute_uint64() method sets attribute of type - gio.FILE_ATTRIBUTE_TYPE_UINT64 to value. If attribute is of a different type, - this operation will fail. - - - If cancellable is not None, then the operation can be cancelled by triggering - the cancellable object from another thread. If the operation was cancelled, the error - gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_attributes_async - - - set_attributes_async - info - callback - flagsgio.FILE_QUERY_INFO_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - info : - a gio.FileInfo - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The set_attributes_async() method asynchronously - sets the attributes of file with info. - - - For more details, see - set_attributes_from_info() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.set_attributes_finish() - to get the result of the operation. - - - - - gio.File.set_attributes_finish - - - set_attributes_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the attributes were set correctly, - False otherwise. - - - - - - The set_attributes_finish() method finishes an asynchronous - copy operation started with - gio.File.set_attributes_async(). - - - - - gio.File.set_attributes_from_info - - - set_attributes_from_info - info - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - - - - - info : - a gio.FileInfo - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True if the attributes were set correctly, - False otherwise. - - - - - - The set_attributes_from_info() method tries to set - all attributes in the GFileInfo on the target values, not stopping on the first error. - - If there is any error during this operation then error will be set to the - first error. Error on particular fields are flagged by setting the "status" - field in the attribute value to gio.FILE_ATTRIBUTE_STATUS_ERROR_SETTING, - which means you can also detect further errors. - - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_display_name - - - set_display_name - display_name - cancellableNone - - - - - display_name : - a string conaining the name to display. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - a gio.File - specifying what file was renamed to, or None if there was an error. - - - - - - The set_display_name() method renames file to - the specified display name. - - - The display name is converted from UTF8 to the correct encoding for the - target filesystem if possible and the file is renamed to this. - - - If you want to implement a rename operation in the user interface the - edit name (gio.FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the - initial value in the rename widget, and then the result after editing - should be passed to - gio.File.set_dispay_name(). - - - On success the resulting converted filename is returned. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.set_display_name_async - - - set_display_name_async - display_name - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - display_name : - a string conaining the name to display. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The set_display_name_async() method asynchronously - sets the display name for a given GFile. - - - For more details, see - set_display_name() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.File.set_display_name_finish() - to get the result of the operation. - - - - - gio.File.set_display_name_finish - - - set_display_name_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.File - or None on error. - - - - - - The set_display_name_finish() method finishes an asynchronous - copy operation started with - gio.File.set_display_name_async(). - - - - - gio.File.trash - - - trash - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - Returns : - True on successful trash, False otherwise. - - - - - - The trash() method sends file to the "Trashcan", if possible. - This is similar to deleting it, but the user can recover it before emptying the trashcan. - Not all file systems support trashing, so this call can return the gio.ERROR_NOT_SUPPORTED error. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - - - gio.File.unmount_mountable - - - unmount_mountable - callback - flagsgio.FILE_QUERY_INFO_NONE - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - a set of - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The unmount_mountable() method unmounts a file of type gio.FILE_TYPE_MOUNTABLE. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - When the operation is finished, callback will be called. You can then call - gio.File.unmount_mountable_finish() - to get the result of the operation. - - - - - gio.File.unmount_mountable_finish - - - unmount_mountable_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the operation finished successfully, - False otherwise. - - - - - - The unmount_mountable_finish() method finishes an asynchronous - copy operation started with - gio.File.unmount_mountable(). - - - - - - Functions - - - gio.file_parse_name - - - file_parse_name - parse_name - - - - - parse_name : - a file name or path to be parsed. - - - - Returns : - a new gio.File. - - - - - - The parse_name() function constructs a - gio.File - with the given parse_name (i.e. something given by g_file_get_parse_name()). - This operation never fails, but the returned object might not support any I/O - operation if the parse_name cannot be parsed. - - - - diff --git a/docs/reference/pygio-fileattributeinfo.xml b/docs/reference/pygio-fileattributeinfo.xml deleted file mode 100644 index 4b72c27..0000000 --- a/docs/reference/pygio-fileattributeinfo.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - gio.FileAttributeInfo - Information about a specific attribute. - - - - Synopsis - - - gio.FileAttributeInfo - __builtin__.object - - - - - - Ancestry - -+-- __builtin__.object - +-- gio.FileAttributeInfo - - - - - - Description - - - The gio.FileAttributeInfo - contains information about a specific attribute. - - - - - gio.FileAttributeInfo Attributes - -
- - - - - -
- - "name" - Read - The name of the attribute. - - - "type" - Read - the - - type of the attribute. - - - "flags" - Read - a set of - . - - - - - - - - diff --git a/docs/reference/pygio-fileenumerator.xml b/docs/reference/pygio-fileenumerator.xml deleted file mode 100644 index 4b16bf6..0000000 --- a/docs/reference/pygio-fileenumerator.xml +++ /dev/null @@ -1,488 +0,0 @@ - - - - - - gio.FileEnumerator - Enumerated Files Routines. - - - - Synopsis - - - gio.FileEnumerator - gobject.GObject - - - close - cancellableNone - - - close_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - close_finish - result - - - get_container - - - - has_pending - - - - is_closed - - - - next_file - cancellableNone - - - next_files_async - num_files - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - next_files_finish - result - - - set_pending - pending - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.FileEnumerator - - - - - - gio.FileEnumerator Properties - -
- - - - - -
- - "container" - Write - Construct only - The container that is being enumerated. - - - - - - - - - - Description - - - The gio.FileEnumerator - allows you to operate on a set of - gio.Files - returning a - gio.FileInfo - structure for each file enumerated (e.g. - gio.File.enumerate_children() - will return a The gio.FileEnumerator - for each of the children within a directory). - - - To get the next file's information from a - The gio.FileEnumerator use - gio.FileEnumerator.next_file() - or its asynchronous version, - gio.FileEnumerator.next_files_async(). - Note that the asynchronous version will return a list of - gio.FileInfos, - whereas the synchronous will only return the next file in the enumerator. - - - To close a gio.FileEnumerator - use close, - or its asynchronous version, - close_async. - Once a gio.FileEnumerator - is closed, no further actions may be performed on it. - - - - - Methods - - - gio.FileEnumerator.close - - - close - - cancellableNone - - - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True on success or - False on error. - - - - - - The close() method releases all resources used by this - enumerator, making the - - return gio.ERROR_CLOSED on all calls. - - - This will be automatically called when the last reference is dropped, - but you might want to call this function to make sure resources are released - as early as possible. - - - - - gio.FileEnumerator.close_async - - - close_async - - callback - - - io_priorityglib.PRIORITY_DEFAULT - - - cancellableNone - - - user_dataNone - - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - The - of the request. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The close_async() method asynchronously closes the file enumerator. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned in - gio.FileEnumerator.close_finish(). - - - - - gio.FileEnumerator.close_finish - - - close_finish - result - - - - - result : - a GAsyncResult. - - - - Returns : - True if the close operation - has finished successfully. - - - - - The close_finish() method finishes closing a file enumerator, started from - gio.FileEnumerator.close_async(). - - - If the file enumerator was already closed when - gio.FileEnumerator.close_async() - was called, then this function will report gio.ERROR_CLOSED in error, and return False. - If the file enumerator had pending operation when the close operation was started, then this function will report - gio.ERROR_PENDING, and return False. If cancellable was not None, then the operation - may have been cancelled by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be set, and False will be returned. - - - - - gio.FileEnumerator.get_container - - - get_container - - - - - - Returns : - the gio.File - which is being enumerated. - - - - - The get_container() method gets the - gio.File - container which is being enumerated. - - - - - gio.FileEnumerator.has_pending - - - has_pending - - - - - - Returns : - True if the enumerator has pending operations. - - - - - The has_pending() method checks if the file enumerator has pending operations. - - - - - gio.FileEnumerator.is_closed - - - is_closed - - - - - - Returns : - True if the enumerator is closed. - - - - - The is_closed() method checks if the file enumerator has been closed. - - - - - gio.FileEnumerator.next_file - - - next_file - cancellableNone - - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - Returns : - A gio.FileInfo - or None on error or end of enumerator. - - - - - - The next_file() method returns information for the next - file in the enumerated object. Will block until the information is available. - The gio.FileInfo - returned from this function will contain attributes that match the attribute string - that was passed when the GFileEnumerator was created. - - - On error, returns None and sets error to the error. If the enumerator - is at the end, None will be returned and error will be unset. - - - - - gio.FileEnumerator.next_files_async - - - next_files_async - num_files - callback - - io_priorityglib.PRIORITY_DEFAULT - - - cancellableNone - - - user_dataNone - - - - - - num_files : - The number of file info objects to request. - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - The - of the request. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The next_files_async() method requests information for a number - of files from the enumerator asynchronously. When all i/o for the operation is finished - the callback will be called with the requested information. - - - The callback can be called with less than num_files files in case of error or at the - end of the enumerator. In case of a partial error the callback will be called with any - succeeding items and no error, and on the next request the error will be reported. If a - request is cancelled the callback will be called with gio.ERROR_CANCELLED. - - - During an async request no other sync and async calls are allowed, and will result in gio.ERROR_PENDING errors. - - - Any outstanding i/o request with higher priority (lower numerical value) will be executed - before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. - - - - - gio.FileEnumerator.next_files_finish - - - next_files_finish - result - - - - - result : - a GAsyncResult. - - - - Returns : - A list of - gio.FileInfos. - - - - - - The next_files_finish() method finishes the - asynchronous operation started with - gio.FileEnumerator.next_files_async(). - - - - - gio.FileEnumerator.set_pending - - - set_pending - pending - - - - - pending : - A boolean value. - - - - - - The push_current() method sets the file enumerator as having pending operations. - - - - diff --git a/docs/reference/pygio-fileicon.xml b/docs/reference/pygio-fileicon.xml deleted file mode 100644 index d4a443b..0000000 --- a/docs/reference/pygio-fileicon.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - gio.FileIcon - Icons pointing to an image file. - - - - Synopsis - - - gio.FileIcon - gobject.GObject - gio.Icon - gio.LoadableIcon - - - gio.FileIcon - file - - - - get_file - - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.FileIcon - - - - - - Description - - - The gio.FileIcon - specifies an icon by pointing to an image file to be used as icon. - - - - - Constructor - - - gio.FileIcon - file - - - - file : - a - gio.File - - - - Returns : - a new - gio.FileIcon - for the given file, or None on error. - - - - - - Creates a new icon for a file. - - - - - - Methods - - - gio.FileIcon.get_file - - - get_file - - - - - - Returns : - a - gio.File - or None. - - - - - - The get_file() method gets the - gio.File - associated with the given icon. - - - - diff --git a/docs/reference/pygio-fileinfo.xml b/docs/reference/pygio-fileinfo.xml deleted file mode 100644 index 33eeae7..0000000 --- a/docs/reference/pygio-fileinfo.xml +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - gio.FileInfo - File Information and Attributes - - - - Synopsis - - - gio.FileInfo - gobject.GObject - - - gio.FileInfo - - - - - clear_status - - - - copy_into - - - - dup - - - - get_attribute_as_string - attribute - - - get_attribute_boolean - attribute - - - get_attribute_byte_string - attribute - - - get_attribute_data - attribute - - - get_attribute_int32 - attribute - - - get_attribute_int64 - attribute - - - get_attribute_object - attribute - - - get_attribute_status - attribute - - - get_attribute_string - attribute - - - get_attribute_type - attribute - - - get_attribute_uint32 - attribute - - - get_attribute_uint64 - attribute - - - get_content_type - - - - get_display_name - - - - get_edit_name - - - - get_etag - - - - get_file_type - - - - get_icon - - - - get_is_backup - - - - get_is_hidden - - - - get_is_symlink - - - - get_modification_time - - - - get_name - - - - get_size - - - - get_sort_order - - - - get_symlink_target - - - - has_attribute - attribute - - - list_attributes - name_space - - - remove_attribute - attribute - - - set_attribute - attribute - type - value_p - - - set_attribute_boolean - attribute - attr_value - - - set_attribute_byte_string - attribute - attr_value - - - set_attribute_data - attribute - attr_value - - - set_attribute_int32 - attribute - attr_value - - - set_attribute_int64 - attribute - attr_value - - - set_attribute_mask - mask - - - set_attribute_object - attribute - attr_value - - - set_attribute_status - attribute - attr_value - - - set_attribute_string - attribute - attr_value - - - set_attribute_uint32 - attribute - - - set_attribute_uint64 - attribute - - - set_content_type - content_type - - - set_display_name - display_name - - - set_edit_name - edit_name - - - set_file_type - type - - - set_icon - icon - - - set_is_hidden - is_hidden - - - set_is_symlink - is_symlink - - - set_modification_time - mtime - - - set_name - name - - - set_size - size - - - set_sort_order - sort_order - - - set_symlink_tarset - symlink_target - - - unset_attribute_mask - - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.FileInfo - - - - - - Description - - - Functionality for manipulating basic metadata for files. - gio.FileInfo - implements methods for getting information that all files should contain, - and allows for manipulation of extended attributes. - - - See gio.FileAttribute - for more information on how GIO handles file attributes. - - - To obtain a gio.FileInfo - for a gio.File, use - gio.File.query_info() - (or its async variant). To obtain a - gio.FileInfo - for a file input or output stream, use - gio.FileInputStream.query_info() or - gio.FileOutputStream.query_info() - (or their async variants). - - - To change the actual attributes of a file, you should then set the attribute in the - gio.FileInfo and call - gio.File.set_attributes_from_info() or - gio.File.set_attributes_async() - on a gio.File. - - - However, not all attributes can be changed in the file. For instance, the - actual size of a file cannot be changed via - gio.FileInfo.set_size(). You may call - gio.File.query_settable_attributes() and - gio.File.query_writable_namespace() - to discover the settable attributes of a particular file at runtime. - - - gio.FileAttributeMatcher - allows for searching through a GFileInfo for attributes. - - - - - Constructor - - - gio.FileInfo - - - - - Returns : - a new - gio.FileInfo - - - - - - Creates a new gio.FileInfo - - - - - - Methods - Unfinished section, you may want to see the relevant C API docs for methods descriptions. - - diff --git a/docs/reference/pygio-fileinputstream.xml b/docs/reference/pygio-fileinputstream.xml deleted file mode 100644 index 723dc64..0000000 --- a/docs/reference/pygio-fileinputstream.xml +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - gio.FileInputStream - Base class for implementing streaming input - - - - Synopsis - - - gio.FileInputStream - gio.InputStream - - - query_info - attributes - cancellableNone - - - query_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - query_info_finish - result - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.FileInputStream - - - - - - Implemented Interfaces - - gio.FileInputStream - implements - gio.Seekable - - - - - Description - - - gio.FileInputStream - provides input streams that take their content from a file. - - - gio.FileInputStream - implements gio.Seekable, - which allows the input stream to jump to arbitrary positions in the file, provided the filesystem - of the file allows it. In addition to the generic g_seekable_ API, - gio.FileInputStream - has its own API for seeking and positioning. To find the position of a file input stream, use - gio.Seekable.tell(). - To find out if a file input stream supports seeking, use - gio.Seekable.can_seek(). - To position a file input stream, use - gio.Seekable.seek(). - - - - - Methods - - - gio.FileInputStream.query_info - - - query_info - attributes - cancellableNone - - - - - attributes : - a file attribute query string. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a gio.FileInfo, - or None on error. - - - - - - The query_info() method queries a file input stream - the given attributes. This function blocks while querying the stream. - For the asynchronous (non-blocking) version of this function, see - gio.FileInputStream.query_info_async(). - While the stream is blocked, the stream will set the pending flag internally, - and any other operations on the stream will fail with gio.ERROR_PENDING. - - - - - gio.FileInputStream.query_info_async - - - query_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - attributes : - a file attribute query string. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The query_info_async() method queries the stream - information asynchronously. When the operation is finished callback will be - called. You can then call - gio.FileInputStream.query_info_finish() - to get the result of the operation. - - - For the synchronous version of this function, see - gio.FileInputStream.query_info(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set - - - - - gio.FileInputStream.query_info_finish - - - query_info_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileInfo, - or None on error. - - - - - - The query_info_finish() method finishes an asynchronous - file append operation started with - gio.FileInputStream.query_info_async(). - - - - diff --git a/docs/reference/pygio-filemonitor.xml b/docs/reference/pygio-filemonitor.xml deleted file mode 100644 index ef9ca33..0000000 --- a/docs/reference/pygio-filemonitor.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - gio.FileMonitor - File Monitor - - - - Synopsis - - - gio.FileMonitor - gobject.GObject - - - cancel - - - - emit_event - child - other_file - event_type - - - is_cancelled - - - - set_rate_limit - limit_msecs - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.FileMonitor - - - - - - gio.FileMonitor Properties - -
- - - - - -
- - "cancelled" - Read - - Whether the monitor has been cancelled. Default value: False. - - - - "rate-limit" - Read/Write - - The limit of the monitor to watch for changes, in milliseconds. - Allowed values: >= 0. Default value: 800. - - - - - - - - - - - gio.FileMonitor Signal Prototypes - - gobject.GObject Signal Prototypes - - - - "changed" - - callback - filemonitor - file - other_file - event_type - user_param1 - ... - - - - - - - - - Description - - - The gio.FileMonitor - monitors a file or directory for changes. - - - To obtain a gio.FileMonitor - for a file or directory, use - gio.FileMonitor.monitor(), - gio.FileMonitor.monitor_file(), or - gio.FileMonitor.monitor_directory(). - - - To get informed about changes to the file or directory you are monitoring, - connect to the "changed" signal. - - - - - Methods - Unfinished section, you may want to see the relevant C API docs for methods descriptions. - - diff --git a/docs/reference/pygio-fileoutputstream.xml b/docs/reference/pygio-fileoutputstream.xml deleted file mode 100644 index f4367d7..0000000 --- a/docs/reference/pygio-fileoutputstream.xml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - gio.FileOutputStream - Base class for implementing streaming input - - - - Synopsis - - - gio.FileOutputStream - gio.OutputStream - - - get_etag - - - - query_info - attributes - cancellableNone - - - query_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - query_info_finish - result - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.FileOutputStream - - - - - - Implemented Interfaces - - gio.FileOutputStream - implements - gio.Seekable - - - - - Description - - - gio.FileOutputStream - provides output streams that write their content to a file. - - - gio.FileOutputStream - implements gio.Seekable, - which allows the output stream to jump to arbitrary positions in the file and to truncate - the file, provided the filesystem of the file supports these operations. In addition to the - generic gio.Seekable. API, - gio.FileOutputStream - has its own API for seeking and positioning. To find the position of a file output stream, use - gio.Seekable.tell(). - To find out if a file output stream supports seeking, use - gio.Seekable.can_seek(). - To position a file output stream, use - gio.Seekable.seek(). - To find out if a file output stream supports truncating, use - gio.FileOutputStream.can_truncate(). - To truncate a file output stream, use - gio.Seekable.truncate(). - - - - - Methods - - - gio.FileOutputStream.get_etag - - - get_etag - - - - - - Returns : - the entity tag for the stream. - - - - - - The get_etag() method gets the entity tag - for the file when it has been written. This must be called after the - stream has been written and closed, as the etag can change while writing. - - - - - gio.FileOutputStream.query_info - - - query_info - attributes - cancellableNone - - - - - attributes : - a file attribute query string. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a gio.FileInfo, - or None on error. - - - - - - The query_info() method queries a file input stream - the given attributes. This function blocks while querying the stream. - For the asynchronous (non-blocking) version of this function, see - gio.FileOutputStream.query_info_async(). - While the stream is blocked, the stream will set the pending flag internally, - and any other operations on the stream will fail with gio.ERROR_PENDING. - - - Can fail if the stream was already closed (with error being set to gio.ERROR_CLOSED), - the stream has pending operations (with error being set to gio.ERROR_PENDING), or - if querying info is not supported for the stream's interface (with error being set to - gio.ERROR_NOT_SUPPORTED). In all cases of failure, NULL will be returned. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be set, and None will be returned. - - - - - gio.FileOutputStream.query_info_async - - - query_info_async - attributes - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - attributes : - a file attribute query string. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The query_info_async() method queries the stream - information asynchronously. When the operation is finished callback will be - called. You can then call - gio.FileOutputStream.query_info_finish() - to get the result of the operation. - - - For the synchronous version of this function, see - gio.FileOutputStream.query_info(). - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was - cancelled, the error gio.ERROR_CANCELLED will be set - - - - - gio.FileOutputStream.query_info_finish - - - query_info_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - a gio.FileInfo, - or None on error. - - - - - - The query_info_finish() method finishes an asynchronous - file append operation started with - gio.FileOutputStream.query_info_async(). - - - - diff --git a/docs/reference/pygio-filterinputstream.xml b/docs/reference/pygio-filterinputstream.xml deleted file mode 100644 index e6fb90b..0000000 --- a/docs/reference/pygio-filterinputstream.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - gio.FilterInputStream - Filter Input Stream - - - - Synopsis - - - gio.FilterInputStream - gio.InputStream - - - get_base_stream - - - - get_close_base_stream - - - - set_close_base_stream - close_base - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.FilterInputStream - - - - - - gio.FilterInputStream Properties - -
- - - - - -
- - "base-stream" - Read - Write - Construct only - The underlying base stream on which the io ops will be done. - - - "close-base-stream" - Read - Write - Construct only - If the base stream should be closed when the filter stream is closed. - Default value: True. - - - - - - - - - - Description - - - Filter Input Stream. - - - - - Methods - - - gio.FilterInputStream.get_base_stream - - - get_base_stream - - - - - - Returns : - A - gio.InputStream - - - - - - The get_base_stream() method gets the base - stream for the filter stream. - - - - - gio.FilterInputStream.get_close_base_stream - - - get_close_base_stream - - - - - - Returns : - True if the base stream - will be closed. - - - - - - The get_close_base_stream() method returns - whether the base stream will be closed when stream is closed. - - - - - gio.FilterInputStream.set_close_base_stream - - - set_close_base_stream - close_base - - - - - close_base : - True to close the base stream. - - - - - - The set_close_base_stream() method sets whether - the base stream will be closed when stream is closed. - - - - diff --git a/docs/reference/pygio-filteroutputstream.xml b/docs/reference/pygio-filteroutputstream.xml deleted file mode 100644 index 78feaa2..0000000 --- a/docs/reference/pygio-filteroutputstream.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - gio.FilterOutputStream - Filter Output Stream - - - - Synopsis - - - gio.FilterOutputStream - gio.OutputStream - - - get_base_stream - - - - get_close_base_stream - - - - set_close_base_stream - close_base - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.FilterOutputStream - - - - - - gio.FilterOutputStream Properties - -
- - - - - -
- - "base-stream" - Read - Write - Construct only - The underlying base stream on which the io ops will be done. - - - "close-base-stream" - Read - Write - Construct only - If the base stream should be closed when the filter stream is closed. - Default value: True. - - - - - - - - - - Description - - - Filter Output Stream. - - - - - Methods - - - gio.FilterOutputStream.get_base_stream - - - get_base_stream - - - - - - Returns : - A - gio.OutputStream - - - - - - The get_base_stream() method gets the base - stream for the filter stream. - - - - - gio.FilterOutputStream.get_close_base_stream - - - get_close_base_stream - - - - - - Returns : - True if the base stream - will be closed. - - - - - - The get_close_base_stream() method returns - whether the base stream will be closed when stream is closed. - - - - - gio.FilterOutputStream.set_close_base_stream - - - set_close_base_stream - close_base - - - - - close_base : - True to close the base stream. - - - - - - The set_close_base_stream() method sets whether - the base stream will be closed when stream is closed. - - - - diff --git a/docs/reference/pygio-functions.xml b/docs/reference/pygio-functions.xml deleted file mode 100644 index c690a2f..0000000 --- a/docs/reference/pygio-functions.xml +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - gio Functions - - - - - Synopsis - - - gio.content_type_can_be_executable - type - - gio.content_type_equals - type1 - type2 - - gio.content_type_from_mime_type - mime_type - - gio.content_type_get_description - type - - gio.content_type_get_icon - type - - gio.content_type_get_mime_type - type - - gio.content_type_guess - filename - data - want_uncertain - - gio.content_type_is_a - type - supertype - - gio.content_type_is_unknown - type - - gio.content_types_get_registered - - - gio.io_error_from_errno - err_no - - - - - - Description - - - These functions are part of the PyGObject gio module - but are not directly associated with a specific class - - - - - Functions - - - gio.content_type_can_be_executable - - - content_type_can_be_executable - type - - - - - type : - a content type string. - - - - Returns : - True if the file type corresponds - to a type that can be executable, False otherwise. - - - - - - The content_type_can_be_executable() function checks - if a content type can be executable. Note that for instance things like text files - can be executables (i.e. scripts and batch files). - - - - - gio.content_type_equals - - - content_type_equals - type1 - type2 - - - - - type1 : - a content type string. - - - - type2 : - a content type string. - - - - Returns : - True if the two strings are - identical or equivalent, False otherwise. - - - - - - The content_type_equals() function compares - two content types for equality. - - - - - gio.content_type_from_mime_type - - - content_type_from_mime_type - mime_type - - - - - mime_type : - a mime type string. - - - - Returns : - The content type or None when does not know. - - - - - - The content_type_from_mime_type() function tries - to find a content type based on the mime type name. - - - - - gio.content_type_get_description - - - content_type_get_description - type - - - - - type : - a content type string. - - - - Returns : - a short description of the content type type. - - - - - - The content_type_get_description() function - gets the human readable description of the content type. - - - - - gio.content_type_get_icon - - - content_type_get_icon - type - - - - - type : - a content type string. - - - - Returns : - A gio.Icon - corresponding to the content type. - - - - - - The content_type_get_icon() function - gets the icon for a content type. - - - - - gio.content_type_get_mime_type - - - content_type_get_mime_type - type - - - - - type : - a content type string. - - - - Returns : - the registered mime-type for the given type, - or None if unknown. - - - - - - The content_type_get_mime_type() function - gets the mime-type for the content type. If one is registered - - - - - gio.content_type_guess - - - content_type_guess - filename - data - want_uncertain - - - - - filename : - a string, or None. - - - - data : - a stream of data, or None. - - - - want_uncertain : - a flag indicating the certainty of the result. - - - - Returns : - a string indicating a guessed content type for the given data. - - - - - - The content_type_guess() function guesses - the content type based on example data. If the function is uncertain, - result_uncertain will be set to True. Either filename - or data may be None, in which case the guess will be - based solely on the other argument. - - - - - gio.content_type_is_a - - - content_type_is_a - type - supertype - - - - - type : - a content type string. - - - - supertype : - a string. - - - - Returns : - True if type is a kind of - supertype, False otherwise. - - - - - - The content_type_is_a() function determines - if type is a subset of supertype. - - - - - gio.content_type_is_unknown - - - content_type_is_unknown - type - - - - - type : - a content type string. - - - - Returns : - True if the type is the unknown type. - - - - - - The content_type_is_unknown() function checks if - the content type is the generic "unknown" type. On unix this is the - "application/octet-stream" mimetype, while on win32 it is "*". - - - - - gio.content_types_get_registered - - - content_types_get_registered - - - - - - Returns : - a list of the registered content types. - - - - - - The content_types_get_registered() function - gets a list of strings containing all the registered content types - known to the system. - - - - - gio.io_error_from_errno - - - io_error_from_errno - err_no - - - - - err_no : - Error number. - - - - Returns : - a - - - - - - - The io_error_from_errno() function converts - error codes into GIO error codes. - - - - diff --git a/docs/reference/pygio-icon.xml b/docs/reference/pygio-icon.xml deleted file mode 100644 index 5a32d28..0000000 --- a/docs/reference/pygio-icon.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - gio.Icon - Interface for icons. - - - - Synopsis - - - gio.Icon - gobject.GInterface - - - equal - icon2 - - - to_string - - - - - - -Functions - - - gio.icon_new_from_string - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.Icon - - - - - - Known Derived Interfaces - - gio.Icon is required by - gio.LoadableIcon. - - - - - Known Implementation - - gio.Icon is implemented by - gio.ThemedIcon, - gio.FileIcon, - gio.Emblem, - gio.EmblemedIcon. - - - - - Description - - - gio.Icon - is a very minimal interface for icons. It provides functions for checking - the equality of two icons, hashing of icons and serializing an icon to and from strings. - - - gio.Icon - does not provide the actual pixmap for the icon as this is out of GIO's - scope, however implementations of - gio.Icon - may contain the name of an icon (see - gio.ThemedIcon), - or the path to an icon (see - gio.LoadableIcon). - - - - To check if two GIcons are equal, see - gio.Icon.equal(). - - - For serializing a gio.Icon, - use gio.Icon.to_string() and - gio.Icon.new_from_string(). - - - If your application or library provides one or more - gio.Icon - implementations you need to ensure that each GType is registered - with the type system prior to calling - gio.icon_new_from_string(). - - - - - Methods - - - gio.Icon.equal - - - equal - icon2 - - - - - icon2 : - the second - gio.Icon - - - - - - The equal() method checks if two icons are equal. - - - - - gio.Icon.to_string - - - to_string - - - - - - Returns : - An UTF8 string or None - if icon can't be serialized. - - - - - - The to_string() method generates a textual - representation of icon that can be used for serialization such as when - passing icon to a different process or saving it to persistent storage. Use - gio.icon_new_from_string() - to get icon back from the returned string. - - - The encoding of the returned string is proprietary to GIcon except in the following two cases - - - If icon is a gio.FileIcon, - the returned string is a native path (such as /path/to/my icon.png) without escaping - if the gio.File - for icon is a native file. If the file is not native, the returned string is the result of - gio.File.get_uri() - (such as sftp://path/to/my%20icon.png). - - - If icon is a gio.ThemedIcon - with exactly one name, the encoding is simply the name (such as network-server). - - - - - - Functions - - - gio.icon_new_from_string - - - icon_new_from_string - str - - - - - str : - A string obtained via - gio.Icon.to_string(). - - - - Returns : - An object implementing the - gio.Icon - interface or None if error is set. - - - - - - The icon_new_from_string() function generate a - gio.Icon - instance from str. This function can fail if str is not valid - see - gio.Icon.to_string() - for discussion. - - - If your application or library provides one or more GIcon implementations you need - to ensure that each GType is registered with the type system prior to calling - gio.icon_new_from_string(). - - - - diff --git a/docs/reference/pygio-inputstream.xml b/docs/reference/pygio-inputstream.xml deleted file mode 100644 index 1bef333..0000000 --- a/docs/reference/pygio-inputstream.xml +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - gio.InputStream - Base class for implementing streaming input - - - - Synopsis - - - gio.InputStream - gobject.GObject - - - clear_pending - - - - close - cancellableNone - - - close_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - close_finish - result - - - has_pending - - - - is_closed - - - - read - count-1 - cancellableNone - - - read_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - read_finish - result - - - read_part - count-1 - cancellableNone - - - set_pending - - - - skip - count - cancellableNone - - - skip_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - skip_finish - result - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - - - - - - Description - - - gio.InputStream - has functions to read from a stream ( - gio.InputStream.read() - ), to close a stream ( - gio.InputStream.close() - ) and to skip some content ( - gio.InputStream.skip() - ). - - - To copy the content of an input stream to an output stream without manually - handling the reads and writes, use - gio.OutputStream.splice(). - - - All of these functions have async variants too. - - - - - Methods - - - gio.InputStream.clear_pending - - - clear_pending - - - - - - - - The clear_pending() method clears the pending flag on stream. - - - - - gio.InputStream.close - - - close - cancellableNone - - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - True on success - False on failure. - - - - - - The close() method closes the stream, releasing - resources related to it. - - - Once the stream is closed, all other operations will return gio.ERROR_CLOSED. - Closing a stream multiple times will not return an error. - - - Streams will be automatically closed when the last reference is dropped, but - you might want to call this function to make sure resources are released as - early as possible. - - - Some streams might keep the backing store of the stream (e.g. a file descriptor) - open after the stream is closed. See the documentation for the individual - stream for details. - - - On failure the first error that happened will be reported, but the close operation - will finish as much as possible. A stream that failed to close will still return - gio.ERROR_CLOSED for all operations. Still, it is important to check and report - the error to the user. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. - - - - - gio.InputStream.close_async - - - close_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The close_async() method asynchronously requests an - asynchronous closes of the stream, releasing resources related to it. - - - For more details, see - gio.InputStream.close() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.InputStream.close_finish() - to get the result of the operation. - - - - - gio.InputStream.close_finish - - - close_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the stream was closed successfully. - - - - - - The close_finish() method finishes an asynchronous - file append operation started with - gio.InputStream.close_async(). - - - - - gio.InputStream.has_pending - - - has_pending - - - - - - Returns : - True if stream has pending actions. - - - - - - The has_pending() method checks if an input stream has pending actions. - - - - - gio.InputStream.is_closed - - - is_closed - - - - - - Returns : - True if the stream is closed. - - - - - - The is_closed() method checks if an input stream is closed. - - - - - gio.InputStream.read - - - read - count-1 - cancellableNone - - - - - count : - optionally the number of bytes that will be read from the stream. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - The number of bytes read, or -1 on error. - - - - - - The read() method tries to read count bytes from - the stream into the buffer starting at buffer. Will block during this read. - - - This function is similar to - gio.InputStream.read_part(), - except it tries to read as many bytes as requested, only stopping on an error or end of stream. - - - On a successful read of count bytes, or if we reached the end of the stream, - True is returned, and bytes_read is set to the number of bytes read into buffer. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. - - - If there is an error during the operation False is returned and error - is set to indicate the error status, bytes_read is updated to contain the number of - bytes read into buffer before the error occurred. - - - - - gio.InputStream.read_async - - - read_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - count : - the number of bytes that will be read from the stream. - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The read_async() method requests an asynchronous read - of count bytes from the stream into the buffer. - - - For more details, see - gio.InputStream.read() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.InputStream.read_finish() - to get the result of the operation. - - - During an async request no other sync and async calls are allowed, and - will result in gio.ERROR_PENDING errors. - - - A value of count larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. - - - On success, the number of bytes read into the buffer will be passed to the callback. - It is not an error if this is not the same as the requested size, as it can happen e.g. - near the end of a file, but generally we try to read as many bytes as requested. Zero - is returned on end of file (or if count is zero), but never otherwise. - - - Any outstanding i/o request with higher priority (lower numerical value) will be - executed before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. - - - The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so - they are optional for inheriting classes. However, if you override one you must override all. - - - - - gio.InputStream.read_finish - - - read_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - The number of bytes read in, or -1 on error. - - - - - - The read_finish() method finishes an asynchronous - stream read operation started by - gio.InputStream.read_async(). - - - - - gio.InputStream.read_part - - - read_part - count-1 - cancellableNone - - - - - count : - optionally the number of bytes that will be read from the stream. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - The number of bytes read, or -1 on error. - - - - - - The read_part() method tries to read count bytes from - the stream into the buffer starting at buffer. Will block during this read. - - - If count is zero returns zero and does nothing. A value of count larger than - G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. - - - On success, the number of bytes read into the buffer is returned. It is - not an error if this is not the same as the requested size, as it can - happen e.g. near the end of a file. Zero is returned on end of file - (or if count is zero), but never otherwise. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. - - - On error -1 is returned and error is set accordingly. - - - This method roughly corresponds to C GIO g_input_stream_read. - - - - - gio.InputStream.set_pending - - - set_pending - - - - - - Returns : - True if pending was previously - unset and is now set. - - - - - - The set_pending() method sets stream to have actions pending. - If the pending flag is already set or stream is closed, - it will return False and set error. - - - - - gio.InputStream.skip - - - skip - count - cancellableNone - - - - - count : - the number of bytes that will be skipped from the stream. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - The number of bytes skipped, or -1 on error - - - - - - The skip() method tries to skip count bytes - from the stream. Will block during the operation. - - - This is identical to - read(), - from a behaviour standpoint, but the bytes that are skipped are not - returned to the user. Some streams have an implementation that is more - efficient than reading the data. - - - This function is optional for inherited classes, as the default implementation emulates it using read. - - - If cancellable is not None, then the operation can be cancelled by - triggering the cancellable object from another thskip. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. Cancelling a close will still leave - the stream closed, but some streams can use a faster close that doesn't block to e.g. - check errors. - - - - - gio.InputStream.skip_async - - - skip_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - - - count : - the number of bytes that will be skipped from the stream. - - - - callback : - a GAsyncskipyCallback to call when the request is satisfied. - - - - io_priority : - the - - of the request. - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - user_data : - the data to pass to callback function. - - - - - - The skip_async() method request an asynchronous - skip of count bytes from the stream. - - - For more details, see - gio.InputStream.skip() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.InputStream.skip_finish() - to get the result of the operation. - - - During an async request no other sync and async calls are allowed, and - will result in gio.ERROR_PENDING errors. - - - A value of count larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. - - - On success, the number of bytes skipped will be passed to the callback. It is - not an error if this is not the same as the requested size, as it can happen - e.g. near the end of a file, but generally we try to skip as many bytes as requested. - Zero is returned on end of file (or if count is zero), but never otherwise. - - - Any outstanding i/o request with higher priority (lower numerical value) will be - executed before an outstanding request with lower priority. Default priority is glib.PRIORITY_DEFAULT. - - - The asyncronous methods have a default fallback that uses thskips to implement asynchronicity, so - they are optional for inheriting classes. However, if you override one you must override all. - - - - - gio.InputStream.skip_finish - - - skip_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - The number of bytes skipped in, or -1 on error. - - - - - - The skip_finish() method finishes an asynchronous - stream skip operation started by - gio.InputStream.skip_async(). - - - - diff --git a/docs/reference/pygio-loadableicon.xml b/docs/reference/pygio-loadableicon.xml deleted file mode 100644 index 93198c4..0000000 --- a/docs/reference/pygio-loadableicon.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - gio.LoadableIcon - Interface for icons. - - - - Synopsis - - - gio.LoadableIcon - gobject.GInterface - - - load - size0 - cancellableNone - - - load_async - callback - size0 - cancellableNone - user_dataNone - - - load_finish - res - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.LoadableIcon - - - - - - Prerequisites - - gio.LoadableIcon requires - gio.Icon. and - gobject.GObject - - - - - Known Implementation - - gio.LoadableIcon is implemented by - gio.FileIcon - - - - - Description - - - gio.LoadableIcon - extends the gio.Icon - interface and adds the ability to load icons from streams. - - - - - Methods - - - gio.LoadableIcon.load - - - load - size0 - cancellableNone - - - - - size : - an integer - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - Returns : - a 2 tuple containing a - gio.InputStream - to read the icon from and a string containing the icon type. - - - - - - The load() method loads a loadable icon. - For the asynchronous version of this function, see - gio.LoadableIcon.load_async(). - - - - - gio.LoadableIcon.load_async - - - load_async - callback - size0 - cancellableNone - user_dataNone - - - - - callback : - a GAsyncReadyCallback to call when the request is satisfied. - - - - size : - an integer - - - - cancellable : - optional - gio.Cancellable - object, None to ignore. - - - - user_data : - the data to pass to callback function. - - - - - - The load_async() method loads an icon asynchronously. - - - For more details, see - gio.LoadableIcon.load() - which is the synchronous version of this call. - - - When the operation is finished, callback will be called. You can then call - gio.LoadableIcon.load_finish() - to get the result of the operation. - - - - - gio.LoadableIcon.load_finish - - - load_finish - res - - - - - res : - a - gio.AsyncResult. - - - - Returns : - a 2 tuple containing a - gio.InputStream - to read the icon from and a string containing the icon type. - - - - - - The load_finish() method finishes an asynchronous - icon load started in - gio.LoadableIcon.load_async(). - - - - diff --git a/docs/reference/pygio-memoryinputstream.xml b/docs/reference/pygio-memoryinputstream.xml deleted file mode 100644 index 7d8cffb..0000000 --- a/docs/reference/pygio-memoryinputstream.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - gio.MemoryInputStream - Base class for implementing streaming input - - - - Synopsis - - - gio.MemoryInputStream - gio.InputStream - - - gio.MemoryInputStream - - - - - - add_data - data - - - - - -Functions - - - gio.memory_input_stream_new_from_data - data - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.MemoryInputStream - - - - - - Implemented Interfaces - - gio.MemoryInputStream - implements - gio.Seekable - - - - - Description - - - gio.MemoryInputStream - is a class for using arbitrary memory chunks as input for GIO streaming input operations. - - - - - Constructor - - - gio.MemoryInputStream - icon - - - - Returns : - a new - gio.MemoryInputStream. - - - - - - Creates an empty - gio.MemoryInputStream. - - - - - - Methods - - - gio.MemoryInputStream.add_data - - - add_data - data - - - - - data : - input data. - - - - - - The add_data() method appends data to data - that can be read from the input stream - - - - - - Functions - - - gio.memory_input_stream_new_from_data - - - memory_input_stream_new_from_data - data - - - - - data : - input data. - - - - Returns : - A new - gio.MemoryInputStream - read from data - - - - - - The memory_input_stream_new_from_data() function creates - a new gio.MemoryInputStream - with data in memory. - - - - diff --git a/docs/reference/pygio-memoryoutputstream.xml b/docs/reference/pygio-memoryoutputstream.xml deleted file mode 100644 index f044496..0000000 --- a/docs/reference/pygio-memoryoutputstream.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - gio.MemoryOutputStream - Streaming output operations on memory chunks - - - - Synopsis - - - gio.MemoryOutputStream - gio.OutputStream - - - gio.MemoryOutputStream - - - - - - get_contents - - - - get_data_size - - - - get_size - - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.MemoryOutputStream - - - - - - Implemented Interfaces - - gio.MemoryOutputStream - implements - gio.Seekable - - - - - Description - - - gio.MemoryOutputStream - is a class for using arbitrary memory chunks as output for GIO streaming output operations. - - - - - Constructor - - - gio.MemoryOutputStream - - - - - Returns : - a new - gio.MemoryOutputStream. - - - - - - Creates a new - gio.MemoryOutputStream. - - - - - - Methods - - - gio.MemoryOutputStream.get_contents - - - get_contents - - - - - - Returns : - the stream's data - - - - - - The get_contents() method gets any loaded data - from the ostream. - - - Note that the returned data may become invalid on the next write or truncate - operation on the stream. - - - - - gio.MemoryOutputStream.get_data_size - - - get_data_size - - - - - - Returns : - the number of bytes written to the stream - - - - - - The get_data_size() method returns the number - of bytes from the start up to including the last byte written in the - stream that has not been truncated away. - - - - - gio.MemoryOutputStream.get_size - - - get_size - - - - - - Returns : - the number of bytes allocated for the data buffer - - - - - - The get_size() method gets the size of the - currently allocated data area (availible from - gio.MemoryOutputStream.get_contents() - ). - - - Note that for growable streams the returned size may become invalid on the next write or truncate operation on the stream. - - - If you want the number of bytes currently written to the stream, use - gio.MemoryOutputStream.get_data_size(). - - - - diff --git a/docs/reference/pygio-mount.xml b/docs/reference/pygio-mount.xml deleted file mode 100644 index f01b155..0000000 --- a/docs/reference/pygio-mount.xml +++ /dev/null @@ -1,962 +0,0 @@ - - - - - - gio.Mount - Mount management - - - - Synopsis - - - gio.Mount - gobject.GInterface - - - can_eject - - - can_unmount - - - - eject - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - eject_finish - result - - - get_drive - - - - get_icon - - - - get_name - - - - get_root - - - - get_uuid - - - - get_volume - - - - guess_content_type - callback - force_rescan - cancellableNone - user_dataNone - - - guess_content_type_finish - result - - - guess_content_type_sync - force_rescan - cancellableNone - - - is_shadowed - - - - remount - callback - flagsgio.MOUNT_UNMOUNT_NONE - mount_operationNone - cancellableNone - user_dataNone - - - remount_finish - result - - - shadow - - - - unmount - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - unmount_finish - result - - - unshadow - - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.Mount - - - - - - Prerequisites - - gio.Mount requires - gobject.GObject - - - - - gio.Mount Signal Prototypes - - gobject.GObject Signal Prototypes - - - - "aborted" - - callback - mount - user_param1 - ... - - - - - "changed" - - callback - mount - user_param1 - ... - - - - - "unmounted" - - callback - mount - user_param1 - ... - - - - - - - - - Description - - - The gio.Mount - interface represents user-visible mounts. Note, when porting from GnomeVFS, - gio.Mount - is the moral equivalent of GnomeVFSVolume. - - - - gio.Mount - is a "mounted" filesystem that you can access. Mounted is in quotes because - it's not the same as a unix mount, it might be a gvfs mount, but you can still - access the files on it if you use GIO. Might or might not be related to a volume object. - - - Unmounting a GMount instance is an asynchronous operation. For more information - about asynchronous operations, see GAsyncReady and GSimpleAsyncReady. To unmount - a gio.Mount instance, - first call - g_mount_unmount() - with (at least) the GMount instance and a GAsyncReadyCallback. The callback will - be fired when the operation has resolved (either with success or failure), and a - GAsyncReady structure will be passed to the callback. That callback should then call - g_mount_unmount_finish() - with the GMount and the GAsyncReady data to see if the operation was completed successfully. - If an error is present when g_mount_unmount_finish() is called, then it will be filled - with any error information. - - - - - Methods - - - gio.Mount.can_eject - - - can_eject - - - - - - Returns : - True if the mount can be ejected, - False otherwise. - - - - - - The can_eject() method checks if a mount can be ejected. - - - - - gio.Mount.can_unmount - - - can_unmount - - - - - - Returns : - True if the mount can be unmounted, - False otherwise. - - - - - - The can_eject() method checks if a mount can be unmounted. - - - - - gio.Mount.eject - - - eject - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - flags affecting the unmount if required for eject - . - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The eject() method asynchronously ejects a mount. - - - When the operation is finished, callback will be called. You can then call - gio.Mount.eject_finish() - to obtain the result of the operation. - - - - - gio.Mount.eject_finish - - - eject_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the mount has been ejected - successfully, False otherwise. - - - - - - The eject_finish() method finishes ejecting a mount. - - - - - gio.Mount.get_drive - - - get_drive - - - - - - Returns : - gio.Drive - or None if mount is not associated with a volume or a drive. - - - - - - The get_drive() method gets the drive for the mount. - - - This is a convenience method for getting the - gio.Volume - and then using that object to get the - gio.Drive. - - - - - gio.Mount.get_icon - - - get_icon - - - - - - Returns : - gio.Icon - for the mount. - - - - - - The get_icon() method gets the icon for mount. - - - - - gio.Mount.get_name - - - get_name - - - - - - Returns : - the name for the given mount. - - - - - - The get_name() method gets the name of mount. - - - - - gio.Mount.get_root - - - get_root - - - - - - Returns : - a gio.File. - - - - - - The get_root() method gets the root directory on mount. - - - - - gio.Mount.get_uuid - - - get_uuid - - - - - - Returns : - the UUID for mount or None - if no UUID can be computed. - - - - - - The get_uuid() method gets the UUID for the mount. - The reference is typically based on the file system UUID for the mount in - question and should be considered an opaque string. Returns None - if there is no UUID available - - - - - gio.Mount.get_volume - - - get_volume - - - - - - Returns : - a gio.Volume - or None if mount is not associated with a volume. - - - - - - The get_volume() method gets the volume for the mount. - - - - - gio.Mount.guess_content_type - - - guess_content_type - callback - force_rescan - cancellableNone - user_dataNone - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - force_rescan : - Whether to force a rescan of the content. Otherwise a cached result will be used if available. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The guess_content_type() method asynchronously tries to guess the type of - content stored on mount. Returns one or more textual identifiers of well-known content - types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory - cards. See the shared-mime-info specification for more on x-content types. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - When the operation is finished, callback will be called. You can then call - gio.Mount.guess_content_type_finish() - to obtain the result of the operation. - - - - - gio.Mount.guess_content_type_finish - - - guess_content_type_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - A list of types or None on error. - - - - - - - The guess_content_type_finish() method finishes guessing content - types of mount. If any errors occured during the operation, error will be set to - contain the errors and False will be returned. In particular, you may get an - gio.ERROR_NOT_SUPPORTED if the mount does not support content guessing. - - - - - gio.Mount.guess_content_type_sync - - - guess_content_type_sync - force_rescan - cancellableNone - - - - - force_rescan : - Whether to force a rescan of the content. Otherwise a cached result will be used if available. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - - - The guess_content_type_sync() method tries to guess - the type of content stored on mount. Returns one or more textual identifiers - of well-known content types (typically prefixed with "x-content/"), e.g. - x-content/image-dcf for camera memory cards. See the shared-mime-info specification - for more on x-content types. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - This is an synchronous operation and as such may block doing IO; see - gio.Mount.guess_content_type() - for the asynchronous version. - - - - - gio.Mount.is_shadowed - - - is_shadowed - - - - - - Returns : - True if mount is shadowed. - - - - - - The is_shadowed() method determines if mount - is shadowed. Applications or libraries should avoid displaying mount - in the user interface if it is shadowed. - - - A mount is said to be shadowed if there exists one or more user visible - objects (currently - gio.Mount - objects) with a root that is inside the root of mount. - - - One application of shadow mounts is when exposing a single file system - that is used to address several logical volumes. In this situation, a - gio.VolumeMonitor - implementation would create two - gio.Volume - objects (for example, one for the camera functionality of the device - and one for a SD card reader on the device) with activation URIs - gphoto2://[usb:001,002]/store1/ and gphoto2://[usb:001,002]/store2/. - When the underlying mount (with root gphoto2://[usb:001,002]/) is - mounted, said - gio.VolumeMonitor - implementation would create two - gio.Mount - objects (each with their root matching the corresponding volume - activation root) that would shadow the original mount. - - - The proxy monitor in GVfs 2.26 and later, automatically creates and - manage shadow mounts (and shadows the underlying mount) if the activation - root on a gio.Volume - is set. - - - - - gio.Mount.remount - - - remount - callback - flagsgio.MOUNT_UNMOUNT_NONE - mount_operationNone - cancellableNone - user_dataNone - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - flags affecting the unmount if required for eject - . - - - - mount_operation : - a gio.MountOperation - or None to avoid user interaction. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The remount() method asynchronously remounts a mount. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - When the operation is finished, callback will be called. You can then call - gio.Mount.remount_finish() - to obtain the result of the operation. - - - - - gio.Mount.remount_finish - - - remount_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the mount has been remounted - successfully, False otherwise. - - - - - - The remount_finish() method finishes remounting a mount. - - - - - gio.Mount.shadow - - - shadow - - - - - - - - The shadow() method increments the shadow - count on mount. Usually used by - gio.VolumeMonitor - implementations when creating a shadow mount for mount, see - gio.Mount.is_shadowed() - for more information. The caller will need to emit the "changed" - signal on mount manually. - - - - - - gio.Mount.unmount - - - unmount - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - flags affecting the unmount if required for eject - . - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The unmount() method asynchronously unmounts a mount. - - - If cancellable is not None, then the operation can be cancelled - by triggering the cancellable object from another thread. If the operation was cancelled, - the error gio.ERROR_CANCELLED will be returned. - - - When the operation is finished, callback will be called. You can then call - gio.Mount.unmount_finish() - to obtain the result of the operation. - - - - - gio.Mount.unmount_finish - - - unmount_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the mount has been unmounted - successfully, False otherwise. - - - - - - The unmount_finish() method finishes unmounting a mount. - - - - - gio.Mount.unshadow - - - unshadow - - - - - - - - The unshadow() method decrements the shadow - count on mount. Usually used by - gio.VolumeMonitor - implementations when destroying a shadow mount for mount, see - gio.Mount.is_shadowed() - for more information. The caller will need to emit the "changed" - signal on mount manually. - - - - - - - Signals - - - The "aborted" gio.Mount Signal - - callback - mount - user_param1 - ... - - - - - mount : - the mount - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted by the backend when e.g. a device becomes unavailable while a - mount operation is in progress. - - - Implementations of gio.MountOperation - should handle this signal by dismissing open password dialogs. - - - - The "changed" gio.Mount Signal - - callback - mount - user_param1 - ... - - - - - mount : - the mount - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when the mount has been changed. - - - - - The "unmounted" gio.Mount Signal - - callback - mount - user_param1 - ... - - - - - mount : - the mount - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - This signal is emitted when the - gio.Mount - have been unmounted. - - - - - diff --git a/docs/reference/pygio-mountoperation.xml b/docs/reference/pygio-mountoperation.xml deleted file mode 100644 index 34dec13..0000000 --- a/docs/reference/pygio-mountoperation.xml +++ /dev/null @@ -1,726 +0,0 @@ - - - - - - gio.MountOperation - Authentication methods for mountable locations. - - - - Synopsis - - - gio.MountOperation - gobject.GObject - - - gio.MountOperation - - - - - get_anonymous - - - - get_choice - - - - get_domain - - - - get_password - - - - get_password_save - - - - get_username - - - - replay - result - - - set_anonymous - anonymous - - - set_choice - choice - - - set_domain - domain - - - set_password - password - - - set_password_save - save - - - set_username - username - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.MountOperation - - - - - - gio.MountOperation Properties - -
- - - - - -
- - "anonymous" - Read/Write - - Whether to use an anonymous user when authenticating. - Default value: False - - - - "choice" - Read/Write - - The index of the user's choice when a question is asked during - the mount operation. See the "ask-question" signal. - Allowed values: >= 0 Default value: 0 - - - - "domain" - Read/Write - - The domain to use for the mount operation. Default value: None - - - - "password" - Read/Write - - The password that is used for authentication when carrying out the - mount operation. Default value: None - - - - "password-save" - Read/Write - - Determines if and how the password information should be saved. - Default value: gio.PASSWORD_SAVE_NEVER - - - - "username" - Read/Write - - The user name that is used for authentication when carrying out the - mount operation. Default value: None - - - - - - - - - - - gio.MountOperation Signal Prototypes - - gobject.GObject Signal Prototypes - - - - "aborted" - - callback - mountoperation - user_param1 - ... - - - - - "ask-password" - - callback - mountoperation - message - default_user - default_domain - flags - user_param1 - ... - - - - - "ask-question" - - callback - mountoperation - message - choices - user_param1 - ... - - - - - "reply" - - callback - mountoperation - result - user_param1 - ... - - - - - - - - - Description - - - The gio.MountOperation - provides a mechanism for authenticating mountable operations, such as loop mounting files, - hard drive partitions or server locations. - - - Mounting operations are handed a - gio.MountOperation - that then can use if they require any privileges or authentication for their volumes to be - mounted (e.g. a hard disk partition or an encrypted filesystem), or if they are implementing - a remote server protocol which requires user credentials such as FTP or WebDAV. - - - Users should instantiate a subclass of this that implements all the various callbacks - to show the required dialogs, such as - gtk.MountOperation. - - - - - Constructor - - - gio.MountOperation - - - - - Returns : - a new - gio.MountOperation. - - - - - - Creates a new mount operation. - - - - - - Methods - - - gio.MountOperation.get_anonymous - - - get_anonymous - - - - - - Returns : - True if mount operation is anonymous. - - - - - - The get_anonymous() method check to see whether - the mount operation is being used for an anonymous user - - - - - gio.MountOperation.get_choice - - - get_choice - - - - - - Returns : - an integer containing an index of the user's - choice from the choice's list, or 0. - - - - - - The get_anonymous() method gets a choice - from the mount operation. - - - - - gio.MountOperation.get_domain - - - get_domain - - - - - - Returns : - a string set to the domain. - - - - - - The get_domain() method gets the domain - of the mount operation. - - - - - gio.MountOperation.get_password - - - get_password - - - - - - Returns : - a string containing the password within - the mountoperation. - - - - - - The get_password() method gets a password - from the mount operation. - - - - - gio.MountOperation.get_password_save - - - get_password_save - - - - - - Returns : - a - - flag. - - - - - - The get_password_save() method gets the state - of saving passwords for the mount operation. - - - - - gio.MountOperation.get_username - - - get_username - - - - - - Returns : - a string containing the user name. - - - - - - The get_username() method get the user - name from the mount operation. - - - - - gio.MountOperation.reply - - - reply - result - - - - - result : - a - - - - - - - The reply() method emits the "reply" signal. - - - - - gio.MountOperation.set_anonymous - - - set_anonymous - anonymous - - - - - anonymous : - boolean value. - - - - - - The set_anonymous() method sets the mount operation - to use an anonymous user if anonymous is True. - - - - - gio.MountOperation.set_choice - - - set_choice - choice - - - - - choice : - an integer. - - - - - - The set_choice() method sets a default choice for the mount operation. - - - - - gio.MountOperation.set_domain - - - set_domain - domain - - - - - domain : - the domain to set. - - - - - - The set_domain() method sets the mount operation's domain. - - - - - gio.MountOperation.set_password - - - set_password - password - - - - - password : - password to set. - - - - - - The set_password() method sets the mount - operation's password to password. - - - - - gio.MountOperation.set_password_save - - - set_password_save - save - - - - - save : - a set of - - - - - - - The set_password_save() method sets the state - of saving passwords for the mount operation. - - - - - gio.MountOperation.set_username - - - set_username - username - - - - - username : - input username. - - - - - - The set_anonymous() method sets the user - name within op to username. - - - - - - Signals - - - The "aborted" gio.MountOperation Signal - - callback - mountoperation - user_param1 - ... - - - - - mountoperation : - the mountoperation - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress. - Implementations of gio.MountOperation - should handle this signal by dismissing open password dialogs. - - - - - The "ask-password" gio.MountOperation Signal - - callback - mountoperation - message - default_user - default_domain - flags - user_param1 - ... - - - - - mountoperation : - the mountoperation - - - message : - string containing a message to display to the user. - - - default_user : - string containing the default user name. - - - default_domain : - string containing the default domain. - - - flags : - a set of - - - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - This signal is emitted when a mount operation asks the user for a password. - If the message contains a line break, the first line should be presented as a heading. - For example, it may be used as the primary text in a - gtk.MessageDialog. - - - - - The "ask-question" gio.MountOperation Signal - - callback - mountoperation - message - choices - user_param1 - ... - - - - - mountoperation : - the mountoperation - - - message : - string containing a message to display to the user. - - - choices : - a list of strings for each possible choice. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - This signal is emitted when asking the user a question and gives a list of choices - for the user to choose from. If the message contains a line break, the first line should be - presented as a heading. For example, it may be used as the primary text in a - gtk.MessageDialog. - - - - - The "reply" gio.MountOperation Signal - - callback - mountoperation - result - user_param1 - ... - - - - - mountoperation : - the mountoperation - - - result : - a - - indicating how the request was handled - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - This signal is emitted when the user has replied to the mount operation. - - - - - diff --git a/docs/reference/pygio-outputstream.xml b/docs/reference/pygio-outputstream.xml deleted file mode 100644 index 00ddf2e..0000000 --- a/docs/reference/pygio-outputstream.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - gio.OutputStream - Base class for implementing streaming input - - - - Synopsis - - - gio.OutputStream - gobject.GObject - - - clear_pending - - - - close - cancellableNone - - - close_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - close_finish - result - - - flush - cancellableNone - - - flush_async - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - flush_finish - result - - - has_pending - - - - is_closed - - - - set_pending - - - - splice - cancellableNone - flagsgio.OUTPUT_STREAM_SPLICE_NONE - - - splice_async - source - callback - flagsgio.OUTPUT_STREAM_SPLICE_NONE - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - splice_finish - result - - - write - buffer - cancellableNone - - - write_async - buffer - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - write_finish - result - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - - - - - - Description - - - gio.OutputStream - has functions to write from a stream ( - gio.OutputStream.write() - ), to close a stream ( - gio.OutputStream.close() - ) and to flush pending writes ( - gio.OutputStream.flush() - ). - - - To copy the content of an input stream to an output stream without manually - handling the reads and writes, use - gio.OutputStream.splice(). - - - All of these functions have async variants too. - - - - - Methods - Unfinished section, you may want to see the relevant C API docs for methods descriptions. - - diff --git a/docs/reference/pygio-seekable.xml b/docs/reference/pygio-seekable.xml deleted file mode 100644 index 1081143..0000000 --- a/docs/reference/pygio-seekable.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - gio.Seekable - Stream seeking interface. - - - - Synopsis - - - gio.Seekable - gobject.GInterface - - - tell - - - - can_seek - - - - seek - offset - type0 - cancellableNone - - - - can_truncate - - - - truncate - offset - cancellableNone - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.Seekable - - - - - - Known Implementation - - gio.Seekable is implemented by - gio.FileOutputStream, - gio.MemoryInputStream, - gio.FileInputStream and - gio.MemoryOutputStream. - - - - - Description - - - gio.Seekable - is implemented by streams (implementations of - gio.InputStream or - gio.OutputStream) - that support seeking. - - - - - Methods - - - gio.Seekable.tell - - - tell - - - - - Returns : - - the offset from the beginning of the buffer - - - - - - Tells the current position within the stream. - - - - - gio.Seekable.can_seek - - - can_seek - - - - - Returns : - True if this - gio.Seekable can be seeked with - the seek() method, False - if not. - - - - - The can_seek() method checks if the - seek() - can be used on this gio.Seekable. - - - - gio.Seekable.seek - - - seek - offset - type0 - cancellableNone - - - - - offset : - the offset that is added to the position determined by the type parameter. - - - - type : - 0=current position, 1=start of the file, 2=end of the file. - - - cancellable : - a gio.Cancellable - or None. - - - Returns : - True on successful seek, - False otherwise. - - - - - - Seeks in the stream by the given offset, modified by type. - - - If cancellable is not None, then the - operation can be cancelled by triggering the cancellable object from another thread. - - - - gio.Seekable.can_truncate - - - can_truncate - - - - - Returns : - True if this - gio.Seekable can be truncated with - the truncate() method, False - if not. - - - - - The can_truncate() method checks if the - truncate() - can be used on this gio.Seekable. - - - - gio.Seekable.truncate - - - truncate - offset - cancellableNone - - - - - offset : - the offset at which the stream should be truncated - - - - cancellable : - a gio.Cancellable - or None. - - - Returns : - True if successful, - False otherwise. - - - - - - Truncates a stream with a given offset. - - - If cancellable is not None, then the - operation can be cancelled by triggering the cancellable object from another thread. - - - If an operation was partially finished when the operation was cancelled the - partial result will be returned, without an error. - - - - diff --git a/docs/reference/pygio-simpleasyncresult.xml b/docs/reference/pygio-simpleasyncresult.xml deleted file mode 100644 index f6a0787..0000000 --- a/docs/reference/pygio-simpleasyncresult.xml +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - gio.SimpleAsyncResult - Simple asynchronous results implementation. - - - - Synopsis - - - gio.SimpleAsyncResult - gobject.GObject - - - complete - - - - complete_in_idle - - - - get_op_res_gboolean - - - - get_op_res_gssize - - - - propagate_error - - - - set_handle_cancellation - handle_cancellation - - - set_op_res_gboolean - op_res - - - set_op_res_gssize - op_res - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.SimpleAsyncResult - - - - - - Implemented Interface - - gio.SimpleAsyncResult implements - gio.AsyncResult. - - - - - Description - - - Implements gio.AsyncResult - for simple cases. Most of the time, this will be all an application needs, and will be used transparently - Because of this, GSimpleAsyncResult is used throughout GIO for handling asynchronous functions. - - - gio.SimpleAsyncResult - handles GAsyncReadyCallbacks, error reporting, operation cancellation and the final state of an - operation, completely transparent to the application. Results can be returned as a pointer e.g. - for functions that return data that is collected asynchronously, a boolean value for checking the - success or failure of an operation, or a gssize for operations which return the number of bytes modified - by the operation; all of the simple return cases are covered. - - - Most of the time, an application will not need to know of the details of this API; it is handled - transparently, and any necessary operations are handled by GAsyncResult's interface. However, if - implementing a new GIO module, for writing language bindings, or for complex applications that need - better control of how asynchronous operations are completed, it is important to understand this functionality. - - - gio.SimpleAsyncResult - are tagged with the calling function to ensure that asynchronous functions and - their finishing functions are used together correctly. - - - - An asynchronous operation can be made to ignore a cancellation event by calling - gio.SimpleAsyncResult.set_handle_cancellation() - with a - gio.AsyncResult - for the operation and False. This is useful for operations that are dangerous to cancel, - such as close (which would cause a leak if cancelled before being run). - - - gio.AsyncResult - can integrate into GLib's event loop, GMainLoop, or it can use GThreads if available. - gio.SimpleAsyncResult.complete() - will finish an I/O task directly within the main event loop. - gio.SimpleAsyncResult.complete_in_idle() - will integrate the I/O task into the main event loop as an idle function. - - - - To set the results of an asynchronous function, - gio.SimpleAsyncResult.set_op_res_gboolean(), and - gio.SimpleAsyncResult.set_op_res_gssize() - are provided, setting the operation's result to a gboolean, or gssize, respectively. - - - Likewise, to get the result of an asynchronous function, - gio.SimpleAsyncResult.get_op_res_gboolean() and - gio.SimpleAsyncResult.get_op_res_gssize() - are provided, getting the operation's result as a gboolean and gssize, respectively. - - - - - Methods - - - gio.SimpleAsyncResult.complete - - - complete - - - - - - - - The complete() method completes an asynchronous I/O job. - Must be called in the main thread, as it invokes the callback that should be called - in the main thread. If you are in a different thread use - gio.SimpleAsyncResult.complete_in_idle(). - - - - - gio.SimpleAsyncResult.complete_in_idle - - - complete_in_idle - - - - - - - - The complete_in_idle() method completes an asynchronous - function in the main event loop using an idle function. - - - - - gio.SimpleAsyncResult.get_op_res_gboolean - - - get_op_res_gboolean - - - - - - Returns : - True if the operation's result was - True, False if the operation's result - was False. - - - - - - The get_op_res_gboolean() method gets the operation - result boolean from within the asynchronous result. - - - - - gio.SimpleAsyncResult.get_op_res_gssize - - - get_op_res_gssize - - - - - - Returns : - a gssize returned from the asynchronous function. - - - - - - The get_op_res_gssize() method gets a gssize - from the asynchronous result. - - - - - gio.SimpleAsyncResult.propagate_error - - - propagate_error - - - - - - Returns : - True if the error was propegated - to dest. False otherwise. - - - - - - The propagate_error() method propagates an error - from within the simple asynchronous result to a given destination. - - - - - gio.SimpleAsyncResult.set_handle_cancellation - - - set_handle_cancellation - handle_cancellation - - - - - handle_cancellation : - a boolean. - - - - - - The set_handle_cancellation() method sets whether - to handle cancellation within the asynchronous operation. - - - - - gio.SimpleAsyncResult.set_op_res_gboolean - - - set_op_res_gboolean - op_res - - - - - op_res : - a boolean. - - - - - - The set_op_res_gboolean() method sets the operation - result to a boolean within the asynchronous result. - - - - - gio.SimpleAsyncResult.set_op_res_gssize - - - set_op_res_gssize - op_res - - - - - op_res : - a gssize. - - - - - - The set_op_res_gssize() method sets the operation - result within the asynchronous result to the given op_res. - - - - diff --git a/docs/reference/pygio-themedicon.xml b/docs/reference/pygio-themedicon.xml deleted file mode 100644 index fe0e44c..0000000 --- a/docs/reference/pygio-themedicon.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - gio.ThemedIcon - Icon theming support. - - - - Synopsis - - - gio.ThemedIcon - gobject.GObject - - - gio.ThemedIcon - - - - - append_name - - - - get_names - - - - prepend_name - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.ThemedIcon - - - - - - gio.ThemedIcon Properties - -
- - - - - -
- - "name" - Write/Contruct Only - - The icon name. Default value: None - - - - "names" - Read/Write/Contruct Only - - A list of icon names. - - - - "use-default-fallbacks" - Read/Write/Contruct Only - - Whether to use the default fallbacks found by shortening the - icon name at '-' characters. If the "names" array has more - than one element, ignores any past the first. - - - - - - - - - - Description - - - gio.ThemedIcon - is an implementation of gio.Icon - that supports icon themes. GThemedIcon contains a list of all of the icons present in an icon - theme, so that icons can be looked up quickly. - - - gio.ThemedIcon - does not provide actual pixmaps for icons, just the icon names. Ideally something like - gtk.IconTheme.choose_icon() - should be used to resolve the list of names so that fallback icons work nicely - with themes that inherit other themes - - - - - Constructor - - - gio.ThemedIcon - name - use_default_fallbacksFalse - - - - name : - a string containing an icon name. - - - - Returns : - a new - gio.ThemedIcon. - - - - - - Creates a new themed icon from icon name, if instead of an icon name you - provide a list of icon names, the gio.ThemedIcon - will be constructed using the items in the list. - - - - - - Methods - - - gio.ThemedIcon.append_name - - - append_name - - - - - - name : - name of icon to append to list of icons from within icon. - - - - - - The append_name() method appends a name to - the list of icons from within icon. - - - - - gio.ThemedIcon.get_names - - - get_names - - - - - - Returns : - a list of icon names. - - - - - - The get_names() method gets the names - of icons from within icon. - - - - - gio.ThemedIcon.prepend_name - - - prepend_name - - - - - - name : - name of icon to prepend to list of icons from within icon. - - - - - - The prepend_name() method prepends a name to - the list of icons from within icon. - - - - diff --git a/docs/reference/pygio-unixinputstream.xml b/docs/reference/pygio-unixinputstream.xml deleted file mode 100644 index 5ef4cde..0000000 --- a/docs/reference/pygio-unixinputstream.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - gio.unix.InputStream - Streaming input operations for UNIX file descriptors. - - - - Synopsis - - - gio.unix.InputStream - gio.InputStream - - - gio.unix.InputStream - fd - close_fd - - - - get_close_fd - - - - get_fd - - - - set_close_fd - close_fd - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.unix.InputStream - - - - - - gio.unix.InputStream Properties - -
- - - - - -
- - "close-fd" - Read - Write - Whether to close the file descriptor when the stream is closed. - Default value: True. - - - "fd" - Read - Write - Construct only - The file descriptor that the stream reads from. Default value: -1. - - - - - - - - - - Description - - - gio.unix.InputStream - implements gio.InputStream - for reading from a UNIX file descriptor, including asynchronous operations. - The file descriptor must be selectable, so it doesn't work with opened files. - - - Note that gio.unix.InputStream - belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file - when using it. - - - - - Constructor - - - gio.unix.InputStream - fd - close_fd - - - - fd : - a UNIX file descriptor. - - - - close_fd : - True - to close the file descriptor when done - - - - Returns : - a new - gio.unix.InputStream - - - - - - Creates a new gio.unix.InputStream - from the given fd. - - - If close_fd is True, the file descriptor will be closed when the stream is closed. - - - - - - Methods - - - gio.unix.InputStream.get_close_fd - - - get_close_fd - - - - - - Returns : - True if the file descriptor is closed when done. - - - - - - The get_close_fd() method returns whether the file - descriptor of stream will be closed when the stream is closed. - - - - - gio.unix.InputStream.get_fd - - - get_fd - - - - - - Returns : - The file descriptor of stream. - - - - - - The get_fd() method return the UNIX file descriptor - that the stream reads from. - - - - - gio.unix.InputStream.set_close_fd - - - set_close_fd - close_fd - - - - - close_fd : - True to close the file descriptor when done . - - - - - - The set_close_fd() method sets whether the file descriptor - of stream shall be closed when the stream is closed. - - - - diff --git a/docs/reference/pygio-unixoutputstream.xml b/docs/reference/pygio-unixoutputstream.xml deleted file mode 100644 index 02e4be8..0000000 --- a/docs/reference/pygio-unixoutputstream.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - gio.unix.OutputStream - Streaming output operations for UNIX file descriptors. - - - - Synopsis - - - gio.unix.OutputStream - gio.OutputStream - - - gio.unix.OutputStream - fd - close_fd - - - - get_close_fd - - - - get_fd - - - - set_close_fd - close_fd - - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.OutputStream - +-- gio.unix.OutputStream - - - - - - gio.unix.OutputStream Properties - -
- - - - - -
- - "close-fd" - Read - Write - Whether to close the file descriptor when the stream is closed. - Default value: True. - - - "fd" - Read - Write - Construct only - The file descriptor that the stream writes to. Default value: -1. - - - - - - - - - - Description - - - gio.unix.OutputStream - implements gio.OutputStream - for writing to a UNIX file descriptor, including asynchronous operations. - The file descriptor must be selectable, so it doesn't work with opened files. - - - Note that gio.unix.OutputStream - belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file - when using it. - - - - - Constructor - - - gio.unix.OutputStream - fd - close_fd - - - - fd : - a UNIX file descriptor. - - - - close_fd : - True - to close the file descriptor when done - - - - Returns : - a new - gio.unix.OutputStream - - - - - - Creates a new gio.unix.OutputStream - from the given fd. - - - If close_fd is True, the file descriptor will be closed when the stream is closed. - - - - - - Methods - - - gio.unix.OutputStream.get_close_fd - - - get_close_fd - - - - - - Returns : - True if the file descriptor is closed when done. - - - - - - The get_close_fd() method returns whether the file - descriptor of stream will be closed when the stream is closed. - - - - - gio.unix.OutputStream.get_fd - - - get_fd - - - - - - Returns : - The file descriptor of stream. - - - - - - The get_fd() method return the UNIX file descriptor - that the stream reads from. - - - - - gio.unix.OutputStream.set_close_fd - - - set_close_fd - close_fd - - - - - close_fd : - True to close the file descriptor when done . - - - - - - The set_close_fd() method sets whether the file descriptor - of stream shall be closed when the stream is closed. - - - - diff --git a/docs/reference/pygio-volume.xml b/docs/reference/pygio-volume.xml deleted file mode 100644 index cf0fa50..0000000 --- a/docs/reference/pygio-volume.xml +++ /dev/null @@ -1,718 +0,0 @@ - - - - - - gio.Volume - Volume management. - - - - Synopsis - - - gio.Volume - gobject.GInterface - - - can_eject - - - - can_mount - - - - eject - callback - flagsgio.MOUNT_UNMOUNT_NONE - cancellableNone - user_dataNone - - - eject_finish - result - - - enumerate_identifiers - - - - get_activation_root - - - - get_drive - - - - get_icon - - - - get_identifier - - - - get_mount - - - - get_name - - - - get_uuid - - - - mount - mount_operation - callback - flagsgio.MOUNT_MOUNT_NONE - cancellableNone - user_dataNone - - - mount_finish - result - - - should_automount - - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.Volume - - - - - - Prerequisites - - gio.Volume requires - gobject.GObject - - - - - gio.Volume Signal Prototypes - - gobject.GObject Signal Prototypes - - - - "changed" - - callback - volume - user_param1 - ... - - - - - "removed" - - callback - volume - user_param1 - ... - - - - - - - - - Description - - - The gio.Volume - interface represents user-visible objects that can be mounted. Note, when porting - from GnomeVFS, gio.Volume - is the moral equivalent of GnomeVFSDrive. - - - Mounting a gio.Volume - instance is an asynchronous operation. For more information about asynchronous operations. - To mount a gio.Volume, first call - gio.Volume.mount() - with (at least) the gio.Volume - instance, optionally a - gio.MountOperation - object and a GAsyncReadyCallback. - - - Typically, one will only want to pass None for the GMountOperation - if automounting all volumes when a desktop session starts since it's not desirable - to put up a lot of dialogs asking for credentials. - - - The callback will be fired when the operation has resolved (either with success or failure), - and a GAsyncReady structure will be passed to the callback. That callback should then call - gio.Volume.mount_finish() - with the GVolume instance and the GAsyncReady data to see if the operation was completed - successfully. If an error is present when - gio.Volume.mount_finish() - is called, then it will be filled with any error information. - - - It is sometimes necessary to directly access the underlying operating system object behind a volume - (e.g. for passing a volume to an application via the commandline). For this purpose, GIO allows to obtain - an 'identifier' for the volume. There can be different kinds of identifiers, such as Hal UDIs, - filesystem labels, traditional Unix devices (e.g. /dev/sda2), uuids. GIO uses predefind strings - as names for the different kinds of identifiers: - "hal-udi", "label", etc. Use - gio.Volume.get_identifier() - to obtain an identifier for a volume. - - - - - Methods - - - gio.Volume.can_eject - - - can_eject - - - - - - Returns : - True if the volume can be ejected, - False otherwise. - - - - - - The can_eject() method checks if a volume can be ejected. - - - - - gio.Volume.can_mount - - - can_mount - - - - - - Returns : - True if the volume can be mounted - for media changes, False otherwise. - - - - - - The can_mount() method checks if a volume - can be mounted. - - - - - gio.Volume.eject - - - eject - - callback - - - flagsgio.MOUNT_UNMOUNT_NONE - - - cancellableNone - - - user_dataNone - - - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - flags affecting the unmount if required for eject. - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The eject() method asynchronously ejects a volume. - - - When the operation is finished, callback will be called. You can then call - gio.Volume.eject_finish() - to obtain the result of the operation. - - - - - gio.Volume.eject_finish - - - eject_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the volume has been ejected - successfully, False otherwise. - - - - - - The eject_finish() method finishes ejecting a volume. - If any errors occured during the operation, error will be set to contain the - errors and False will be returned. - - - - - gio.Volume.enumerate_identifiers - - - enumerate_identifiers - - - - - - Returns : - a list of strings containing kinds of identifiers. - - - - - - The enumerate_identifiers() method gets the kinds - of identifiers that volume has. Use - gio.Volume.get_identifier() - to obtain the identifiers themselves. - - - - - gio.Volume.get_activation_root - - - get_activation_root - - - - - - Returns : - the activation root of volume or None. - - - - - - The get_activation_root() method gets the activation - root for a gio.Volume - if it is known ahead of mount time. Returns None otherwise. - If not None and if volume is mounted, then the result of - gio.Mount.get_root() - on the GMount object obtained from - gio.Volume.get_mount() - will always either be equal or a prefix of what this function returns. - In other words, in code: - - -mount = volume.get_mount() # mounted, so never None -mount_root = mount.get_root() -volume_activation_root = volume.get_activation_root() # assume not None - - - then the expression - - -volume_activation_root.has_prefix(mount_root) || volume_activation_root.equal(mount_root) - - - will always be True. - - - Activation roots are typically used in - gio.VolumeMonitor - implementations to find the underlying mount to shadow, see - gio.Mount.is_shadowed() - for more details. - - - - - gio.Volume.get_drive - - - get_drive - - - - - - Returns : - A gio.Drive - or None if volume is not associated with a drive. - - - - - - The get_drive() method gets the drive for the volume. - - - - - gio.Volume.get_icon - - - get_icon - - - - - - Returns : - gio.Icon - for the volume. - - - - - - The get_icon() method gets the icon for volume. - - - - - gio.Volume.get_identifier - - - get_identifier - - - - - - Returns : - A string containing the requested identfier, or - None if the - gio.Volume - doesn't have this kind of identifier. - - - - - - The get_identifier() method gets the identifier of - the given kind for volume. - - - - - gio.Volume.get_mount - - - get_mount - - - - - - Returns : - A - gio.Mount - or None if volume isn't mounted. - - - - - - The get_mount() method gets the mount for the volume. - - - - - gio.Volume.get_name - - - get_name - - - - - - Returns : - A string containing volume's name. - - - - - - The get_name() method gets the name of volume. - - - - - gio.Volume.get_uuid - - - get_uuid - - - - - - Returns : - the UUID for volume or None - if no UUID can be computed. - - - - - - The get_uuid() method gets the UUID for the volume. - The reference is typically based on the file system UUID for the volume in - question and should be considered an opaque string. - Returns None if there is no UUID available. - - - - - gio.Volume.mount - - - mount - - mount_operation - - - callback - - - flagsgio.MOUNT_MOUNT_NONE - - - cancellableNone - - - user_dataNone - - - - - - mount_operation : - A - gio.MountOperation - or None to avoid user interaction. - - - - callback : - A GAsyncReadyCallback to call when the request is satisfied. - - - - flags : - Flags affecting the operation - - - - cancellable : - Optional - gio.Cancellable - object, None to ignore. - - - - user_data : - The data to pass to callback function. - - - - - - The mount() method mounts a volume. This is an - asynchronous operation, and is finished by calling - gio.Volume.mount_finish() - with the volume and GAsyncResult returned in the callback. - - - - - gio.Volume.mount_finish - - - mount_finish - result - - - - - result : - a gio.AsyncResult. - - - - Returns : - True if the volume has been mounted - successfully, False otherwise. - - - - - - The mounted() method finishes mounting a volume. - If any errors occured during the operation, error will be set to contain - the errors and False will be returned. - - - If the mount operation succeeded, - get_mount() - on volume is guaranteed to return the mount right after calling this function; - there's no need to listen for the 'mount-added' signal on - gio.VolumeMonitor. - - - - - gio.Volume.should_automount - - - should_automount - - - - - - Returns : - True if the volume should - be automatically mounted. - - - - - - The should_automount() method returns whether - the volume should be automatically mounted. - - - - - - Signals - - - The "changed" gio.Volume Signal - - callback - volume - user_param1 - ... - - - - - volume : - the volume - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when the volume has been changed. - - - - - The "removed" gio.Volume Signal - - callback - volume - user_param1 - ... - - - - - volume : - the volume - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - This signal is emitted when the - gio.Volume - have been removed. If the recipient is holding references to the object - they should release them so the object can be finalized. - - - - - diff --git a/docs/reference/pygio-volumemonitor.xml b/docs/reference/pygio-volumemonitor.xml deleted file mode 100644 index 399d07e..0000000 --- a/docs/reference/pygio-volumemonitor.xml +++ /dev/null @@ -1,844 +0,0 @@ - - - - - - gio.VolumeMonitor - Volume Monitor. - - - - Synopsis - - - gio.VolumeMonitor - gobject.GObject - - - get_connected_drives - - - - get_mount_for_uuid - uuid - - - get_mounts - - - - get_volume_for_uuid - uuid - - - get_volumes - - - - - - -Functions - - gio.volume_monitor_adopt_orphan_mount - - - gio.volume_monitor_get - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.VolumeMonitor - - - - - - gio.VolumeMonitor Signal Prototypes - - gobject.GObject Signal Prototypes - - - - "drive-changed" - - callback - volume_monitor - drive - user_param1 - ... - - - - - "drive-connected" - - callback - volume_monitor - drive - user_param1 - ... - - - - - "drive-disconnected" - - callback - volume_monitor - drive - user_param1 - ... - - - - - "drive-eject-button" - - callback - volume_monitor - drive - user_param1 - ... - - - - - "mount-added" - - callback - volume_monitor - mount - user_param1 - ... - - - - - "mount-changed" - - callback - volume_monitor - mount - user_param1 - ... - - - - - "mount-pre-unmount" - - callback - volume_monitor - mount - user_param1 - ... - - - - - "mount-removed" - - callback - volume_monitor - mount - user_param1 - ... - - - - - "volume-added" - - callback - volume_monitor - volume - user_param1 - ... - - - - - "volume-changed" - - callback - volume_monitor - volume - user_param1 - ... - - - - - "volume-removed" - - callback - volume_monitor - volume - user_param1 - ... - - - - - - - - Description - - - The gio.VolumeMonitor - is for listing the user interesting devices and volumes on the computer. In other words, - what a file selector or file manager would show in a sidebar. - - - - - Methods - - - gio.VolumeMonitor.get_connected_drives - - - get_connected_drives - - - - - - Returns : - a list of connected - gio.Drive objects. - - - - - - The get_connected_drives() method gets a list - of drives connected to the system. - - - - - gio.VolumeMonitor.get_mount_for_uuid - - - get_mount_for_uuid - uuid - - - - - uuid : - The UUID to look for. - - - - Returns : - A - gio.Mount - or None if no such mount is available. - - - - - - The get_mount_for_uuid() method finds a - gio.Mount - object by it's UUID (see - gio.Mount.get_uuid()) - - - - - gio.VolumeMonitor.get_mounts - - - get_mounts - - - - - - Returns : - A list of - gio.Mount - objects. - - - - - - The get_mounts() method gets a list of the mounts on the system. - - - - - gio.VolumeMonitor.get_volume_for_uuid - - - get_volume_for_uuid - uuid - - - - - uuid : - The UUID to look for. - - - - Returns : - A - gio.Volume - or None if no such volume is available. - - - - - - The get_mount_for_uuid() method finds a - gio.Mount - object by it's UUID (see - gio.Mount.get_uuid()) - - - - - gio.VolumeMonitor.get_volumes - - - get_volumes - - - - - - Returns : - A list of - gio.Volume - objects. - - - - - - The get_volumes() method gets a list of the volumes on the system. - - - - - - Functions - - - gio.volume_monitor_adopt_orphan_mount - - - volume_monitor_adopt_orphan_mount - - - - - - Returns : - The gio.Volume - object that is the parent for mount or None if no wants to adopt the - gio.Mount. - - - - - - This method will be deprecated starting from GIO 2.20 - - - - The volume_monitor_adopt_orphan_mount() function should - be called by any gio.VolumeMonitor - implementation when a new gio.Mount - object is created that is not associated with a - gio.Volume object. - It must be called just before emitting the mount_added signal. - - - If the return value is not None, the caller must associate the returned - gio.Volume - object with the - gio.Mount. - This involves returning it in it's - gio.Mount.get_volumes() - implementation. The caller must also listen for the "removed" signal on the - returned object and give up it's reference when handling that signal - - - Similary, if implementing - gio.volume_monitor_adopt_orphan_mount(), - the implementor must take a reference to mount and return it in it's - gio.Volume.get_mount() - implemented. Also, the implementor must listen for the "unmounted" signal - on mount and give up it's reference upon handling that signal. - - - There are two main use cases for this function. - - - One is when implementing a user space file system driver that reads blocks of - a block device that is already represented by the native volume monitor - (for example a CD Audio file system driver). Such a driver will generate it's own - gio.Mount - object that needs to be assoicated with the - gio.Volume - object that represents the volume. - - - The other is for implementing a - gio.VolumeMonitor - whose sole purpose is to return - gio.Volume - objects representing entries in the users "favorite servers" list or similar. - - - - - gio.volume_monitor_get - - - volume_monitor_get - - - - - - Returns : - A reference to the - gio.VolumeMonitor - used by gio. - - - - - - The volume_monitor_get() function gets the - volume monitor used by gio. - - - - - - Signals - - - The "drive-changed" gio.Volume Signal - - callback - volume_monitor - drive - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - drive : - the drive that changed - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a drive changes. - - - - - The "drive-connected" gio.Volume Signal - - callback - volume_monitor - drive - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - drive : - the drive that was connected - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a drive is connected to the system. - - - - - The "drive-disconnected" gio.Volume Signal - - callback - volume_monitor - drive - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - drive : - the drive that was disconnected - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a drive is disconnected from the system. - - - - - The "drive-eject-button" gio.Volume Signal - - callback - volume_monitor - drive - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - drive : - the drive where the eject button was pressed - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when the eject button is pressed on drive. - - - - - The "mount-added" gio.Volume Signal - - callback - volume - mount - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - mount : - a Mount that was added. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mount is added. - - - - - The "mount-changed" gio.Volume Signal - - callback - volume_monitor - mount - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - mount : - the Mount that changed. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mount changes. - - - - - The "mount-pre-unmount" gio.Volume Signal - - callback - volume_monitor - mount - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - mount : - the Mount that is being unmounted. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mount is about to be removed. - - - - - The "mount-removed" gio.Volume Signal - - callback - volume_monitor - mount - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - mount : - the Mount that was removed. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mount is removed. - - - - - The "volume-added" gio.Volume Signal - - callback - volume_monitor - volume - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - volume : - a Volume that was added. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mountable volume is added to the system. - - - - - The "volume-changed" gio.Volume Signal - - callback - volume_monitor - volume - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - volume : - a Volume that changed. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when mountable volume is changed. - - - - - The "volume-removed" gio.Volume Signal - - callback - volume_monitor - volume - user_param1 - ... - - - - - volume_monitor : - the volume monitor - - - volume : - a Volume that was removed. - - - user_param1 : - the first user parameter (if any) specified - with the connect() - method - - - ... : - additional user parameters (if any) - - - - - Emitted when a mountable volume is removed from the system. - - - - diff --git a/docs/reference/pygiounix-classes.xml b/docs/reference/pygiounix-classes.xml deleted file mode 100644 index 72b0081..0000000 --- a/docs/reference/pygiounix-classes.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - -PyGio Unix Class Reference - - - - - - diff --git a/docs/reference/pygobject-ref.xml b/docs/reference/pygobject-ref.xml index 5fdd80b..ee90a55 100644 --- a/docs/reference/pygobject-ref.xml +++ b/docs/reference/pygobject-ref.xml @@ -24,8 +24,6 @@ module. - -

type :

a GObject type, type ID or +

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or instance

Returns :

The gobject.type_name() function returns the unique name that is assigned to the specified type. type can be a GObject diff --git a/docs/html/index.html b/docs/html/index.html index f5b135d..a8a36bf 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -1,6 +1,6 @@ -PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.28.6

2011-06-13 +PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.90.1

2011-08-14

Abstract

This reference describes the classes of the python gobject module.


Table of Contents

Introduction
Reference Page Format
PyGlibClass Reference
glib.MainContext — an object representing a set of event sources to be handled in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK application.
glib Functions — miscellaneous functions
glib Constants — the built-in constants of the glib module
PyGObject Class Reference
gobject.GObject — the base class
gobject.GBoxed — an object containing an opaque chunk of data
gobject.GPointer — an object containing a completely opaque chunk of - data
gobject.GInterface — an object representing a GInterface
gobject Functions — miscellaneous functions
gobject Constants — the built-in constants of the gobject module
PyGio Class Reference
gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).
gio.AppLaunchContext — Application launch context.
gio.AsyncResult — Asynchronous Function Results.
gio.BufferedInputStream — Buffered Input Stream
gio.BufferedOutputStream — Buffered Output Stream
gio.Cancellable — Thread-safe Operation Cancellation Stack.
gio.DataInputStream — Data Input Stream
gio.DataOutputStream — Data Output Stream
gio.Drive — Virtual File System drive management.
gio.Emblem — An object for emblems.
gio.EmblemedIcon — Icon with emblems.
gio.File — File and Directory Handling.
gio.FileAttributeInfo — Information about a specific attribute.
gio.FileEnumerator — Enumerated Files Routines.
gio.FileIcon — Icons pointing to an image file.
gio.FileInfo — File Information and Attributes
gio.FileInputStream — Base class for implementing streaming input
gio.FileMonitor — File Monitor
gio.FileOutputStream — Base class for implementing streaming input
gio.FilterInputStream — Filter Input Stream
gio.FilterOutputStream — Filter Output Stream
gio.Icon — Interface for icons.
gio.InputStream — Base class for implementing streaming input
gio.LoadableIcon — Interface for icons.
gio.MemoryInputStream — Base class for implementing streaming input
gio.MemoryOutputStream — Streaming output operations on memory chunks
gio.Mount — Mount management
gio.MountOperation — Authentication methods for mountable locations.
gio.OutputStream — Base class for implementing streaming input
gio.Seekable — Stream seeking interface.
gio.SimpleAsyncResult — Simple asynchronous results implementation.
gio.ThemedIcon — Icon theming support.
gio.Volume — Volume management.
gio.VolumeMonitor — Volume Monitor.
gio Functions
gio Constants — the built-in constants of the gio module
PyGio Unix Class Reference
gio.unix.InputStream — Streaming input operations for UNIX file descriptors.
gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.
+ data
gobject.GInterface — an object representing a GInterface
gobject Functions — miscellaneous functions
gobject Constants — the built-in constants of the gobject module
diff --git a/docs/html/index.sgml b/docs/html/index.sgml index e9b5432..93c0942 100644 --- a/docs/html/index.sgml +++ b/docs/html/index.sgml @@ -96,437 +96,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/html/pygobject.devhelp b/docs/html/pygobject.devhelp index b37be2a..7a030e8 100644 --- a/docs/html/pygobject.devhelp +++ b/docs/html/pygobject.devhelp @@ -18,70 +18,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -164,362 +104,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/reference/pygio-appinfo.xml b/docs/reference/pygio-appinfo.xml deleted file mode 100644 index eaeb060..0000000 --- a/docs/reference/pygio-appinfo.xml +++ /dev/null @@ -1,894 +0,0 @@ - - - - - - gio.AppInfo - Information about an installed application and methods to launch it (with file arguments). - - - - Synopsis - - - gio.AppInfo - gobject.GInterface - - - gio.AppInfo - commandline - application_nameNone - flagsgio.APP_INFO_CREATE_NONE - - - - add_supports_type - content_type - - - can_delete - - - - can_remove_supports_type - - - - delete - - - - dup - - - - equal - appinfo2 - - - get_commandline - - - - get_description - - - - get_executable - - - - get_icon - - - - get_id - - - - get_name - - - - launch - files - launch_context - - - launch_uris - uris - launch_context - - - remove_supports_type - content_type - - - set_as_default_for_extension - extension - - - set_as_default_for_type - content_type - - - should_show - - - - supports_files - - - - supports_uris - - - - - - -Functions - - - gio.app_info_get_all - - - gio.app_info_get_all_for_type - content_type - - gio.app_info_get_default_for_type - content_type - must_support_uris - - gio.app_info_get_default_for_uri_scheme - uri_scheme - - gio.app_info_reset_type_association - content_type - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.AppInfo - - - - - - Known Implementation - - gio.AppInfo is implemented by - gio.DesktopAppInfo - - - - - Description - - - gio.AppInfo - and gio.AppLaunchContext - are used for describing and launching applications installed on the system. - - - As of GLib 2.20, URIs will always be converted to POSIX paths (using - gio.File.get_path()) when using - gio.AppInfo.launch() - even if the application requested an URI and not a POSIX path. For example for an desktop-file - based application with Exec key totem %U and a single URI, sftp://foo/file.avi, then /home/user/.gvfs/sftp - on foo/file.avi will be passed. This will only work if a set of suitable GIO extensions (such as gvfs 2.26 - compiled with FUSE support), is available and operational; if this is not the case, the URI will be passed - unmodified to the application. Some URIs, such as mailto:, of course cannot be mapped to a POSIX path - (in gvfs there's no FUSE mount for it); such URIs will be passed unmodified to the application. - - - Specifically for gvfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the - gio.File constructors - (since gvfs implements the GVfs extension point). As such, if the application needs to examine the URI, - it needs to use - gio.File.get_uri() - or similar on - gio.File. - In other words, an application cannot assume that the URI passed to e.g. - gio.File() constructor - is equal to the result of - gio.File.get_uri(). - - - - - Constructor - - - gio.AppInfo - commandline - application_nameNone - flagsgio.APP_INFO_CREATE_NONE - - - - commandline : - the commandline to use - - - - application_name : - the application name, or None to use commandline. - - - - flags : - flags that can specify details of the created, - from - - - - Returns : - a new - gio.AppInfo - for given command. - - - - - - Creates a new gio.AppInfo - from the given information. - - - - - - Methods - - - gio.AppInfo.add_supports_type - - - add_supports_type - content_type - - - - - content_type : - A string. - - - - - The add_supports_type() method adds a content type - to the application information to indicate the application is capable of - opening files with the given content type. - - - - - gio.AppInfo.can_delete - - - can_delete - - - - - - Returns : - True if appinfo can be deleted. - - - - - - The can_delete() method obtains the information - whether the gio.AppInfo - can be deleted. See - gio.AppInfo.delete(). - - - - - gio.AppInfo.can_remove_supports_type - - - can_remove_supports_type - - - - - - Returns : - True if it is possible to remove - supported content types from a given appinfo, False - if not. - - - - - The can_remove_supports_type() method checks if a - supported content type can be removed from an application. - - - - - gio.AppInfo.delete - - - delete - - - - - - Returns : - True if appinfo has been deleted. - - - - - - The delete() method tries to delete an - gio.AppInfo. - - - On some platforms, there may be a difference between user-defined - gio.AppInfos - which can be deleted, and system-wide ones which cannot. See - gio.AppInfo.can_delete(). - - - - - gio.AppInfo.dup - - - dup - - - - - - Returns : - A duplicate of appinfo. - - - - - The dup() method creates a duplicate of a - gio.AppInfo. - - - - - gio.AppInfo.equal - - - equal - icon2 - - - - - appinfo2 : - the second - gio.AppInfo - - - - Returns : - True if appinfo1 is equal to appinfo2. - False otherwise. - - - - - The equal() method checks if two - gio.AppInfos are equal. - - - - - gio.AppInfo.get_commandline - - - get_commandline - - - - - - Returns : - a string containing the appinfo's commandline, or - None if this information is not available. - - - - - - The get_commandline() method gets the - commandline with which the application will be started. - - - - - gio.AppInfo.get_description - - - get_description - - - - - - Returns : - A string containing a description of the application - appinfo, or None if none. - - - - - The get_description() method gets a human-readable - description of an installed application. - - - - - gio.AppInfo.get_executable - - - get_executable - - - - - - Returns : - a string containing the appinfo's application - binary's name. - - - - - - The get_description() method gets the executable's - name for the installed application. - - - - - gio.AppInfo.get_icon - - - get_icon - - - - - - Returns : - the default - gio.Icon for appinfo. - - - - - - The get_icon() method gets the icon for the application. - - - - - gio.AppInfo.get_id - - - get_id - - - - - - Returns : - a string containing the application's ID. - - - - - - The get_id() method gets the ID of an application. - An id is a string that identifies the application. The exact format of the - id is platform dependent. For instance, on Unix this is the desktop file id - from the xdg menu specification. - - - Note that the returned ID may be None, depending on - how the appinfo has been constructed. - - - - - gio.AppInfo.get_name - - - get_name - - - - - - Returns : - the name of the application for appinfo. - - - - - - The get_name() method gets the installed - name of the application. - - - - - gio.AppInfo.launch - - - launch - files - launch_context - - - - - files : - a list of gio.File objects. - - - - launch_context : - a gio.AppLaunchContext - or None. - - - Returns : - True on successful launch, - False otherwise. - - - - - - The launch() method launches the application. - Passes files to the launched application as arguments, using the optional - launch_context to get information about the details of the launcher - (like what screen it is on). On error, error will be set accordingly. - - - To lauch the application without arguments pass a None for files list. - - - Note that even if the launch is successful the application launched can fail - to start if it runs into problems during startup. There is no way to detect this. - - - Some URIs can be changed when passed through a - gio.File - (for instance unsupported uris with strange formats like mailto:), so - if you have a textual uri you want to pass in as argument, consider using - gio.File.launch_uris() - instead. - - - - - gio.AppInfo.launch_uris - - - launch_uris - uris - launch_context - - - - - uris : - a list containing URIs to launch. - - - - launch_context : - a gio.AppLaunchContext - or None. - - - Returns : - True on successful launch, - False otherwise. - - - - - - The launch_uris() method launches the application. - Passes uris to the launched application as arguments, using the optional - launch_context to get information about the details of the launcher - (like what screen it is on). On error, error will be set accordingly. - - - To lauch the application without arguments pass a None for files list. - - - Note that even if the launch is successful the application launched can fail - to start if it runs into problems during startup. There is no way to detect this. - - - - - gio.AppInfo.remove_supports_type - - - remove_supports_type - content_type - - - - - content_type : - A string. - - - - - The remove_supports_type() method removes a - supported type from an application, if possible. - - - - - gio.AppInfo.set_as_default_for_extension - - - set_as_default_for_extension - extension - - - - - extension : - A string containing the file extension (without the dot). - - - - - - The set_as_default_for_extension() method sets the - application as the default handler for the given file extention. - - - - - gio.AppInfo.set_as_default_for_type - - - set_as_default_for_type - content_type - - - - - content_type : - The content type. - - - - - - The set_as_default_for_type() method sets the - application as the default handler for a given type. - - - - - gio.AppInfo.should_show - - - should_show - - - - - - Returns : - True if the appinfo should be shown, - False otherwise. - - - - - - The should_show() method checks if the application - info should be shown in menus that list available applications. - - - - - gio.AppInfo.supports_files - - - supports_files - - - - - - Returns : - True if the appinfo supports files. - - - - - - The supports_files() method checks if the application - accepts files as arguments. - - - - - gio.AppInfo.supports_uris - - - supports_uris - - - - - - Returns : - True if the appinfo supports uris. - - - - - - The supports_uris() method checks if the application - accepts uris as arguments. - - - - - - Functions - - - gio.app_info_get_all - - - app_info_get_all - - - - - - Returns : - A list of gio.AppInfos. - - - - - - The app_info_get_all() function gets a list of all of - the applications currently registered on this system. - - - For desktop files, this includes applications that have NoDisplay=true set or are - excluded from display by means of OnlyShowIn or NotShowIn. See - gio.AppInfo.should_show(). - The returned list does not include applications which have the Hidden key set. - - - - - gio.app_info_get_all_for_type - - - app_info_get_all_for_type - content_type - - - - - content_type : - the content type to find a - gio.AppInfo - for. - - - Returns : - A list of gio.AppInfos - for a given content type or None on error. - - - - - - The app_info_get_all_for_type() function gets a list of all - gio.AppInfos - for a given content type. - - - - - gio.app_info_get_default_for_type - - - app_info_get_default_for_type - content_type - must_support_uris - - - - - content_type : - the content type to find a - gio.AppInfo - for. - - - must_support_uris : - if True, the - gio.AppInfo - is expected to support URIs - - - Returns : - gio.AppInfo - for given content_type or None on error. - - - - - - The app_info_get_default_for_type() function gets the - gio.AppInfo - that correspond to a given content type. - - - - - gio.app_info_get_default_for_uri_scheme - - - app_info_get_default_for_uri_scheme - uri_scheme - - - - - uri_scheme : - a string containing a URI scheme. - - - Returns : - gio.AppInfo - for given uri_scheme or None on error. - - - - - - The app_info_get_default_for_uri_scheme() function gets - the default application for launching applications using this URI scheme. A URI - scheme is the initial part of the URI, up to but not including the - ':', e.g. "http", "ftp" or "sip". - - - - - gio.app_info_reset_type_association - - - app_info_reset_type_association - content_type - - - - - content_type : - a content type - - - - - The app_info_reset_type_association() function - removes all changes to the type associations done by - set_as_default_for_type(), - set_as_default_for_extension(), - add_supports_type() or - remove_supports_type(). - - - - diff --git a/docs/reference/pygio-applaunchcontext.xml b/docs/reference/pygio-applaunchcontext.xml deleted file mode 100644 index 66bb229..0000000 --- a/docs/reference/pygio-applaunchcontext.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - gio.AppLaunchContext - Application launch context. - - - - Synopsis - - - gio.AppLaunchContext - gobject.GObject - - - gio.AppLaunchContext - - - - - get_display - info - files - - - get_startup_notify_id - info - files - - - launch_failed - startup_notify_id - - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.AppLaunchContext - - - - - - Description - - - The gio.AppLaunchContext - is used for integrating the launch with the launching application. This is used to handle for - instance startup notification and launching the new application on the same screen as the launching window. - - - - - Constructor - - - gio.AppLaunchContext - - - - - Returns : - a new - gio.AppLaunchContext. - - - - - - Creates a new application launch context. This is not normally used, instead - you instantiate a subclass of this, such as - gtk.gdk.AppLaunchContext. - - - - - - Methods - - - gio.AppLaunchContext.get_display - - - get_display - info - files - - - - - info : - a - gio.AppInfo - - - - files : - a list of - gio.File - objects. - - - Returns : - a display string for the display. - - - - - - The get_display() method gets the display - string for the display. This is used to ensure new applications - are started on the same display as the launching application. - - - - - gio.AppLaunchContext.get_startup_notify_id - - - get_startup_notify_id - info - files - - - - - info : - a - gio.AppInfo - - - - files : - a list of - gio.File - objects. - - - Returns : - a startup notification ID for the application, - or None if not supported. - - - - - - The get_startup_notify_id() method initiates - startup notification for the application and returns the DESKTOP_STARTUP_ID - for the launched operation, if supported. - - - Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard. - - - - - gio.AppLaunchContext.launch_failed - - - launch_failed - startup_notify_id - - - - - startup_notify_id : - the startup notification id that was returned by - get_startup_notify_id. - - - - Returns : - a startup notification ID for the application, - or None if not supported. - - - - - - The get_startup_notify_id() method is called - when an application has failed to launch, so that it can cancel the application - startup notification started in - get_startup_notify_id - - - - diff --git a/docs/reference/pygio-asyncresult.xml b/docs/reference/pygio-asyncresult.xml deleted file mode 100644 index abe56ce..0000000 --- a/docs/reference/pygio-asyncresult.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - gio.AsyncResult - Asynchronous Function Results. - - - - Synopsis - - - gio.AsyncResult - gobject.GInterface - - - get_source_object - - - - - - - - - Ancestry - -+-- gobject.GInterface - +-- gio.AsyncResult - - - - - - Prerequisites - - gio.AsyncResult is required by - gobject.GObject. - - - - - Known Implementation - - gio.AsyncResult is implemented by - gio.SimpleAsyncResult. - - - - - Description - - - gio.AsyncResult - provides a base class for implementing asynchronous function results. - - - Asynchronous operations are broken up into two separate operations which are chained - together by a GAsyncReadyCallback. To begin an asynchronous operation, provide a - GAsyncReadyCallback to the asynchronous function. This callback will be triggered when - the operation has completed, and will be passed a GAsyncResult instance filled with the - details of the operation's success or failure, the object the asynchronous function was - started for and any error codes returned. The asynchronous callback function is then expected - to call the corresponding "_finish()" function with the object the function was called for, - and the gio.AsyncResult - instance, and optionally, an error to grab any error conditions that may have occurred. - - - The purpose of the "_finish()" function is to take the generic result of type GAsyncResult and - return the specific result that the operation in question yields (e.g. a - gio.FileEnumerator - for a "enumerate children" operation). If the result or error status of the operation is not needed, - there is no need to call the "_finish()" function, GIO will take care of cleaning up the result and error - information after the GAsyncReadyCallback returns. It is also allowed to take a reference to the - gio.AsyncResult - and call "_finish()" later. - - - The callback for an asynchronous operation is called only once, and is always called, even - in the case of a cancelled operation. On cancellation the result is a gio.ERROR_CANCELLED error. - - - Some ascynchronous operations are implemented using synchronous calls. These are run in a - separate thread, if GThread has been initialized, but otherwise they are sent to the Main Event - Loop and processed in an idle function. So, if you truly need asynchronous operations, make - sure to initialize GThread. - - - - - Methods - - - gio.AsyncResult.get_source_object - - - get_source_object - - - - - - Returns : - the source object for the res. - - - - - - The get_source_object() method gets the source object - from a gio.AsyncResult - - - - diff --git a/docs/reference/pygio-bufferedinputstream.xml b/docs/reference/pygio-bufferedinputstream.xml deleted file mode 100644 index 677b1da..0000000 --- a/docs/reference/pygio-bufferedinputstream.xml +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - gio.BufferedInputStream - Buffered Input Stream - - - - Synopsis - - - gio.BufferedInputStream - gio.FilterInputStream - - - gio.BufferedInputStream - base_stream - - - - fill - count - cancellableNone - - - fill_async - count - callback - io_priorityglib.PRIORITY_DEFAULT - cancellableNone - user_dataNone - - - fill_finish - result - - - get_available - - - - get_buffer_size - - - - read_byte - cancellableNone - - - set_buffer_size - size - - - - - -Functions - - - gio.buffered_input_stream_new_sized - size - - - - - - Ancestry - -+-- gobject.GObject - +-- gio.InputStream - +-- gio.FilterInputStream - +-- gio.BufferedInputStream - - - - - - gio.BufferedInputStream Properties - -
- - - - - -