Bug 737112 - [abrt] openbox-3.5.0-1.fc16: openbox-xdg-menu:22:<module>:ImportError: No module named gmenu
Summary: [abrt] openbox-3.5.0-1.fc16: openbox-xdg-menu:22:<module>:ImportError: No mod...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openbox
Version: 16
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:846f26e014cdbdf78747714db37...
: 737025 741038 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-09 16:22 UTC by Michael Schwendt
Modified: 2011-10-25 13:16 UTC (History)
8 users (show)

Fixed In Version: openbox-3.5.0-3.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-17 00:44:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
xdg menu script that uses pyxdg (2.59 KB, text/plain)
2011-09-12 14:49 UTC, Edward Sheldrake
no flags Details
xdg-menu using pyxdg and gtk via introspection (2.82 KB, text/plain)
2011-09-13 13:04 UTC, Edward Sheldrake
no flags Details
xdg-menu using pyxdg and gtk via introspection (2.89 KB, text/x-python)
2011-09-28 12:48 UTC, Edward Sheldrake
no flags Details
xdg-menu using just pyxdg for menus, no icons (2.20 KB, text/x-python)
2011-09-28 12:49 UTC, Edward Sheldrake
no flags Details
Fix for menu items missing icons (334 bytes, patch)
2011-10-10 07:11 UTC, Ralph Giles
giles: review?
Details | Diff
revised xdg-menu incorporating Ralph Giles' fix (2.90 KB, patch)
2011-10-10 07:48 UTC, Edward Sheldrake
no flags Details | Diff

Description Michael Schwendt 2011-09-09 16:22:03 UTC
abrt version: 2.0.5
cmdline:        
comment:        Found in abrt-gui list of unsubmitted reports. Very likely related to bug 737025.
executable:     /usr/libexec/openbox-xdg-menu
kernel:         3.0.1-3.fc16.x86_64
reason:         openbox-xdg-menu:22:<module>:ImportError: No module named gmenu
time:           Fri Sep  9 13:43:57 2011
uid:            1000
username:       misc16

backtrace:
:openbox-xdg-menu:22:<module>:ImportError: No module named gmenu
:
:Traceback (most recent call last):
:  File "/usr/libexec/openbox-xdg-menu", line 22, in <module>
:    import gmenu, re, sys
:ImportError: No module named gmenu
:
:Local variables in innermost frame:
:__builtins__: <module '__builtin__' (built-in)>
:__name__: '__main__'
:__file__: '/usr/libexec/openbox-xdg-menu'
:__doc__: None
:__package__: None

Comment 1 Christoph Wickert 2011-09-09 18:32:50 UTC
Indeed, this is related, it is the cause for bug 737025. The python module is no longer shipped.

We should think about an alternative to the current openbox-xdg-menu, for example the one from https://launchpad.net/openbox-xdgmenu or http://mimasgpc.free.fr/openbox-menu_en.html. I already packaged the latter, but it requires LXDE's menu-cache.

Comment 2 Christoph Wickert 2011-09-09 18:33:37 UTC
*** Bug 737025 has been marked as a duplicate of this bug. ***

Comment 3 Christoph Wickert 2011-09-09 18:35:46 UTC
I have asked on desktop-list if the removal of the python module was intended, see http://lists.fedoraproject.org/pipermail/desktop/2011-September/007375.html

For a complete list of alternatives, see http://openbox.org/wiki/Openbox:Pipemenus#XDG_Application_Menus

Comment 4 Edward Sheldrake 2011-09-12 14:49:01 UTC
Created attachment 522717 [details]
xdg menu script that uses pyxdg

I have modified the xdg-menu python script to use the menu in pyxdg rather than gnome-menus. I also added icons and handled -caption for KDE .desktop files.

It gives virtually identical output as the original, except I've gained a "GGZ Gaming Zone" submenu. It also does case insensitive sorting e.g. gedit is after Files.

Minor issue: openbox (imlib2) cannot display .svg or .ico icons.

