Active Topics

 


Reply
Thread Tools
Posts: 46 | Thanked: 0 times | Joined on Dec 2008 @ Grenoble (France)
#21
Thanks for the feedback.

About the seg. fault, could you have a quick look with strace, to try to see where the crash occurs?
__________________
Frédéric
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#22
Originally Posted by fma View Post
Thanks for the feedback.

About the seg. fault, could you have a quick look with strace, to try to see where the crash occurs?
I can't see anything obvious - it looks to be happening during conversation with Xorg. I'm attaching the strace logs anyway, in case you can get more out of them.
Attached Files
File Type: zip strace.zip (45.0 KB, 113 views)
 
Posts: 46 | Thanked: 0 times | Joined on Dec 2008 @ Grenoble (France)
#23
Very strange...

If you have some time, could your try to execute step by step the content of the main script (should be in /usr/lib/python2.5/site-package/papywizard/scripts/main.py)... Maybe the problem is when importing a module?

Thanks,
__________________
Frédéric
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#24
Originally Posted by fma View Post
Very strange...

If you have some time, could your try to execute step by step the content of the main script (should be in /usr/lib/python2.5/site-package/papywizard/scripts/main.py)... Maybe the problem is when importing a module?

Thanks,
I've nailed it down - it segfaults when running QtGui.QApplication(sys.argv), but only after importing hildon (done in common/config.py).

So the following segfaults:
Code:
import sys
from PyQt4 import QtGui
import hildon
qtApp = QtGui.QApplication(sys.argv)
If I comment out the "import hildon" in config.py then it looks to run fine.
 
Posts: 46 | Thanked: 0 times | Joined on Dec 2008 @ Grenoble (France)
#25
Great! Thanks!

Is this hildon module obsolete in maemo 5? In fact, I only use it to detect the plateform, in 2 modules:

Code:
try:
    import hildon
except ImportError:
    DATA_STORAGE_DIR = HOME_DIR
else:
    DATA_STORAGE_DIR = os.path.join(HOME_DIR, "MyDocs")
and

Code:
try:
    import hildon
except ImportError:
    self.__key['FullScreen'] = QtCore.Qt.Key_F11
    self.__key['Home'] = QtCore.Qt.Key_Home
    self.__key['End'] =  QtCore.Qt.Key_End
else:
    self.__key['FullScreen'] = QtCore.Qt.Key_F6
    self.__key['Home'] = QtCore.Qt.Key_F8
    self.__key['End'] =  QtCore.Qt.Key_F7
Is there another way to detect the maemo plateform?
__________________
Frédéric
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#26
Originally Posted by fma View Post
Is this hildon module obsolete in maemo 5? In fact, I only use it to detect the plateform, in 2 modules.

Is there another way to detect the maemo plateform?
The hildon module is still there, so I guess it's still relevant - though probably only used for GTK apps. For Qt4.6, you should test by importing PyQt4.QtMaemo5 instead - I don't think that was in earlier versions though.
 
Posts: 46 | Thanked: 0 times | Joined on Dec 2008 @ Grenoble (France)
#27
The other problem is I want to share the same code with maemo4 (N8x0)...
__________________
Frédéric
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#28
Originally Posted by fma View Post
The other problem is I want to share the same code with maemo4 (N8x0)...
Yeah, I guessed that was the case. I'll have to have a check on my N800 when I get home and see whether there's anything obvious. Otherwise I guess you could try importing PyQt4.Maemo5, and, if that fails, try importing hildon. That should cover both cases, providing you make sure that the Maemo5 .deb file includes the correct dependency to pull in the python2.5-qt4-maemo5 package.
 
Posts: 46 | Thanked: 0 times | Joined on Dec 2008 @ Grenoble (France)
#29
Ok, but I still have the problem importing hildon before creating QApplication...

I have an idea; could you make the following test? In the config.py module, replace:

Code:
    try:
        import hildon
        DATA_STORAGE_DIR = os.path.join(HOME_DIR, "MyDocs")
    except ImportError:
        DATA_STORAGE_DIR = HOME_DIR
with

Code:
    if 'hildon' in sys.modules:
        DATA_STORAGE_DIR = os.path.join(HOME_DIR, "MyDocs")
    else:
        DATA_STORAGE_DIR = HOME_DIR
    print "***** %s *****" % DATA_STORAGE_DIR
Does it work?
__________________
Frédéric
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#30
If you *really* need it only for identification purposes, the platform module might come handy:

Code:
>>> import platform
>>> print platform.uname()
('Linux', 'Nokia-N900', '2.6.28.10', '#1 PREEMPT Wed May 26 00:24:03 EEST 2010', 'armv7l', '')
...
>>> print platform.uname()
('Linux', 'Nokia-N810-23-14', '2.6.21-omap1', '#2 Tue Oct 14 11:25 EEST 2008', 'armv6l','')
EDIT: to avoid confusion - the second string in the tuple is a hostname. Ideally, we could use platform.dist() but sadly that one is not entirely accurate
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc

Last edited by attila77; 2010-07-06 at 12:13.
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:08.