Re: problem with FileChooserDialog in latest git



On Wed, Dec 29, 2010 at 2:51 AM, Simon van der Linden
<svdlinden gnome org> wrote:
> As Tomeu suggested, could you check the presence of inherited methods?

I am not sure which methods would matter to you specifically, so how's
this look to you?

$ jhbuild run python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from gi.repository import Clutter, GtkChamplain, Gtk

>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
Gtk-Message: Failed to load module "pk-gtk-module":
libpk-gtk-module.so: cannot open shared object file: No such file or
directory
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings
will not be saved or shared with other applications.

>>> dir(dialog)
['__bool__', '__class__', '__contains__', '__copy__', '__deepcopy__',
'__delattr__', '__dict__', '__doc__', '__eq__', '__format__',
'__gdoc__', '__ge__', '__getattribute__', '__gobject_init__',
'__grefcount__', '__gt__', '__gtype__', '__hash__', '__info__',
'__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__',
'__ne__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__',
'__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', '__weakref__', 'activate', 'activate_default',
'activate_focus', 'activate_key', 'add', 'add_accel_group',
'add_accelerator', 'add_action_widget', 'add_button', 'add_buttons',
'add_child', 'add_device_events', 'add_events', 'add_filter',
'add_mnemonic', 'add_mnemonic_label', 'add_shortcut_folder',
'add_shortcut_folder_uri', 'begin_move_drag', 'begin_resize_drag',
'bin', 'can_activate_accel', 'chain', 'check_resize', 'child_focus',
'child_get_property', 'child_notify', 'child_set_property',
'child_type', 'class_path', 'compute_expand', 'connect',
'connect_after', 'connect_object', 'connect_object_after',
'construct_child', 'container', 'create_pango_context',
'create_pango_layout', 'custom_finished', 'custom_tag_end',
'custom_tag_start', 'deiconify', 'destroy', 'destroyed',
'device_is_shadowed', 'disconnect', 'disconnect_by_func', 'draw',
'emit', 'emit_stop_by_name', 'ensure_style', 'error_bell', 'event',
'foreach', 'freeze_child_notify', 'freeze_notify', 'fullscreen',
'get_accept_focus', 'get_accessible', 'get_action', 'get_action_area',
'get_allocated_height', 'get_allocated_width', 'get_allocation',
'get_ancestor', 'get_app_paintable', 'get_border_width',
'get_can_default', 'get_can_focus', 'get_child',
'get_child_requisition', 'get_child_visible', 'get_children',
'get_clipboard', 'get_composite_name', 'get_content_area',
'get_create_folders', 'get_current_folder', 'get_current_folder_file',
'get_current_folder_uri', 'get_data', 'get_decorated',
'get_default_direction', 'get_default_icon_list',
'get_default_icon_name', 'get_default_size', 'get_default_style',
'get_default_widget', 'get_deletable', 'get_destroy_with_parent',
'get_device_events', 'get_direction', 'get_display',
'get_do_overwrite_confirmation', 'get_double_buffered', 'get_events',
'get_extra_widget', 'get_file', 'get_filename', 'get_filenames',
'get_files', 'get_filter', 'get_focus', 'get_focus_chain',
'get_focus_hadjustment', 'get_focus_on_map', 'get_focus_vadjustment',
'get_gravity', 'get_group', 'get_halign', 'get_has_resize_grip',
'get_has_tooltip', 'get_has_window', 'get_hexpand', 'get_hexpand_set',
'get_icon', 'get_icon_list', 'get_icon_name', 'get_internal_child',
'get_local_only', 'get_mapped', 'get_margin_bottom',
'get_margin_left', 'get_margin_right', 'get_margin_top',
'get_mnemonic_modifier', 'get_mnemonics_visible', 'get_modal',
'get_modifier_style', 'get_name', 'get_no_show_all', 'get_opacity',
'get_pango_context', 'get_parent', 'get_parent_window', 'get_path',
'get_path_for_child', 'get_pointer', 'get_position',
'get_preferred_height', 'get_preferred_height_for_width',
'get_preferred_size', 'get_preferred_width',
'get_preferred_width_for_height', 'get_preview_file',
'get_preview_filename', 'get_preview_uri', 'get_preview_widget',
'get_preview_widget_active', 'get_properties', 'get_property',
'get_realized', 'get_receives_default', 'get_request_mode',
'get_requisition', 'get_resizable', 'get_resize_grip_area',
'get_resize_mode', 'get_response_for_widget', 'get_role',
'get_root_window', 'get_screen', 'get_select_multiple',
'get_sensitive', 'get_settings', 'get_show_hidden', 'get_size',
'get_size_request', 'get_skip_pager_hint', 'get_skip_taskbar_hint',
'get_state', 'get_state_flags', 'get_style', 'get_style_context',
'get_support_multidevice', 'get_title', 'get_tooltip_markup',
'get_tooltip_text', 'get_tooltip_window', 'get_toplevel',
'get_transient_for', 'get_type_hint', 'get_urgency_hint', 'get_uri',
'get_uris', 'get_use_preview_label', 'get_valign', 'get_vexpand',
'get_vexpand_set', 'get_visible', 'get_visual',
'get_widget_for_response', 'get_window', 'get_window_type',
'grab_default', 'grab_focus', 'handler_block',
'handler_block_by_func', 'handler_disconnect', 'handler_is_connected',
'handler_unblock', 'handler_unblock_by_func', 'has_default',
'has_focus', 'has_grab', 'has_group', 'has_rc_style', 'has_screen',
'has_toplevel_focus', 'hide', 'hide_on_delete', 'iconify',
'in_destruction', 'input_shape_combine_region', 'intersect',
'is_active', 'is_ancestor', 'is_composited', 'is_drawable',
'is_focus', 'is_sensitive', 'is_toplevel', 'keynav_failed',
'list_accel_closures', 'list_filters', 'list_mnemonic_labels',
'list_shortcut_folder_uris', 'list_shortcut_folders',
'list_toplevels', 'map', 'maximize', 'mnemonic_activate',
'modify_base', 'modify_bg', 'modify_cursor', 'modify_fg',
'modify_font', 'modify_style', 'modify_text', 'move', 'new', 'notify',
'override_background_color', 'override_color', 'override_cursor',
'override_font', 'override_symbolic_color', 'parent_instance',
'parse_geometry', 'parser_finished', 'path', 'pop_composite_child',
'present', 'present_with_time', 'priv', 'propagate_draw',
'propagate_key_event', 'props', 'push_composite_child',
'queue_compute_expand', 'queue_draw', 'queue_draw_area',
'queue_draw_region', 'queue_resize', 'queue_resize_no_redraw',
'realize', 'region_intersect', 'remove', 'remove_accel_group',
'remove_accelerator', 'remove_filter', 'remove_mnemonic',
'remove_mnemonic_label', 'remove_shortcut_folder',
'remove_shortcut_folder_uri', 'render_icon', 'render_icon_pixbuf',
'reparent', 'reset_rc_styles', 'reset_style',
'reshow_with_initial_size', 'resize', 'resize_children',
'resize_grip_is_visible', 'resize_to_geometry', 'response', 'run',
'select_all', 'select_file', 'select_filename', 'select_uri',
'send_expose', 'send_focus_change', 'set_accel_path',
'set_accept_focus', 'set_action', 'set_allocation',
'set_alternative_button_order_from_array', 'set_app_paintable',
'set_application', 'set_auto_startup_notification',
'set_border_width', 'set_buildable_property', 'set_can_default',
'set_can_focus', 'set_child_visible', 'set_composite_name',
'set_create_folders', 'set_current_folder', 'set_current_folder_file',
'set_current_folder_uri', 'set_current_name', 'set_data',
'set_decorated', 'set_default', 'set_default_direction',
'set_default_geometry', 'set_default_icon',
'set_default_icon_from_file', 'set_default_icon_list',
'set_default_icon_name', 'set_default_response', 'set_default_size',
'set_deletable', 'set_destroy_with_parent', 'set_device_events',
'set_direction', 'set_do_overwrite_confirmation',
'set_double_buffered', 'set_events', 'set_extra_widget', 'set_file',
'set_filename', 'set_filter', 'set_focus', 'set_focus_chain',
'set_focus_child', 'set_focus_hadjustment', 'set_focus_on_map',
'set_focus_vadjustment', 'set_geometry_hints', 'set_gravity',
'set_halign', 'set_has_resize_grip', 'set_has_tooltip',
'set_has_window', 'set_hexpand', 'set_hexpand_set', 'set_icon',
'set_icon_from_file', 'set_icon_list', 'set_icon_name',
'set_keep_above', 'set_keep_below', 'set_local_only', 'set_mapped',
'set_margin_bottom', 'set_margin_left', 'set_margin_right',
'set_margin_top', 'set_mnemonic_modifier', 'set_mnemonics_visible',
'set_modal', 'set_name', 'set_no_show_all', 'set_opacity',
'set_parent', 'set_parent_window', 'set_position',
'set_preview_widget', 'set_preview_widget_active', 'set_properties',
'set_property', 'set_realized', 'set_reallocate_redraws',
'set_receives_default', 'set_redraw_on_allocate', 'set_resizable',
'set_resize_mode', 'set_response_sensitive', 'set_role', 'set_screen',
'set_select_multiple', 'set_sensitive', 'set_show_hidden',
'set_size_request', 'set_skip_pager_hint', 'set_skip_taskbar_hint',
'set_startup_id', 'set_state', 'set_state_flags', 'set_style',
'set_support_multidevice', 'set_title', 'set_tooltip_markup',
'set_tooltip_text', 'set_tooltip_window', 'set_transient_for',
'set_type_hint', 'set_urgency_hint', 'set_uri',
'set_use_preview_label', 'set_valign', 'set_vexpand',
'set_vexpand_set', 'set_visible', 'set_visual', 'set_window',
'set_wmclass', 'shape_combine_region', 'show', 'show_all', 'show_now',
'size_allocate', 'size_request', 'stick', 'stop_emission',
'style_attach', 'style_get_property', 'thaw_child_notify',
'thaw_notify', 'translate_coordinates', 'trigger_tooltip_query',
'unfullscreen', 'unmap', 'unmaximize', 'unparent', 'unrealize',
'unselect_all', 'unselect_file', 'unselect_filename', 'unselect_uri',
'unset_focus_chain', 'unset_state_flags', 'unstick', 'weak_ref',
'widget', 'window']

