Release wxPython


ptitSeb

Serial Porter
Joined
Aug 15, 2012
Messages
9,306
Age
51
Location
France, near Lyon
Here is wxPython, a PND that can be used as a Runtime for using Python with QT, GTK, wxWidget, pyGame, and more, and can also be used to develop software using thoses technologies.

preview5.png

History log
========

Build 12
----------

  • Downgrade QtWebKit to make Anki works again
  • Updated some libs (ssl related)
Build 11
----------

  • Update Python to 2.7.10
  • Update Qt to 4.8.7

Build 10
----------

  • Some improvment for Ren'py games (enabling more sound & music)

Build 09
----------

  • Added PyOpenGL
  • Added experimental Ren'py 6.17 (with GLES2 support).

Build 08
----------

  • Fixed build, with QT rebuilded (but still downgraded QtWebKit).
  • The qtdemo now works with text and pictures
  • Refined launch script (colored ls...)

Build 07
----------

  • Downgraded QtWebKit (fixing Anki)

Build 06
----------

  • Update Python to 2.7.8
  • Update wxWidgets to 3.0.1, with webview
  • Update Qt4 to 4.8.6
Build 05
----------

  • Update GTK libs (based on 2.24 now)
  • added a couple more libs
  • fixed some typo in intro text
Build 04
----------

  • fixed distutils, so bitmessage works
Build 03
----------

  • added tcl/tk 8.5 libs, so Tkinter is usable
Build 02
----------

  • Added PyQT and QT4.7 libs
Build 01
----------

  • Initial release
  • Include Python 2.7.3 and wxPython lib, along with wxWidget 3.0 libs
  • Include a large set of python libs
  • wxGlade is usable
Now, to use it in your PND, insert this snipped at the beggening of the LauchScript:

# search and mount wxpython config...
pnd_cb="wxpython-ptitseb"
pnd_folder="wxpython"
if [ -e /mnt/utmp/$pnd_folder/build ];then
allready=1
else
#check if it exist
if [ ! -e /usr/share/applications/$pnd_cb*.desktop ];then
zenity --error --title "Bitmessage" --text="Error, cannot find wxPython PND. You need to install it first!"
exit
fi
#grab where is the pnd
pnd_path=$(sed -n 's/.*X-Pandora-Object-Path *= *\([^ ]*.*\)/\1/p' < /usr/share/applications/$pnd_cb*.desktop)
pnd_name=$(sed -n 's/.*X-Pandora-Object-Filename *= *\([^ ]*.*\)/\1/p' < /usr/share/applications/$pnd_cb*.desktop)
path_to_pnd=$pnd_path/$pnd_name
#automount it
/usr/pandora/scripts/pnd_run.sh -p $path_to_pnd -b $pnd_folder -m
fi

#check version of PND
if [ -e /mnt/utmp/$pnd_folder/build ];then
wxpython_build=`cat /mnt/utmp/wxpython/build`
else
wxpython_build=0
fi
echo wxpython pnd build $wxpython_build
if [ $wxpython_build -lt 4 ];then
zenity --error --title "Bitmessage" --text="Error, your wxPython PND is too old. Please update it!"
if [ ! "$allready" = "1" ];then
unset LD_LIBRARY_PATH /usr/pandora/scripts/pnd_run.sh -p $path_to_pnd -b $pnd_folder -u &
fi
exit
fi
#ok, now run wxpython init script
cd /mnt/utmp/$pnd_folder
. wxpython.sh
cd $pwd

Don't forget to setup the many needed export like HOME, XDG_CONFIG_HOME, etc... (LD_LIBRARY_PATH is taken care by the wxpython.sh script, but you can add other folders).

Lanch your software with some python /path/to/my/soft.py or something like that

And at the end, unmount the PND with

#unmount wxPython
unset LD_LIBRARY_PATH
if [ ! "$allready" = "1" ];then
/usr/pandora/scripts/pnd_run.sh -p $path_to_pnd -b $pnd_folder -u &
fi

You can also see how already existing package do: Anki, BitMessage or Printrun.

*2014.07.26*: Refined a bit the mount/unmount script.
 
Last edited:
While trying to convert some programs to use this, I found a problem with pygame.image. The following fails:


> python
>>> import pygame
>>> pygame.image.load('path to any JPEG image')

The same works fine with the firmware python.

I think the problem is related to the fact that the wxPython PND's python extensions are linked against a new version of libjpeg, but fails to provide libSDL_image which is taken from /usr/lib pulling in the firmware version of libjeg, too. I dimly remember reading that this isn't a good idea with libjpeg (at least the old version). libpng is similarly affected, but symbol versioning seems to be good enough to not interfere with loading png images.
 
Last edited by a moderator:
While trying to convert some programs to use this, I found a problem with pygame.image. The following fails:


> python
>>> import pygame
>>> pygame.image.load('path to any JPEG image')

The same works fine with the firmware python.

I think the problem is related to the fact that the wxPython PND's python extensions are linked against a new version of libjpeg, but fails to provide libSDL_image which is taken from /usr/lib pulling in the firmware version of libjeg, too. I dimly remember reading that this isn't a good idea with libjpeg (at least the old version). libpng is similarly affected, but symbol versioning seems to be good enough to not interfere with loading png images.
Ok, I'll take a look and freshen the libs inside the PND.

