Active Topics

 


Reply
Thread Tools
HangLoose's Avatar
Posts: 319 | Thanked: 289 times | Joined on Sep 2009 @ Lisboa, Portugal
#1
I am following this tutorial:
http://wiki.maemo.org/PyMaemo/UsingPythonInMaemo

When I try to compile this code:
Code:
#!/usr/bin/env python2.5
import gtk
import hildon
 
class HelloWorldApp(hildon.Program):
  def __init__(self):
    hildon.Program.__init__(self)
 
    self.window = hildon.Window()
    self.window.connect("destroy", gtk.main_quit)
    self.add_window(self.window)
 
    label = gtk.Label("Hello World!")
    self.window.add(label)
    label.show()
 
  def run(self):
    self.window.show_all()
    gtk.main()
 
app = HelloWorldApp()
app.run()
I get the following error:
[sbox-FREMANTLE_X86: /usr/lib/hildon-desktop] > python2.5 hello_world_home.py
process 28672: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 28672: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[28672]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
Aborted (core dumped)
Any idea what that means?
 
Posts: 1 | Thanked: 1 time | Joined on Dec 2009 @ US
#2
Try putting a "run-standalone.sh" before python2.5 in your command line.

I would recommend against that tutorial, it is out of date. Start here: http://wiki.maemo.org/PyMaemo
Then go here: http://wiki.maemo.org/PyMaemo/UITutorial
 

The Following User Says Thank You to bodell For This Useful Post:
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#3
I did the above and also ran the below commands as per the wiki in my ARMEL target

X86: ~] > eval $(dbus-launch --sh-syntax)
X86: ~] > export BUS_SESSION_BUS_ADDRESS
X86: ~] > export DBUS_SESSION_BUS_PID

corrected a typo in the wiki
export BUS_SESSION_BUS_ADDRESS
should be
export DBUS_SESSION_BUS_ADDRESS
I think.

Anyways I still get this error

could you help ?

[sbox-FREMANTLE_ARMEL: ~] > run-standalone.sh python2.5 py.py
process 24390: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 24390: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[24390]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
qemu: uncaught target signal 6 (Aborted) - core dumped
[sbox-FREMANTLE_ARMEL: ~] > cat py.py
import gtk
import hildon
[sbox-FREMANTLE_ARMEL: ~] >

Last edited by krk969; 2010-01-03 at 14:37.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#4
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#5
Originally Posted by qwerty12 View Post
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py
thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#6
Originally Posted by krk969 View Post
thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?
The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#7
Originally Posted by thp View Post
The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.
Thanks thp.

I tried that in the X86 target , but hadnt worked coz maybe the repositories werent there in my apt/source.list.

But it had worked for ARMEL target and I could download with the same list of repositories.

this is my /etc/apt/sources.list

deb http://repository.maemo.org/ fremantle/sdk free non-free
deb-src http://repository.maemo.org/ fremantle/sdk free
deb http://repository.maemo.org/ fremantle/tools free non-free
deb-src http://repository.maemo.org/ fremantle/tools free


But my main intention is to develop for ARMEL and I keep getting the above error.

EDIT::
added the extras-devel repository to get this result

[sbox-FREMANTLE_X86: ~] > fakeroot apt-cache search python2.5-hildon
python-hildon - Python bindings for Hildon Framework.
python-hildondesktop - Python bindings for libhildondesktop

Last edited by krk969; 2010-01-03 at 15:43. Reason: more information
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#8
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 27248: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[27248]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
/usr/bin/run-standalone.sh: line 11: 27248 Aborted (core dumped) "$@"
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#9
Yes, install "python-hildon" then.. my fault (it was called python2.5-hildon some time ago). As Python is a scripting language, and you don't compile python scripts in the traditional sense (the Python interpreter does compile the source file into Python bytecode - *.pyc and *.pyo files - but these are platform-independent).

I'm also developing Python applications for the N900, and do all my testing in the SDK with the X86 target. I also do lots of testing directly on-device, as I just need to rsync my source tree to the device and test it using SSH or the X Terminal - no compiling needed

In short: Unless you are writing Python C extension modules, you should not need to care about the ARMEL target, and the X86 target will give you less headache. Do a "fakeroot apt-get install python-hildon" in Scratchbox, and don't forget to always call Python with "python2.5", as "python" will most likely use the Scratchbox-provided python 2.3.
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#10
Originally Posted by krk969 View Post
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
You have started Xephyr, did an "export DISPLAY=:2" and ran "af-sb-init.sh start" and after that (in the same session) did the "run-standalone.sh python2.5 py.py"? Maybe your installation is simply broken. You can try copying the file to your device and trying it out there (you might need to install the necessary packages on the device or simply install an app that drags in the required dependencies).
 

The Following 2 Users Say Thank You to thp For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:18.