Comment 5 Edward Sheldrake 2011-09-13 13:04:32 UTC
Created attachment 522925 [details]
xdg-menu using pyxdg and gtk via introspection

According to the NEWS file in gnome-menus, the python bindings got removed because you're supposed to use the gobject-introspection bindings instead.

So I re-wrote the modified script to use Gtk (used to lookup icons) via introspection instead of using the deprecated pygtk2. I did try looking up icons using pyxdg earlier but it was too slow and there's no way to get the icon theme name.

Removing the icon stuff would reduce deps, and Fedora's openbox hasn't been built with imlib2.

Comment 6 Christoph Wickert 2011-09-24 16:00:49 UTC
*** Bug 741038 has been marked as a duplicate of this bug. ***

Comment 7 Edward Sheldrake 2011-09-28 12:48:07 UTC
Created attachment 525333 [details]
xdg-menu using pyxdg and gtk via introspection

revised version, the previous attempt had encoding issues, and this one also produces a menu without icons if it can't import gtk.

Comment 8 Edward Sheldrake 2011-09-28 12:49:49 UTC
Created attachment 525334 [details]
xdg-menu using just pyxdg for menus, no icons

version with the icon stuff stripped out.

Comment 9 Miroslav Lichvar 2011-09-30 11:41:43 UTC
I've included the icon xdg-menu version, should be in openbox-3.5.0-2. It looks really cool, thanks!

Comment 10 Fedora Update System 2011-09-30 11:52:37 UTC
openbox-3.5.0-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/openbox-3.5.0-2.fc16

Comment 11 Fedora Update System 2011-09-30 18:36:30 UTC
Package openbox-3.5.0-2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openbox-3.5.0-2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/openbox-3.5.0-2.fc16
then log in and leave karma (feedback).