Thanks for the report.
 
New build on the repo.

Updates a few things (like Python, wxWidget and QT, so basicaly everything).

Build 06
----------


  • Update Python to 2.7.8
  • Update wxWidgets to 3.0.1, with webview
  • Update Qt4 to 4.8.6
 
Thanks! The problem mentioned above seems to be gone.
 
New build, fixing Anki. I just downgraded the QtWebKit library to the one in the current Codeblocks, instead of the fresh compiled I had. Other Qt libs are still new.

Build 07
----------


  • Downgraded QtWebKit (fixing Anki)
 
New build on the repo. I searched for a long time what was not working... And then found a few libs didn't have read right for the group?! How, why?! no clues. It's fixed now...

Build 08
----------



  • Fixed build, with QT rebuilded (but still downgraded QtWebKit).
  • The qtdemo now works with text and pictures
  • Refined launch script (colored ls...)
 
Updated build, with some more libs.

There is PyOpenGL now, but I have not embeded any GL lib, so put your own glshim (for example) for it to work.

Look at the Scary Gardener Tales 3D pnd for a sample.

Also, a ren'py runtime is include. A sample PND will come one day.

Build 09
----------



  • Added PyOpenGL
  • Added experimental Ren'py 6.17 (with GLES2 support).
 
Last edited by a moderator:
Newer build, with some fixes on Ren'py, to allow more sounds & music to be played.

Build 10
----------



  • Some improvment for Ren'py games (enabling more sound & music)
 
Uhrg, you did that upgrade right after i downloaded the previous version on a modem? *rant rant rant*

Anyway, i had problems to start actually any renpy game in the previous version, i hope it works with this one. Ill  tell next week...
 
Last edited by a moderator:
I have a new build of wxPython.
It feature Python 2.7.10 and a bunch of updated libs.
I have not uploaded it yet on the repo, but you can download it here for testing.
I'll probably upload it to the repo this (end of) week unless someone find a blocking issue with it.
 
Hi ptitSeb :)

I have a new build of wxPython.
It feature Python 2.7.10 and a bunch of updated libs.
I have not uploaded it yet on the repo, but you can download it here for testing.
I'll probably upload it to the repo this (end of) week unless someone find a blocking issue with it.

Did you also update wxWidgets ? I'm dowloading it anyway, see if this new version solves the permission / large cursor issues I have with Odamex.

Cheers, Magic Sam
 
Ah, I don't remember which version is in. Qt4 & wxWidget are diplicated in codeblocks PND and wxWidget PND. I have updated Qt4 for both, but I'm not sure I have done the same for wxwidget libs (my latest version is 3.02).
 
Thanks for keeping stuff up to date, ptitSeb! Would you happen to know how I can get python-dbus working with wxpython/CodeBlocks?

I have been trying to get Gpodder to work in SuperZaxxon over the last few days. I first tried with python included in the firmware. The command line interface works with the firmware python version, but the GTK gui segfaults. The package for python-dbus is installed according to opkg, and seems accessible to the firmware version of python.

When I launch Gpodder from inside wxpython/CodeBlocks, Gpodder gives an error saying that python-dbus is missing. I compiled and installed dbus-python version .8 or so from the pypi package index, but this didn't seem to help. I'm sure there is a simple solution here, but honestly I get a little confused with how CodeBlocks integrates firmware and PND libs.
 
The 3d printing printrun PND seems to not recognize the new version of wxPython.
 
Well, I may have at least started to answer my own question. I copied the contents of /usr/local/lib/python2.7/site-packages into the bin folder containing Gpodder. This folder had a lot of dbus related stuff in it. Now Gpodder starts with no segfault!! Very exciting. Unfortunately there is a crash in the command line version that I was hoping this would fix, and it did not. There is some kind of http error when I try to search for podcasts from the command line.

EDIT: A few brief tests seem to show that gPodder works, save the gpodder.net search function. I'm not sure I've ever seen that search function work on the Pandora though. I'm very excited to try and fix the gPodder PND that has been broken for years!

Also, would it perhaps be best to package this version of Python in the gPodder PND? I'm not sure if it makes more sense to package Python and GTK in the gPodder PND, or simply require that the wxPython PND be mounted for gPodder to work.
 
Last edited:
The 3d printing printrun PND seems to not recognize the new version of wxPython.
Oh, I'll check that...

Well, I may have at least started to answer my own question. I copied the contents of /usr/local/lib/python2.7/site-packages into the bin folder containing Gpodder. This folder had a lot of dbus related stuff in it. Now Gpodder starts with no segfault!! Very exciting. Unfortunately there is a crash in the command line version that I was hoping this would fix, and it did not. There is some kind of http error when I try to search for podcasts from the command line.

EDIT: A few brief tests seem to show that gPodder works, save the gpodder.net search function. I'm not sure I've ever seen that search function work on the Pandora though. I'm very excited to try and fix the gPodder PND that has been broken for years!

Also, would it perhaps be best to package this version of Python in the gPodder PND? I'm not sure if it makes more sense to package Python and GTK in the gPodder PND, or simply require that the wxPython PND be mounted for gPodder to work.
Well, I think it's best to use wxPython as a runtime is you use it. Adding ypthon bin & co adds a 50Mb size to the PND at least..
 
Back
Top