Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)

    Reply
    Page 14 of 20 | Prev | 4   12     13   14   15     16   | Next | Last
    noobmonkey | # 131 | 2010-02-22, 15:29 | Report

    Originally Posted by fatalsaint View Post
    If the code you gave me earlier is what you are running..

    Don't you need a:
    #!/usr/bin/python

    Or whatever the appropriate path is for python on the N900 at the beginning?

    That could by why the desktop icon isn't working.

    You want either:
    Code:
    Exec=python /opt/healthcheck/healthcheck.py
    Or add the line above to the top of healthcheck.py.
    Thanks Fatalsaint, again!

    Got the (hashkey not working)! /usr/bin/env python
    at the beginning

    assuming the Exec=python /opt/healthcheck/healthcheck.py is for the .desktop file? (replace current line?)

    (the icon loads, and it looks like the application loads, so not sure the error is there.)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    fatalsaint | # 132 | 2010-02-22, 15:32 | Report

    Originally Posted by noobmonkey View Post
    Thanks Fatalsaint, again!

    Got the (hashkey not working)! /usr/bin/env python
    at the beginning

    assuming the Exec=python /opt/healthcheck/healthcheck.py is for the .desktop file? (replace current line?)

    (the icon loads, and it looks like the application loads, so not sure the error is there.)
    Yes you can do one, or the other, or both..

    Adding #!/usr/bin/env python to the top of healthcheck.py will allow you to either:
    Code:
    /opt/healthcheck/healthcheck.py
    *or*
    cd /opt/healthcheck/
    ./healthcheck.py
    In a terminal.. Or use the Exec code you have right now. Not having that line in the file, requires you to pass it to python first with either:
    Code:
    python /opt/healthcheck/healthcheck.py
    *or*
    cd /opt/healthcheck
    python healthcheck.py
    *or*
    Exec=python /opt/healthcheck/healthcheck.py
    Etc....

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 133 | 2010-02-22, 16:05 | Report

    Ok, tried again with the exec python part - doesnt make a difference

    So to confirm, .desktop has
    Exec=python /opt/healthcheck/healthcheck.py

    and the healthcheck.py file has #!/usr/bin/env python as it's first line.

    The icon installs, it starts to run, and then just crashes out and dissapears....

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 134 | 2010-02-22, 16:21 | Report

    Originally Posted by noobmonkey View Post
    Ok, tried again with the exec python part - doesnt make a difference
    With X-Osso-Service present in your desktop file, changing the Exec field there won't make a difference. Edit /usr/share/dbus-1/services/HealthCheck.service instead.

    If the problem is that it crashes after some seconds when starting it from the menu (starting it from the terminal shouldn't cause it to crash) you need to initialize an osso.Context since you're using X-Osso-Service.

    Try something like:
    Code:
    import osso
    osso_c = osso.Context("healthcheck", "666", True)
    If that fails, too, then you can try replacing the previous X-Osso-Type line with X-Osso-Type=application/x-python

    If that also fails, comment out the X-Osso-Service line in your desktop file. Of course, only try all this if your program doesn't crash when started from the terminal.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
    attila77, fatalsaint, noobmonkey

     
    noobmonkey | # 135 | 2010-02-22, 16:27 | Report

    Originally Posted by qwerty12 View Post
    With X-Osso-Service present in your desktop file, changing the Exec field there won't make a difference. Edit /usr/share/dbus-1/services/HealthCheck.service instead.

    If the problem is that it crashes after some seconds when starting it from the menu (starting it from the terminal shouldn't cause it to crash) you need to initialize an osso.Context since you're using X-Osso-Service.

    Try something like:
    Code:
    import osso
    osso_c = osso.Context("healthcheck", "666", True)
    If that fails, too, then you can try replacing the previous X-Osso-Type line with X-Osso-Type=application/x-python

    If that also fails, comment out the X-Osso-Service line in your desktop file. Of course, only try all this if your program doesn't crash when started from the terminal.
    I'm assuming the code is to go in my healthcheck.py file, and not the service file?
    does run fine from terminal.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 136 | 2010-02-22, 16:30 | Report

    Originally Posted by noobmonkey View Post
    I'm assuming the code is to go in my healthcheck.py file, and not the service file?
    does run fine from terminal.
    Yessssssir.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to qwerty12 For This Useful Post:
    noobmonkey

     
    noobmonkey | # 137 | 2010-02-22, 16:39 | Report

    Okey dokey, trying the osso stuff and will see how it goes

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 138 | 2010-02-22, 16:52 | Report

    Well
    Originally Posted by
    import osso
    osso_c = osso.Context("healthcheck", "666", True)
    didn't work, will try the rest when i get home in 20 mins

    Edit | Forward | Quote | Quick Reply | Thanks

     
    noobmonkey | # 139 | 2010-02-22, 17:17 | Report

    Just realised, not actually using python-osso.....

    So removing traces of it from my code and the .desktop / build_app files....
    Does that mean i can remove the lines
    Originally Posted by
    X-Osso-Service=com.nokia.healthcheck
    X-Osso-Type=application/x-executable
    from the .desktop file too?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    casper27 | # 140 | 2010-02-22, 17:29 | Report

    Just installed and same results as rest starts and then crashes just before launch. Getting there though Noob keep churning that code

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to casper27 For This Useful Post:
    noobmonkey

     
    Page 14 of 20 | Prev | 4   12     13   14   15     16   | Next | Last
vBulletin® Version 3.8.8
Normal Logout