=== 2.15.3 === 2008-08-30 Gustavo J. A. M. Carneiro * glib/pyglib.h: * gobject/pygobject.c: Fix memory problems reported by valgrind due to invalid tp_basicsize in PyGPropsDescr_Type. Closes #549945. 2008-08-28 Paul Pogonyshev Bug 549191 – Constructor of gtk.TreeView raises TypeError when model is None * gobject/pygtype.c (pyg_value_from_pyobject): Handle None in G_TYPE_INTERFACE branch. 2008-08-28 Paul Pogonyshev Bug 549351 – an unitialized variable in PyGLib * glib/pygmainloop.c (pyg_main_loop_init): Initialize `is_running'. 2008-08-28 Paul Pogonyshev Bug 547633 – cannot create new threads when pygtk is used * glib/pyglib.c (_pyglib_notify_on_enabling_threads): New function. (pyglib_enable_threads): Invoke all callbacks added with new _pyglib_notify_on_enabling_threads(). * gobject/gobjectmodule.c (pyg_note_threads_enabled): New function (callback for new _pyglib_notify_on_enabling_threads()). (PYGLIB_MODULE_START): Initialize 'pygobject_api_functions.threads_enabled' and also watch for thread being enabled later on. 2008-08-28 Paul Pogonyshev Bug 547088 – wrap g_content_types_get_registered() * gio/gio.override (_wrap_g_drive_get_volumes): Fix refleak. (_wrap_g_content_types_get_registered): New function. * gio/gfileenumerator.override (_wrap_g_file_enumerator_next_files_finish): Fix refleak. * gio/gvolumemonitor.override (_wrap_g_volume_monitor_get_connected_drives): Fix refleak. (_wrap_g_volume_monitor_get_volumes): Likewise. (_wrap_g_volume_monitor_get_mounts): Likewise. 2008-08-28 Paul Pogonyshev Bug 547494 – gio.InputStream.read() looks broken * gio/gio.defs (gio.InputStream.read_part): Rename from read(), document. (gio.InputStream.read): Rename from read_all(), document. (gio.OutputStream.write_part): Rename from write(), document. (gio.OutputStream.write): Rename from write_all(), document. * gio/ginputstream.override (_wrap_g_input_stream_read): Fix several bugs. (_wrap_g_input_stream_read_all): New function. * gio/goutputstream.override (_wrap_g_output_stream_write_all): New function. * tests/test_gio.py (TestInputStream.testRead): Add more tests. (TestInputStream.test_read_part): New test. (TestInputStream._read_in_loop): New helper method. (TestOutputStream.test_write_part): New test. 2008-08-16 Paul Pogonyshev * gio/gfile.override (_wrap_g_file_enumerate_children_async): Fix keywords getting out of sync with actual argument order. 2008-08-13 Paul Pogonyshev Bug 547495 – wrap four important asynchronous methods in gio.Drive and gio.Mount * gio/gio.defs (gio.Drive.eject, gio.Drive.poll_for_media) (gio.Mount.remount): Document. * gio/gio.override (_wrap_g_drive_eject) (_wrap_g_drive_poll_for_media, _wrap_g_mount_eject) (_wrap_g_mount_remount): New functions. 2008-08-12 Paul Pogonyshev Bug 547484 – wrap gio.DataInputStream.read_line and ...read_until * tests/test_gio.py (TestDataInputStream): New test case. * gio/gio.defs (gio.DataInputStream.read_line) (gio.DataInputStream.read_until): Document. * gio/ginputstream.override (_wrap_g_data_input_stream_read_line) (_wrap_g_data_input_stream_read_until): New functions. 2008-08-12 Paul Pogonyshev Bug 547354 – wrap a few memory stream methods * gio/ginputstream.override (_wrap_g_memory_input_stream_add_data): New function. * gio/gio.defs (gio.MemoryOutputStream.get_contents): Rename from get_data() to avoid name clash. * gio/goutputstream.override (_wrap_g_memory_output_stream_new) (_wrap_g_memory_output_stream_get_data): New functions. * tests/test_gio.py (TestMemoryInputStream) (TestMemoryOutputStream): New test cases. 2008-08-12 Paul Pogonyshev * gio/gio.override: Ignore `g_io_module*' and `g_io_scheduler_*'. 2008-08-11 Paul Pogonyshev Bug 540376 – No TypeError raised when type is None * gobject/gobjectmodule.c (pyg_signal_new): Add check on second argument type. * tests/test_signal.py (TestSignalCreation): New test case. 2008-08-11 Paul Pogonyshev Bug 547104 – improve type wrapper creation * gio/gappinfo.override (_wrap_g_app_info_tp_richcompare) (_wrap_g_app_info_tp_repr): New functions. * tests/test_gio.py (TestAppInfo.test_eq): New test. 2008-08-11 Paul Pogonyshev Bug 547104 – improve type wrapper creation * gobject/pygobject.c (pygobject_register_class): Use new pygobject_inherit_slots() to propagate custom slots in normal types too. (pygobject_inherit_slots): New function, break out of pygobject_new_with_interfaces() and rewrite a bit. (pygobject_find_slot_for): Add new argument that can forbid overriding non-NULL slots. * gio/gicon.override (pygio_do_icon_richcompare): Remove, the code is now directly in _wrap_g_icon_tp_richcompare(). (_wrap_g_file_icon_tp_richcompare, _wrap_g_file_icon_tp_hash) (_wrap_g_themed_icon_tp_richcompare, _wrap_g_themed_icon_tp_hash): Remove, duplicating code in this way is not needed anymore. 2008-08-10 Paul Pogonyshev Bug 546120 – make gio.File more Pythonic * gio/gfile.override (_wrap_g_file_tp_richcompare) (_wrap_g_file_tp_hash, _wrap_g_file_tp_repr): New functions. * tests/test_gio.py (TestFile.test_eq, TestFile.test_hash): New tests. 2008-08-10 Paul Pogonyshev Bug 547104 – improve runtime type wrapper creation * gobject/pygobject.c (pygobject_new_with_interfaces): Use new pygobject_find_slot_for() for `tp_richcompare', `tp_compare`, `tp_hash', `tp_iter', `tp_repr', `tp_str' and `tp_print'. (pygobject_find_slot_for): New static function. 2008-08-10 Jonathan Matthew Bug 547134 – fix docstring line length * gio/gio.defs: Fix docstring line lengths so they don't wrap across lines in an 80 column terminal. 2008-08-10 Gian Mario Tagliaretti * gio/gio.defs: Add GFile.query_default_handler which was missing from the defs. 2008-08-10 Jonathan Matthew Bug 547067 – add File.replace_contents, replace_contents_async, replace_contents_finish. * gio/gfile.override: * gio/gio.defs: * tests/test_gio.py: Add overrides, docs, and tests for File.replace_contents, replace_contents_async, and replace_contents_finish. 2008-08-09 Paul Pogonyshev * tests/test_gicon.py (TestThemedIcon.test_constructor): Fix to not use `use_default_fallbacks' property (it's new). 2008-08-09 Paul Pogonyshev Bug 546135 – GIcon and implementations improvements * gio/gio.defs (g_file_icon_new): Change from method of gio.File to constructor of gio.FileIcon. * tests/test_gicon.py (TestIcon.test_eq, Test_Eq.test_hash) (TestLoadableIcon.setUp): Adapt accordingly. (TestFileIcon): New test case. 2008-08-09 Paul Pogonyshev Bug 546591 – File.copy progress_callback does not work * gio/gfile.override (file_progress_callback_marshal): Use PyObject_CallFunction() instead of PyEval_CallFunction(). Use "K" instead of "k" (the latter is not correct for 32-bit platforms). Don't free 'notify' here. (_wrap_g_file_copy): Free 'notify'. (_wrap_g_file_move): Likewise. * gio/gio.override (pygio_free_notify): New function. (async_result_callback_marshal): Use it. * tests/test_gio.py (TestFile.test_copy_progress.progress): New test. 2008-08-09 Paul Pogonyshev Bug 546135 – GIcon and implementations improvements * gio/gio.defs (gio.LoadableIcon.load) (gio.LoadableIcon.load_async, gio.LoadableIcon.load_finish): Document. * gio/Makefile.am: * gio/gicon.override: New file: parts of 'gio.override', three methods of gio.LoadableIcon and gio.ThemedIcon constructor. * gio/gio.override: Move over all icon-related overrides to 'gicon.override'. * tests/Makefile.am: * tests/test_gicon.py: New file: parts of 'test_gio.py' and several new gio.Icon tests. * tests/test_gio.py (TestThemedIcon): Move over to 'test_gicon.py'. 2008-08-07 Jonathan Matthew Bug 546734 – Missing Py_INCREFs for some file async methods * gio/gfile.override: Increment refcounts on callbacks and callback data for append_to_async, create_async, replace_async, query_info_async and load_contents_async as for all other async methods. 2008-08-06 Johan Dahlin * gio/gfile.override: * gio/gio.defs: Move the progress callback for move/copy so it's consistent with the documentation and positional arguments. Update documentation as well 2008-08-06 Johan Dahlin * glib/pyglib.c (pyglib_enable_threads): * gobject/gobjectmodule.c (pyg_threads_init), (pygobject_enable_threads): Add a pygobject_enable_threads wrapper around pyglib_threads_enable and return 0/-1 which existing gobject based applications expect. 2008-08-06 Johan Dahlin * glib/pyglib.c (pyglib_init): return in case of error instead of trying to access the internal types. 2008-08-06 Paul Pogonyshev * gio/gio.override: Add 'pygio_do_icon_richcompare' prototype to header. (_wrap_g_file_icon_tp_repr, _wrap_g_themed_icon_tp_repr): Fix return value type in signature. 2008-08-05 Paul Pogonyshev Bug 546135 – GIcon and implementations improvements * gio/gio-types.defs (FileIcon): New 'define-object'. * gio/gio.override (pygio_do_icon_richcompare) (_wrap_g_icon_tp_richcompare, _wrap_g_icon_tp_hash) (_wrap_g_file_icon_tp_richcompare, _wrap_g_file_icon_tp_hash) (_wrap_g_file_icon_tp_repr, _wrap_g_themed_icon_tp_richcompare) (_wrap_g_themed_icon_tp_hash, _wrap_g_themed_icon_tp_repr): New functions. 2008-08-03 Gian Mario Tagliaretti Bug 546046 – Wrap GFile.replace_async and query_info_async * tests/test_gio.py: * gio/gfile.override: * gio/gio.defs: Wrap GFile.replace_async and query_info_async with docs and test. 2008-08-03 Paul Pogonyshev * glib/pyglib.h: * glib/pyglib.c (pyglib_enable_threads): Change return value from 'gboolean' to 'int' and changed semantics to Pythonic: restores backwards compatibility. * gobject/gobjectmodule.c (pyg_threads_init): Treat return value accordingly (bug #544946). 2008-08-02 Gian Mario Tagliaretti Bug 546020 – Wrap GFile.create_async * tests/test_gio.py: * gio/gfile.override: * gio/gio.defs: Wrap GFile.create_async with docs and test 2008-08-02 Johan Dahlin * codegen/docgen.py: Remove SGML support, require python 2.4, modernize, PEP-8ify. Make it run on gio. * codegen/definitions.py: Make property iterable * gio/gio.defs: Include the gio-types.defs file. 2008-08-02 Johan Dahlin * glib/glibmodule.c (pyglib_set_prgname): * glib/pygoptioncontext.c (pyg_option_context_init), (pyg_option_context_set_help_enabled), (pyg_option_context_set_ignore_unknown_options), (pyg_option_context_set_main_group), (pyg_option_context_add_group): * glib/pygoptiongroup.c (arg_func), (pyg_option_group_add_entries), (pyg_option_group_set_translation_domain), (pyg_option_group_compare), (pyglib_option_group_register_types): Fix compilation warnings, clean up style and indentation. 2008-08-02 Gian Mario Tagliaretti Bug 545959 – Wrap GFile.append_to_async * tests/test_gio.py: * gio/gfile.override: * gio/gio.defs: Wrap GFile.append_to_async with docs and test 2008-08-02 Johan Dahlin * gio/gfileinfo.override: * gio/gio.override: * glib/glibmodule.c (pyglib_get_current_time): * glib/pyglib.c (pyglib_float_from_timeval): * glib/pyglib.h: Add pyglib_float_from_timeval and use it 2008-08-02 Johan Dahlin * docs/Makefile.am: * docs/reference/pyglib-constants.xml: * docs/reference/pyglib-functions.xml: * docs/reference/pyglib-maincontext.xml: * docs/reference/pyglib-mainloop.xml: * docs/reference/pygobject-classes.xml: * docs/reference/pygobject-constants.xml: * docs/reference/pygobject-functions.xml: * docs/reference/pygobject-maincontext.xml: * docs/reference/pygobject-mainloop.xml: Separate the glib and gobject bindings in the manual. 2008-08-02 Gian Mario Tagliaretti Bug 545920 – Wrap GFile.query_writable_namespaces * tests/test_gio.py: * gio/gfile.override: * gio/gio.defs: Wrap GFile.query_writable_namespaces with docs and test 2008-08-02 Johan Dahlin * gio/gio.defs: * gio/gfile.override: * tests/test_gio.py: Wrap gio.File.move 2008-08-02 Johan Dahlin * gio/Makefile.am: * gio/gfile.override: * gio/gio.defs: * gio/gio.override: * gio/gvolume.override: Wrap gio.Volume.mount and gio.Volume.eject 2008-08-01 Gian Mario Tagliaretti * gio/gio.defs: Add docstring for gio.FileInfo.list_attributes 2008-08-01 Johan Dahlin Bug 545861 – g_file_info_get_modification_time is missing * gio/gfileinfo.override: * gio/gio.defs: * tests/test_gio.py: Wrap, add test and documentation 2008-08-01 Johan Dahlin Bug 545846 – g_vfs_get_supported_uri_schemes is missing * gio/gio.defs: * gio/gio.override: * tests/test_gio.py: Wrap, add test and documentation 2008-08-01 Johan Dahlin * glib/glibmodule.c (pyglib_set_application_name): Use %r instead of %s, this is not python! 2008-07-31 Johan Dahlin * glib/glibmodule.c (pyglib_set_prgname) (pyglib_set_application_name): Use METH_O instead of METH_VARARGS. (_glib_functions): Add doc strings for idle_add, timeout_add, timeout_add_seconds, io_add_watch, child_watch_add, source_remove, main_depth and main_context_default. 2008-07-29 Gian Mario Tagliaretti * tests/test_gio.py: * gio/gfileattribute.override: * gio/gio.override: * gio/gio.defs: * gio/gfile.override: * gio/Makefile.am: Wrap new object gio.FileAttributeInfo, g_file_set_attribute and g_file_query_settable_attributes methods. 2008-07-29 Gian Mario Tagliaretti * gio/unix-types.defs: Wrap gio.unix.DesktopAppInfo * gio/gappinfo.override: * gio/gio.override: * gio/gio.defs: * gio/gapplaunchcontext.override: * gio/Makefile.am: Wrap g_app_info_launch_uris, g_app_info_launch, g_app_launch_context_get_display and g_app_launch_context_get_startup_notify_id * gio/pygio-utils.c: * gio/pygio-utils.h: Add a couple of useful function to reduce the code in wrapped methods. 2008-07-29 Johan Dahlin * examples/gio/downloader.py: * gio/giomodule.c (init_gio): Add gio.FILE_ATTRIBUTE_* constants and update the examples to use them. 2008-07-29 Johan Dahlin * examples/gio/downloader.py: Add a new example * gio/ginputstream.override: Use a string internally instead of a PyStringObject when in read_async. Create a new python string in finish and honor the number of bytes read. 2008-07-28 Johan Dahlin * glib/pyglib-python-compat.h: * gobject/pygobject-private.h: Move all compatibility into the same place, fixes build on python 2.4. 2008-07-27 Johan Dahlin * glib/option.py: Remove tabs. Use sys.exc_info()[1] to fetch the exception value * gobject/__init__.py: * gobject/propertyhelper.py: Import gobject._gobject instead of just gobject. * gobject/Makefile.am: * gobject/constants.py.in: * gobject/generate-constants.c (main): Don't add long suffix if python >= 3.0 2008-07-27 Johan Dahlin * glib/pyglib-python-compat.h: * gobject/gobjectmodule.c (pyg_object_new), (pyg__install_metaclass): * gobject/pygboxed.c (pyg_boxed_dealloc), (pyg_boxed_init), (pyg_register_boxed): * gobject/pygenum.c (pyg_enum_reduce): * gobject/pyginterface.c (pyg_interface_init), (pyg_register_interface): * gobject/pygobject.c (pygobject_get_inst_data), (pygobject_register_class), (pygobject_new_with_interfaces), (pygobject_dealloc), (pygobject_repr), (pygobject_emit), (pygobject_chain_from_overridden), (pygobject_weak_ref_notify): * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygpointer.c (pyg_pointer_dealloc), (pyg_pointer_init), (pyg_register_pointer): * gobject/pygtype.c (pyg_type_from_object), (pyg_value_array_from_pyobject), (pyg_value_from_pyobject), (pyg_object_descr_doc_get): Use the Py_TYPE macro everywhere. 2008-07-27 Johan Dahlin * glib/pyglib-python-compat.h: Add a Py_TYPE macro for accessing ob_type. * glib/glibmodule.c (pyglib_register_constants): * gobject/gobjectmodule.c (pygobject__g_instance_init), (pyg_integer_richcompare): * gobject/pygenum.c (pyg_enum_repr), (pyg_enum_from_gtype), (pyg_enum_add), (pyg_enum_get_value_name), (pyg_enum_get_value_nick): * gobject/pygflags.c (pyg_flags_repr), (pyg_flags_from_gtype), (pyg_flags_add), (pyg_flags_and), (pyg_flags_or), (pyg_flags_xor), (pyg_flags_get_first_value_name), (pyg_flags_get_first_value_nick), (pyg_flags_get_value_names), (pyg_flags_get_value_nicks): Use Py_TYPE and PyLong macros to access struct fields 2008-07-27 Johan Dahlin * gobject/gobjectmodule.c (pyg_param_spec_from_object), (add_properties), (pyg_signal_new), (pyg_signal_list_ids), (pyg_signal_lookup), (pyg_signal_query): * gobject/pygenum.c (pyg_enum_richcompare), (pyg_enum_new), (pyg_enum_from_gtype), (pyg_enum_add), (pyg_enum_reduce), (pygobject_enum_register_types): * gobject/pygflags.c (pyg_flags_richcompare), (pyg_flags_new), (pyg_flags_from_gtype), (pyg_flags_add), (pyg_flags_and), (pyg_flags_or), (pyg_flags_xor), (pygobject_flags_register_types): * gobject/pygobject-private.h: * gobject/pygobject.c (pygobject_disconnect_by_func), (pygobject_handler_block_by_func), (pygobject_handler_unblock_by_func), (pygobject_get_refcount): * gobject/pygparamspec.c (pyg_param_spec_getattr): * gobject/pygtype.c (_wrap_g_type_wrapper__get_depth), (pyg_type_from_object), (pyg_enum_get_value), (pyg_flags_get_value), (pyg_value_from_pyobject), (pyg_value_as_pyobject): Use _PyLong macros. 2008-07-27 Johan Dahlin * gobject/pygboxed.c (pygobject_boxed_register_types): * gobject/pygenum.c (pygobject_enum_register_types): * gobject/pygflags.c (pygobject_flags_register_types): * gobject/pygobject.c (pygobject_object_register_types): * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygpointer.c (pygobject_pointer_register_types): * gobject/pygtype.c (pygobject_type_register_types): Use PYGLIB_DEFINE_TYPE macro and move struct field initialization to the registration methods. 2008-07-27 Johan Dahlin * glib/pyglib-python-compat.h: Add _PyUnicode_Type macro * gobject/gobjectmodule.c (pyg_type_name), (pyg_type_from_name), (_pyg_signal_accumulator), (add_signals), (add_properties), (get_type_name_for_class), (pyg_signal_list_names), (pyg_signal_name), (pyg_signal_query), (pyg_object_new), (pyg_add_emission_hook), (pyg_remove_emission_hook): * gobject/pygboxed.c (pyg_boxed_repr): * gobject/pygenum.c (pyg_enum_repr), (pyg_enum_add), (pyg_enum_get_value_name), (pyg_enum_get_value_nick): * gobject/pygflags.c (pyg_flags_repr), (pyg_flags_add), (pyg_flags_get_first_value_name), (pyg_flags_get_first_value_nick), (pyg_flags_get_value_names), (pyg_flags_get_value_nicks): * gobject/pygobject.c (build_parameter_list), (PyGProps_getattro), (PyGProps_setattro), (pygobject_register_class), (pygobject_repr), (pygobject_init), (pygobject_get_properties), (pygobject_set_properties), (pygobject_connect), (pygobject_connect_after), (pygobject_connect_object), (pygobject_connect_object_after), (pygobject_emit), (pygobject_stop_emission), (pygobject_disconnect_by_func), (pygobject_handler_block_by_func), (pygobject_handler_unblock_by_func), (pygobject_object_register_types): * gobject/pygparamspec.c (pyg_param_spec_repr), (pyg_param_spec_getattr): * gobject/pygpointer.c (pyg_pointer_repr): * gobject/pygtype.c (pyg_type_wrapper_repr), (_wrap_g_type_wrapper__get_name), (pyg_type_from_object), (pyg_enum_get_value), (pyg_flags_get_value), (pyg_value_from_pyobject), (pyg_value_as_pyobject), (object_doc_descr_get), (_pyg_strv_from_gvalue), (_pyg_strv_to_gvalue): Use _PyUnicode_* macros in the gobject module 2008-07-27 Johan Dahlin * gobject/Makefile.am: * gobject/gobjectmodule.c (PYGLIB_MODULE_START): * gobject/pygobject-private.h: Use glib macros to define the module, update export regexp. 2008-07-27 Johan Dahlin * gobject/Makefile.am: * gobject/gobjectmodule.c (init_gobject): * gobject/pygboxed.c (pygobject_boxed_register_types): * gobject/pygboxed.h: * gobject/pygenum.c (pygobject_enum_register_types): * gobject/pygenum.h: * gobject/pygflags.c (pygobject_flags_register_types): * gobject/pygflags.h: * gobject/pygpointer.c (pygobject_pointer_register_types): * gobject/pygpointer.h: Split out quark and type registration to the respective implementation source files, add headers. 2008-07-27 Johan Dahlin * gobject/Makefile.am: * gobject/gobjectmodule.c (pygobject_register_api), (pygobject_register_constants), (pygobject_register_features), (pygobject_register_version_tuples), (pygobject_register_warnings), (init_gobject): * gobject/pygobject-private.h: * gobject/pygobject.c (pyobject_copy), (pyobject_free), (pygobject_object_register_types): * gobject/pygtype.c (_pyg_strv_from_gvalue), (_pyg_strv_to_gvalue), (pygobject_type_register_types): * gobject/pygtype.h: Move off a bit more to separate functions, cleaning up the init_glib a bit more. 2008-07-27 Johan Dahlin * gobject/Makefile.am: * gobject/gobjectmodule.c (init_gobject): * gobject/pygobject-private.h: * gobject/pygobject.c: * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygparamspec.h: * gobject/pygtype.c: Move paramspec registration to a separate file, add a header for the internal API. 2008-07-27 Paul Pogonyshev * gobject/pygtype.c (pyg_enum_get_value): Issue warning if 'obj' is a PyGEnum of wrong type, i.e. not matching 'enum_type' (bug #503771).