We have moved to a new Sailfish OS Forum. Please start new discussions there.
2

[SOLVED] Python, dbus, fingerterm, opening app/script after last update (1.1.1.27) [answered]

asked 2014-12-23 17:09:59 +0200

Schturman gravatar image

updated 2015-02-19 20:09:06 +0200

Hi to all

After last update I have some problem with my apps (scripts). Maybe someone can help me to fix it...

A. CAN'T get notification... if I'll run this command for example:

python /usr/share/openrepos-wazebton/notifer1.py

I get this output:

[root@Jolla ~]# python /usr/share/openrepos-wazebton/notifer1.py
Traceback (most recent call last):
  File "/usr/share/openrepos-wazebton/notifer1.py", line 2, in <module>
    import dbus
ImportError: No module named dbus
[root@Jolla ~]#

The content of notifer1.py is:

#!/usr/bin/python
import dbus

bus = dbus.SessionBus()
object = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
interface = dbus.Interface(object,'org.freedesktop.Notifications')
#print(interface.GetCapabilities())

interface.Notify("app_name",
                 0,
                 "icon-m-notifications",
                 "Waze BT APPLIED !",
                 "Waze & BT starter",
                 dbus.Array(["default", ""]),
                 dbus.Dictionary({"x-nemo-preview-body": "Waze & BT starter",
                                  "x-nemo-preview-summary": "Waze BT APPLIED !"},
                                  signature='sv'),
                 0)

What wrong here ? Why it stopped to work after update ?

B. Strange way to open script via fingerterm. When I press on the .desktop file, it should open fingerterm and start my script inside. All worked perfectly before update, but now it work in different way, see picture: screenshot image

  1. Start window
  2. Open fingerterm window with my script

BUT #2 CAN'T came to foreground automatically, like it was before update. It just stay in this mode like you can see on the image. If you will press on the #2 it came to foreground, and when you close this window it also will close the #1 window. Maybe problem came from python/dbus problem from the first question ?

Can someone help me with this ?

Thanks

EDIT (28:12:14):

Problem #1 solved:

  1. By installation of dbus-python package.

Problem #2 solved:

  1. removed from binary "fingerterm -e" before path to script.

  2. added "fingerterm -e" in the .desktop file before path to binary, like this: sh -c "fingerterm -e /path/to/binary"

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by nthn
close date 2014-12-28 11:39:26.699749

Comments

2 Answers

Sort by » oldest newest most voted
1

answered 2014-12-24 10:14:13 +0200

Rolfa gravatar image

Try to install dbus-python (dbus-python-1.0.0-1.1.6.armv7hl).

edit flag offensive delete publish link more
0

answered 2014-12-23 18:11:37 +0200

Rolfa gravatar image

Did you use python3? There I also have dbus module missing.

But with python2 (version 2.7.6) I can enter "import dbus" without error.

edit flag offensive delete publish link more

Comments

I don't know if it 3 or 2, I just installed python (pkcon install python) and it installed:

[root@Jolla ~]# rpm -qa *python*
python-2.7.6-1.2.4.armv7hl
python-libs-2.7.6-1.2.4.armv7hl
[root@Jolla ~]#

Maybe I need some dbus packages ? This is packages with "dbus" word installed on my jolla:

[root@Jolla ~]# rpm -qa *dbus*
qt5-qttools-qdbus-5.2.0+git0-1.6.10.armv7hl
dbus-glib-0.100.2-1.1.3.armv7hl
libdbus-qeventloop-qt5-1.27.6-1.6.7.armv7hl
qtaround-dbus-0.2.3-1.2.1.armv7hl
nemo-qml-plugin-dbus-qt5-2.0.1-1.8.1.armv7hl
qt5-qtdbus-5.2.1+git11-1.18.3.armv7hl
dbus-1.6.24+git1-1.5.1.armv7hl
ohm-plugins-dbus-1.1.63-1.7.3.armv7hl
dbus-libs-1.6.24+git1-1.5.1.armv7hl
[root@Jolla ~]#
Schturman ( 2014-12-23 19:40:08 +0200 )edit

Ohh thanks man! it answered on the question #1. Please convert your comment to answer.

P.S. About the second question, now I noticed it can came to foreground, but it take like 8 sec :( Do you know how to speed up it ? Like it was before sys update, it was open almost immediately...

Schturman ( 2014-12-24 10:53:51 +0200 )edit

problem solved, first post updated.

Schturman ( 2014-12-28 07:53:00 +0200 )edit

Question tools

Follow
2 followers

Stats

Asked: 2014-12-23 17:09:59 +0200

Seen: 1,617 times

Last updated: Dec 28 '14