>>> Gtk.FileChooserDialog.__bases__
(<class 'gi.repository.Gtk.FileChooserDialog'>, <class
'gi.overrides.Gtk.Dialog'>)

>>> Clutter.init([])
(<enum CLUTTER_INIT_SUCCESS of type ClutterInitError>, [])

>>> GtkChamplain.Embed()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/gnome/lib64/python2.7/site-packages/gi/module.py", line
237, in __getattr__
    self._import()
  File "/opt/gnome/lib64/python2.7/site-packages/gi/module.py", line
229, in _import
    self._version)
  File "/opt/gnome/lib64/python2.7/site-packages/gi/module.py", line
83, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '2.0', but '3.0'
is already loaded
>>>

(the last error above seems to me quite damning of libchamplain)



And this is what happens when I change the order of the above statements:

$ jhbuild run python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from gi.repository import Clutter, GtkChamplain, Gtk

>>> Clutter.init([])
(<enum CLUTTER_INIT_SUCCESS of type ClutterInitError>, [])

>>> GtkChamplain.Embed()
<Embed object at 0x7f6365c03a00 (GtkChamplainEmbed at 0x1ce5ad0)>

>>> Gtk.FileChooserDialog.__bases__
(<class 'gi.repository.Gtk.FileChooserDialog'>, <class
'gi.overrides.Gtk.Dialog'>)

