Python for Maemo

What is PyMaemo?
News
Components
Installation
Documentation
Screenshots
Applications
About

Contributing

Project Page
Bugs
SVN
Wiki
Mailing List

Links

INdT
Python
Maemo

Python 2.5 for Maemo - Release notes

Foreword

Python 2.5 for Maemo is the newest version of the Python port for the Maemo platform. The highlight new features are:

Project page and repositories

The project main page moved to http://pymaemo.garage.maemo.org/.

The repository lies at http://repository.maemo.org/extras/. This repository contains Python 2.5 packages for bora and scirocco versions of the SDK (components free and non-free). This new package can be installed using an automatic script or mannualy.

Automatic Installation

Warning: It is necessary to remove ALL applications that depends on Python2.4 BEFORE you remove python2.4-runtime. This is necessary to ensure that all python2.4 packages will be correctly removed.

To perform automatic installation just download both .install files. Proceed installing first Base repository file. Do the same with Python runtime file.

To install the development packages, check the steps here.

Manual Installation

Warning: It is necessary to remove ALL applications that depends on Python2.4 BEFORE you remove python2.4-runtime. This is necessary to ensure that all python2.4 packages will be correctly removed.

The next steps only work if following repository is already present. To check this, open the Application Manager and verify the Application catalog. It must contain:

Base packages for Bora

	Web address:  http://repository.maemo.org
	Distribution: bora
	Components:   free non-free
	

Python2.5 for Bora

	Web address:  http://repository.maemo.org/extras
	Distribution: bora
	Components:   free non-free
	

Base packages for Scirocco

	Web address:  http://repository.maemo.org
	Distribution: scirocco
	Components:   free non-free
	

Python2.5 for Scirocco

	Web address:  http://repository.maemo.org/extras
	Distribution: scirocco
	Components:   free non-free
	

In the SDK, add the abovementioned repository lines to /etc/apt/sources.list, run apt-get update and you are ready to install python2.5 plus bindings. All Python for Maemo 2.5 packages are named python2.5-*, so you can install all at once with apt-get if you want to.

In the device, open the Application Installer, add the repository to your repository list and install the python2.5-runtime package, which will automatically pull all available Python bindings, but not the development packages.

To install the development packages, check the steps below.

Development Packages

To be able to develop and test applications using the device its necessary to install python2.5-dev package. The steps to do this are decribed below.

	Open a xterm session. Inside this session run:
	sudo /usr/sbin/gainroot
	Now install the package using apt-get utility:
	apt-get install python2.5-dev
	And finally exit from gainroot:
	exit
	

Converting existing Maemo applications to PyMaemo 2.5

In general, the Python for Maemo applications will demand some maintenance to work on 2.5 version, but the changes are easy to pinpoint and implement.

Package dependencies

Remember that the PyMaemo is no longer part of the Maemo SDK, neither it is available in default SDK repository. The repository that contains PyMaemo has been changed to http://repository.maemo.org/extras/.

The Python for Maemo 2.5 packages conflict with the 2.4 versions, so they cannot be installed both at the same time in the same system.

If you deploy your application to final users, you may have to offer instructions for them to add that repository in the devices' Application Installer.

Default interpreter

In order to be able to run inside the SDK/Scratchbox environment, executable Python scripts should have the first line changed to

	#!/usr/bin/env python2.5
	

This is because Scratchbox supplies a Python version 2.3 and sets that one as the default python interpreter, but Python for Maemo applications must run under the 2.5 version.

Changes in Hildon API

The changes are minor. Properties from some objects have been removed; data from such properties can still be read/written using explicit set_propertyname(value) and get_propertyname() methods.

Changes in LibOSSO API

Most methods formerly bound to the osso.Context object have been grouped under specific objects: Autosave, Application, DeviceState, Mime, Plugin, Rpc, StateSaving, Statusbar, SystemNote and TimeNotification.

Apart from that, the methods' names, prototypes and side-effects are the same as Python for Maemo 2.4. In the former version, you did

	c = osso.Context("application name", "0.5", False)
	c.force_autosave()
	
which must be changed in the following way to work under Python 2.5:
	c = osso.Context("application name", "0.5", False)
	a = osso.Autosave(c)
	a.force_autosave()
	

Gazpacho

As happened with Python 2.5, Gazpacho for Maemo packages are no longer in the SDK repository. The project is being moved to http://garage.maemo.org and the packages will be available under the abovementioned repository.

Search for Gazpacho in the Garage site in order to get more directions about this application.

Python for Maemo 2.4 is obsolete

The Python for Maemo version 2.4 included in the Maemo SDK 2.0 ("Mistral") will no longer be updated. Python applications should be upgraded to Python for Maemo 2.5 in order to function properly under SDK 2.1 ("Scirocco") or SDK 3.0 ("Bora").

Also, there are no Python 2.5 packages for the SDK 2.0. Please upgrade to SDK 2.1 or better.

Further References