emesene / emesene-supported-plugins

set of plugins supported by the emesene team
http://www.emesene.org
15 stars 11 forks source link

Idle timer, error loading librarys #70

Closed Stiveknx closed 12 years ago

Stiveknx commented 12 years ago

After 45072e3a53fd4eb52e56b89b4e5a4502e8c98def, I keep getting this error:

Traceback (most recent call last):
  File "/home/stive/.config/emesene2/plugins/idle_status/plugin.py", line 68, in idle_state
    self.timer = extension.get_and_instantiate('idle timer')
  File "/home/stive/emesene/emesene/extension.py", line 616, in get_and_instantiate
    return extension_manager.get_and_instantiate(category_name, *args, **kwargs)
  File "/home/stive/emesene/emesene/extension.py", line 487, in get_and_instantiate
    return category.get_and_instantiate(*args, **kwargs)
  File "/home/stive/emesene/emesene/extension.py", line 310, in get_and_instantiate
    inst = cls(*args, **kwargs)
  File "/home/stive/.config/emesene2/plugins/idle_status/xidletimer.py", line 36, in __init__
    self.xlib       = ctypes.cdll.LoadLibrary('libX11.so')
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libX11.so: cannot open shared object file: No such file or directory

So, I tried to create a link from /usr/lib/x86_64-linux-gnu/libX11.so.6 to /usr/lib/x86_64-linux-gnu/libX11.so That fixed ... But, I'm not sure If I should have this link here and I removed somehow or if anybody has think ...

I guess, using some try/catch you could try to load libX11.so, and in case you have problems to load, use libX11.so.6 or just say that you have this error ...

pepeleproso commented 12 years ago

Problem is I don't know is that .6 at the end can change? maybe we can search for "libX11.so" prefix?

Stiveknx commented 12 years ago

Some googling on web says that may exist a .5 ...

Also, after fixing libX11.so, the error was in libXss.so

Traceback (most recent call last): File "/home/stive/.config/emesene2/plugins/idle_status/plugin.py", line 68, in idle_state self.timer = extension.get_and_instantiate('idle timer') File "/home/stive/emesene/emesene/extension.py", line 616, in get_and_instantiate return extension_manager.get_and_instantiate(category_name, *args, **kwargs) File "/home/stive/emesene/emesene/extension.py", line 487, in get_and_instantiate return category.get_and_instantiate(*args, **kwargs) File "/home/stive/emesene/emesene/extension.py", line 310, in get_and_instantiate inst = cls(*args, **kwargs) File "/home/stive/.config/emesene2/plugins/idle_status/xidletimer.py", line 39, in __init__ self.xss = ctypes.cdll.LoadLibrary('libXss.so') File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary return self._dlltype(name) File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__ self._handle = _dlopen(self._name, mode) OSError: libXss.so: cannot open shared object file: No such file or directory

Here's what I found installed:

$ locate libXss.so /usr/lib/x86_64-linux-gnu/libXss.so.1 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0

PS.: I'm using ubuntu 12.04 (gnome fallback session, with gtk 2). I installed and removed a lot of stuff here, like the player and other things, and some dependencies were removed too, maybe one of them removed the symlink to libX11.so

The package "libx11-6" is Installed ( also tried to reinstall see if the link was created)...

well, if you install the package libx11-6, this package provides the libX11.so.6 file ... This can be a dependency of emesene, and every users will have this lib available.

Stiveknx commented 12 years ago

One question, not sure if is related to this bug or not...

The plugin set my status to online after some time (when I leave the computer and come back...) But, it does that every time, and, let's say, my status is invisible, if I stay some time afk, than I come back, the status is set to online...

If the bug is not related to this issue, I can create a new one ... I couldn't reproduce, cause in line 80 in plugin, you check if the status is idle... https://github.com/emesene/emesene-supported-plugins/blob/master/idle_status/plugin.py#L80

Unless, the plugin is not checking if the emesene status is really idle, the is_idle variable is created by the plugin itself

pepeleproso commented 12 years ago

Seeing the code I see we need to store the current status and restore it later. we currently always set online status. Please open a new issue for that.