>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
line 456, in __init__
    buttons=buttons)
  File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
line 371, in __init__
    self.add_buttons(*buttons)
  File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
line 393, in add_buttons
    self.add_button(text, response)
AttributeError: 'FileChooserDialog' object has no attribute 'add_button'

>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN)
>>> dir(dialog)
['__bool__', '__class__', '__contains__', '__copy__', '__deepcopy__',
'__delattr__', '__dict__', '__doc__', '__eq__', '__format__',
'__gdoc__', '__ge__', '__getattribute__', '__gobject_init__',
'__grefcount__', '__gt__', '__gtype__', '__hash__', '__info__',
'__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__',
'__ne__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__',
'__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', '__weakref__', 'action_area', 'activate',
'activate_default', 'activate_focus', 'activate_key', 'add',
'add_accel_group', 'add_accelerator', 'add_action_widget',
'add_arg_type', 'add_buttons', 'add_child', 'add_embedded_xid',
'add_events', 'add_filter', 'add_mnemonic', 'add_mnemonic_label',
'add_shortcut_folder', 'add_shortcut_folder_uri', 'allocation',
'allow_grow', 'allow_shrink', 'begin_move_drag', 'begin_resize_drag',
'bin', 'border_width', 'can_activate_accel', 'chain', 'check_resize',
'child', 'child_focus', 'child_get_property', 'child_notify',
'child_set_property', 'child_type', 'class_path',
'configure_notify_received', 'configure_request_count', 'connect',
'connect_after', 'connect_object', 'connect_object_after',
'container', 'custom_finished', 'custom_tag_end', 'custom_tag_start',
'decorated', 'default_widget', 'deiconify', 'destroy',
'destroy_with_parent', 'destroyed', 'disconnect',
'disconnect_by_func', 'draw', 'emit', 'emit_stop_by_name',
'ensure_style', 'error_bell', 'event', 'flags', 'focus_child',
'focus_widget', 'frame', 'frame_bottom', 'frame_left', 'frame_right',
'frame_top', 'freeze_child_notify', 'freeze_notify', 'fullscreen',
'geometry_info', 'get_accept_focus', 'get_accessible', 'get_action',
'get_action_area', 'get_allocation', 'get_ancestor',
'get_app_paintable', 'get_border_width', 'get_can_default',
'get_can_focus', 'get_child', 'get_child_requisition',
'get_child_visible', 'get_children', 'get_clipboard', 'get_colormap',
'get_composite_name', 'get_content_area', 'get_create_folders',
'get_current_folder', 'get_current_folder_uri', 'get_data',
'get_decorated', 'get_default_colormap', 'get_default_direction',
'get_default_icon_name', 'get_default_size', 'get_default_style',
'get_default_visual', 'get_deletable', 'get_destroy_with_parent',
'get_direction', 'get_display', 'get_do_overwrite_confirmation',
'get_double_buffered', 'get_events', 'get_extension_events',
'get_filename', 'get_filenames', 'get_files', 'get_focus',
'get_focus_chain', 'get_focus_hadjustment', 'get_focus_on_map',
'get_focus_vadjustment', 'get_frame_dimensions', 'get_gravity',
'get_group', 'get_has_frame', 'get_has_separator', 'get_has_tooltip',
'get_has_window', 'get_icon', 'get_icon_list', 'get_icon_name',
'get_local_only', 'get_mapped', 'get_mnemonic_modifier',
'get_mnemonics_visible', 'get_modal', 'get_modifier_style',
'get_name', 'get_no_show_all', 'get_opacity', 'get_pango_context',
'get_parent', 'get_parent_window', 'get_pointer', 'get_position',
'get_preview_filename', 'get_preview_uri',
'get_preview_widget_active', 'get_properties', 'get_property',
'get_realized', 'get_receives_default', 'get_requisition',
'get_resizable', 'get_resize_mode', 'get_response_for_widget',
'get_role', 'get_root_window', 'get_screen', 'get_select_multiple',
'get_sensitive', 'get_settings', 'get_show_hidden', 'get_size',
'get_size_request', 'get_skip_pager_hint', 'get_skip_taskbar_hint',
'get_state', 'get_style', 'get_title', 'get_tooltip_markup',
'get_tooltip_text', 'get_tooltip_window', 'get_toplevel',
'get_transient_for', 'get_type_hint', 'get_urgency_hint', 'get_uri',
'get_uris', 'get_use_preview_label', 'get_visible', 'get_visual',
'get_window', 'get_window_type', 'grab_default', 'grab_focus',
'gravity', 'group', 'handler_block', 'handler_block_by_func',
'handler_disconnect', 'handler_is_connected', 'handler_unblock',
'handler_unblock_by_func', 'has_default', 'has_focus',
'has_focus_chain', 'has_frame', 'has_grab', 'has_group',
'has_rc_style', 'has_screen', 'has_toplevel_focus',
'has_user_ref_count', 'hide', 'hide_all', 'hide_on_delete', 'iconify',
'iconify_initially', 'input_shape_combine_mask', 'intersect',
'is_active', 'is_ancestor', 'is_composited', 'is_drawable',
'is_focus', 'is_sensitive', 'is_toplevel', 'keynav_failed',
'keys_changed_handler', 'list_accel_closures', 'list_filters',
'list_mnemonic_labels', 'list_shortcut_folder_uris',
'list_shortcut_folders', 'list_toplevels', 'map', 'maximize',
'maximize_initially', 'mnemonic_activate', 'mnemonic_modifier',
'modal', 'modify_base', 'modify_bg', 'modify_cursor', 'modify_fg',
'modify_font', 'modify_style', 'modify_text', 'move', 'name',
'need_default_position', 'need_default_size', 'need_resize', 'new',
'notify', 'object', 'parent', 'parent_instance', 'parse_geometry',
'parser_finished', 'path', 'pop_colormap', 'pop_composite_child',
'position', 'present', 'present_with_time', 'priv', 'private_flags',
'propagate_expose', 'propagate_key_event', 'props', 'push_colormap',
'push_composite_child', 'queue_clear', 'queue_clear_area',
'queue_draw', 'queue_draw_area', 'queue_resize',
'queue_resize_no_redraw', 'realize', 'reallocate_redraws', 'remove',
'remove_accel_group', 'remove_accelerator', 'remove_data',
'remove_data_by_id', 'remove_embedded_xid', 'remove_filter',
'remove_mnemonic', 'remove_mnemonic_label', 'remove_no_notify',
'remove_no_notify_by_id', 'remove_shortcut_folder',
'remove_shortcut_folder_uri', 'reparent', 'requisition',
'reset_rc_styles', 'reset_shapes', 'reshow_with_initial_size',
'resize', 'resize_children', 'resize_mode', 'response', 'run',
'saved_state', 'screen', 'select_all', 'select_file',
'select_filename', 'select_uri', 'send_expose', 'send_focus_change',
'separator', 'set_accel_path', 'set_accept_focus', 'set_action',
'set_allocation', 'set_alternative_button_order_from_array',
'set_app_paintable', 'set_auto_startup_notification',
'set_border_width', 'set_buildable_property', 'set_can_default',
'set_can_focus', 'set_child_visible', 'set_colormap',
'set_composite_name', 'set_create_folders', 'set_current_folder',
'set_current_folder_file', 'set_current_folder_uri',
'set_current_name', 'set_data', 'set_data_by_id',
'set_data_by_id_full', 'set_data_full', 'set_decorated',
'set_default', 'set_default_colormap', 'set_default_direction',
'set_default_icon', 'set_default_icon_from_file',
'set_default_icon_list', 'set_default_icon_name',
'set_default_response', 'set_default_size', 'set_deletable',
'set_destroy_with_parent', 'set_direction',
'set_do_overwrite_confirmation', 'set_double_buffered', 'set_events',
'set_extension_events', 'set_extra_widget', 'set_file',
'set_filename', 'set_filter', 'set_focus', 'set_focus_chain',
'set_focus_child', 'set_focus_hadjustment', 'set_focus_on_map',
'set_focus_vadjustment', 'set_frame_dimensions', 'set_geometry_hints',
'set_gravity', 'set_has_frame', 'set_has_separator',
'set_has_tooltip', 'set_has_window', 'set_icon', 'set_icon_from_file',
'set_icon_list', 'set_icon_name', 'set_keep_above', 'set_keep_below',
'set_local_only', 'set_mapped', 'set_mnemonic_modifier',
'set_mnemonics_visible', 'set_modal', 'set_name', 'set_no_show_all',
'set_opacity', 'set_parent', 'set_parent_window', 'set_policy',
'set_position', 'set_preview_widget', 'set_preview_widget_active',
'set_properties', 'set_property', 'set_realized',
'set_reallocate_redraws', 'set_receives_default',
'set_redraw_on_allocate', 'set_resizable', 'set_resize_mode',
'set_response_sensitive', 'set_role', 'set_screen',
'set_scroll_adjustments', 'set_select_multiple', 'set_sensitive',
'set_show_hidden', 'set_size_request', 'set_skip_pager_hint',
'set_skip_taskbar_hint', 'set_startup_id', 'set_state', 'set_style',
'set_title', 'set_tooltip_markup', 'set_tooltip_text',
'set_tooltip_window', 'set_transient_for', 'set_type_hint',
'set_uposition', 'set_urgency_hint', 'set_uri',
'set_use_preview_label', 'set_user_data', 'set_usize', 'set_visible',
'set_window', 'set_wmclass', 'shape_combine_mask', 'show', 'show_all',
'show_now', 'sink', 'size_allocate', 'size_request', 'state', 'stick',
'stick_initially', 'stop_emission', 'style', 'style_attach',
'style_get_property', 'thaw_child_notify', 'thaw_notify', 'title',
'transient_parent', 'translate_coordinates', 'trigger_tooltip_query',
'type', 'type_hint', 'unfullscreen', 'unmap', 'unmaximize',
'unparent', 'unrealize', 'unref', 'unselect_all', 'unselect_file',
'unselect_filename', 'unselect_uri', 'unset_focus_chain', 'unstick',
'vbox', 'weak_ref', 'weakref', 'weakunref', 'widget', 'window',
'wm_role', 'wmclass_class', 'wmclass_name']
>>>

Does that mean anything to you? add_button is certainly missing from
the second case, where I load libchamplain before gtk, but not the
former.

> I would suggest you to also check the ancestors tree of FileChooserDialog
> (FileChooserDialog.__bases__) in both cases (when libchamplain is
> imported before and when it is not), and look for differences between
> the two.

See above, __bases__ gives identical results in both cases.

-- 
http://exolucere.ca


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]