I am working on a python application that runs on two different platforms, namely regular desktop Linux and Maemo 4. We use PyGTK on both platforms, but on Maemo there are a bunch of small settings to make them look beautiful, which are implemented as follows:
if util.platform.MAEMO: # do something fancy for maemo else: # regular pygtk
About 15 of these statements are necessary to make the user interface look and work well on Maemo 4.
It has been very manageable all this time. The problem is that a new version of Maemo (5, aka fremantle) appeared a while ago, and it has some big differences compared to Maemo 4. I donβt want to add a bunch of checks throughout the GUI to get all 3 platforms that work well with the same code base because it will be messy. I also do not want to create a copy of the GUI source code for each platform and just change it for a specific platform (I would like to use as much code as possible).
So, what are the ways to have slightly different user interfaces for different platforms based on the same key interface? I do not think this is a question with python or Maemo, I just wanted to know how to do this.
python user-interface pygtk code-reuse maemo
nikosapi
source share