Comment 12 Simon A. Erat 2011-10-01 13:31:40 UTC
(In reply to comment #11)
> Package openbox-3.5.0-2.fc16:
> * should fix your issue,
> * was pushed to the Fedora 16 testing repository,
> * should be available at your local mirror within two days.
> Update it with:
> # su -c 'yum update --enablerepo=updates-testing openbox-3.5.0-2.fc16'
> as soon as you are able to.
> Please go to the following url:
> https://admin.fedoraproject.org/updates/openbox-3.5.0-2.fc16
> then log in and leave karma (feedback).

Copy pasted the above line: " su -c 'yum update --enablerepo=updates-testing openbox-3.5.0-2.fc16'" into my background shell.
With 3.1.0-0.rc8.git0.0.fc16.x86_64, it shows a weird behaviour, the prompt changes to "-3.5.0-2.fc16'c 'yum update --enablerepo=updates-testing openbox 
" Where as my prompt "bash-4.2$" was removed from the current shell line.

However, already had that version installed, after 'common' update

Comment 13 Simon A. Erat 2011-10-01 13:33:51 UTC
This is how it looks before and after pasting.
> bash-4.2$ uname -a
> Linux l670.matrix 3.1.0-0.rc8.git0.0.fc16.x86_64 #1 SMP Wed Sep 28 01:31:14 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
> -3.5.0-2.fc16'^C'yum update --enablerepo=updates-testing openbox 
> bash-4.2$ su
> Password: 
> ates-testing openbox 16'c 'yum update --enablerepo=upd 
> bash: -3.5.0-2.fc16c yum: command not found
> bash-4.2#

Comment 14 Michael Schwendt 2011-10-01 15:31:11 UTC
Please don't flood this ticket with unrelated issues. The generic update instructions do work fine. Post to a mailing-list if you run into trouble with your personal setup. The stuff you've quoted in comment 13 doesn't make sense at all.

Comment 15 Christoph Wickert 2011-10-01 17:15:09 UTC
(In reply to comment #10)
> openbox-3.5.0-2.fc16 has been submitted as an update for Fedora 16.
> https://admin.fedoraproject.org/updates/openbox-3.5.0-2.fc16

Miroslav, can you delete this update and let me include 3.5.0-2 in 
https://admin.fedoraproject.org/updates/FEDORA-2011-12338 together with the dependent packages instead?

Comment 16 Miroslav Lichvar 2011-10-03 10:43:29 UTC
(In reply to comment #15)
> Miroslav, can you delete this update and let me include 3.5.0-2 in 
> https://admin.fedoraproject.org/updates/FEDORA-2011-12338 together with the
> dependent packages instead?

Oh, I thought that update was already in stable. I made also a new update for obconf (2.0.3-8.20100212gitb04658.fc16), I've unpushed them both. Thanks.

Comment 17 Ben Lambrechts 2011-10-07 09:40:51 UTC
Package: openbox-3.4.11.2-8.fc16
Architecture: i686
OS Release: Fedora release 16 (Verne)

Comment
-----
Just opening openbox and no menuitems where there

Comment 18 Yann Droneaud 2011-10-09 08:55:36 UTC
Package: openbox-3.4.11.2-8.fc16
Architecture: x86_64
OS Release: Fedora release 16 (Verne)

Comment
-----
Can t tell exactly : boot the live cd and clicked on the desktop

Comment 19 Michael Schwendt 2011-10-09 15:42:39 UTC
@ everyone:
https://admin.fedoraproject.org/updates/FEDORA-2011-12338

Comment 20 Ralph Giles 2011-10-10 07:11:34 UTC
Created attachment 527171 [details]
Fix for menu items missing icons

Thanks for fixing the gmenu issue!

On my system, openbox-3.5.0-2.fc16 still fails to generate an Applications menu:

$ /usr/libexec/openbox-xdg-menu 
<?xml version="1.0" encoding="UTF-8"?>
<openbox_pipe_menu>
[...]
<menu id="Education" label="Education" icon="/usr/share/icons/gnome/22x22/categories/applications-science.png">
Traceback (most recent call last):
  File "/usr/libexec/openbox-xdg-menu", line 97, in <module>
    map(walk_menu, menu.getEntries())
  File "/usr/libexec/openbox-xdg-menu", line 63, in walk_menu
    map(walk_menu, entry.getEntries())
  File "/usr/libexec/openbox-xdg-menu", line 68, in walk_menu
    escape(icon_attr(entry.DesktopEntry)))
  File "/usr/libexec/openbox-xdg-menu", line 51, in icon_attr
    return ' icon="' + iconfile + '"'
TypeError: cannot concatenate 'str' and 'NoneType' objects

Presumedly the offending application doesn't list an icon file.

This a simple patch to works around the issue. Let me know if this should be in a separate bug.

Comment 21 Edward Sheldrake 2011-10-10 07:48:31 UTC
Created attachment 527176 [details]
revised xdg-menu incorporating Ralph Giles' fix

Previous version ended up broken when SVG is the only icon format available.

Comment 22 Miroslav Lichvar 2011-10-10 13:52:26 UTC
Included in openbox-3.5.0-3.fc16. Thanks.

Comment 23 Fedora Update System 2011-10-10 13:57:49 UTC
openbox-3.5.0-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/openbox-3.5.0-3.fc16

Comment 24 Fedora Update System 2011-10-17 00:44:09 UTC
openbox-3.5.0-3.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Jimmy Collins 2011-10-24 15:17:40 UTC
I still have the above discussed behavior on F16, but only in the "applications" submenu.

Is there any way to track down the "offending" application with the faulty icon? 

Thanks!

Comment 26 Edward Sheldrake 2011-10-25 09:05:11 UTC
(In reply to comment #25)
> I still have the above discussed behavior on F16, but only in the
> "applications" submenu.
> 
> Is there any way to track down the "offending" application with the faulty
> icon? 
> 
> Thanks!

You can run the xdg-menu script (/usr/libexec/openbox-xdg-menu) in a terminal. It should print out the generated XML until the error, then the error message.

Comment 27 Jimmy Collins 2011-10-25 13:16:58 UTC
No error message, but I did find the problem. 

I'm reusing an existing "Home" partition, and didn't realize how much stuff Wine leaves in /.local.

Thanks! Menus work quite well!


Note You need to log in before you can comment on or make changes to this bug.