Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Why python script fails if run as user

    Reply
    jukzh | # 1 | 2010-09-10, 15:12 | Report

    I'm busy creating an icon launcher for GMapcatcher
    Launch as root:
    Code:
    ~ $ root
    Root shell enabled
    
    
    BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    /home/user # gmaps
    /usr/bin/gmaps: line 3:  1664 Quit                    /usr/bin/python /media/mmc1/GMapCatcher-0.7.2.0/maps.py
    Everything ok, now as user:
    Code:
    ~ $ gmaps 
    Traceback (most recent call last):
      File "/media/mmc1/GMapCatcher-0.7.2.0/maps.py", line 967, in <module>
        main()
      File "/media/mmc1/GMapCatcher-0.7.2.0/maps.py", line 963, in main
        MainWindow()
      File "/media/mmc1/GMapCatcher-0.7.2.0/maps.py", line 959, in __init__
        self.drawing_area.da_set_cursor()
      File "/media/mmc1/GMapCatcher-0.7.2.0/gmapcatcher/widDrawingArea.py", line 30, in da_set_cursor
        self.window.set_cursor(cursor)
    AttributeError: 'NoneType' object has no attribute 'set_cursor'
    ^Z[1] + Stopped                    gmaps
    ~ $
    Failed, why?
    Same python same script

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Khertan | # 2 | 2010-09-10, 15:15 | Report

    While launching it as root you didn't the Maemo look and feel.

    But here the problem is that your window is a None type... haven't be created. Without source ... we can 't help you.

    Python script doesn't need root to run ...

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jukzh | # 3 | 2010-09-10, 15:25 | Report

    Originally Posted by Khertan View Post
    While launching it as root you didn't the Maemo look and feel.

    But here the problem is that your window is a None type... haven't be created. Without source ... we can 't help you.

    Python script doesn't need root to run ...
    Maemo look and feel, sorry what is that?
    Source, it's quite big to post, you can check it out:
    Code:
    svn checkout http://gmapcatcher.googlecode.com/svn/trunk/ gmapcatcher-read-only

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Khertan | # 4 | 2010-09-10, 15:54 | Report

    Your set_cursor methods seems to be called before that the DrawingArea got his expose event so he didn't have any window yet as it s not well configurated yet.

    can you try to set the cursor only if DrawingArea.window != None ?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jukzh | # 5 | 2010-09-10, 16:32 | Report

    Originally Posted by Khertan View Post
    Your set_cursor methods seems to be called before that the DrawingArea got his expose event so he didn't have any window yet as it s not well configurated yet.

    can you try to set the cursor only if DrawingArea.window != None ?
    Where I supposed to do that?

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout