Editing PyPackager
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | For developers without a Linux-background and supporting hardware, getting into development on Maemo is most easily achieved by using [ | + | For developers without a Linux-background and supporting hardware, getting into development on Maemo is most easily achieved by using [http://pymaemo.garage.maemo.org/ PyMaemo], the Python port for Maemo. Check the website for more information on how to program - this wiki page only explains how to properly integrate your python app into the Maemo desktop environment. |
Once you have a python application, you need to properly structure your source directory and add some additional files to achieve maximum Maemo/Hildon desktop integration. This document shall explain this, using the [http://maemo.org/downloads/product/OS2008/mclock/ mClock] build process as an example. | Once you have a python application, you need to properly structure your source directory and add some additional files to achieve maximum Maemo/Hildon desktop integration. This document shall explain this, using the [http://maemo.org/downloads/product/OS2008/mclock/ mClock] build process as an example. | ||
Line 6: | Line 6: | ||
PS: If you plan to distribute your application using the integrated application manager and the extras repository, you must use another build process. Check the [[py2deb]] documentation for this. | PS: If you plan to distribute your application using the integrated application manager and the extras repository, you must use another build process. Check the [[py2deb]] documentation for this. | ||
- | == | + | == Prerequisites == |
* OpenSSH server installed on the device | * OpenSSH server installed on the device | ||
* Using a SFTP client on the Windows computer (e.g. Bitvise Tunnelier) | * Using a SFTP client on the Windows computer (e.g. Bitvise Tunnelier) | ||
Line 12: | Line 12: | ||
== Process in general == | == Process in general == | ||
* Login as root | * Login as root | ||
- | * Upload your source directory to wherever you want (I suggest MyDocs | + | * Upload your source directory to wherever you want (I suggest MyDocs) |
* Change the permissions on files that later need to be executable to 755 | * Change the permissions on files that later need to be executable to 755 | ||
* Open Pypackager, add the necessary information, select a source folder, save the settings. Tap the wheel icon to build your package. | * Open Pypackager, add the necessary information, select a source folder, save the settings. Tap the wheel icon to build your package. | ||
Line 52: | Line 52: | ||
=== mClock.desktop file === | === mClock.desktop file === | ||
- | + | <nowiki>[Desktop Entry]</nowiki> | |
- | + | Version=1.0.0 '''Version of this file, NOT of the app. Keep it at 1.0.0''' | |
- | + | Encoding=UTF-8 | |
- | < | + | Name=mClock '''Name of the app as seen in Menu''' |
- | + | Comment=Clock & day/night map '''Description of the app as seen as subtitle in Menu in Finger mode ''' | |
- | + | Exec=/usr/bin/mClock '''Link to the app''' | |
- | Encoding=UTF-8 | + | Icon=mclock '''Name of our icon file, without the trailing .png part''' |
- | + | X-Icon-path=/usr/share/icons '''Path to the icon''' | |
- | + | X-Window-Icon=mclock '''Name of our icon file, without the trailing .png part (again?!)''' | |
- | + | Type=Application | |
- | + | X-Osso-Service=com.nokia.mclock '''UST begin with com.nokia. due to a bug, anything else WONT work''' | |
- | + | X-Osso-Type=application/x-executable | |
- | Exec=/usr/bin/mClock | + | StartupWMClass=mClock '''Only needed because it's a PyGame app (would be automatic with GTK)''' |
- | + | ||
- | + | ||
- | + | ||
- | X-Icon-path=/usr/share/icons | + | |
- | + | ||
- | X- | + | |
- | + | ||
- | + | ||
- | + | ||
- | X-Osso-Type=application/x-executable | + | |
- | + | ||
- | + | ||
- | + | ||
=== mclock.service === | === mclock.service === | ||
- | |||
All lower case just to be sure. Very simple content: | All lower case just to be sure. Very simple content: | ||
- | < | + | <nowiki>[D-BUS Service]</nowiki> |
- | [D-BUS Service] | + | Name=com.nokia.mclock '''MUST begin with com.nokia. due to a bug, anything else WONT work''' |
- | + | Exec=/usr/bin/mClock '''Link to the app''' | |
- | + | ||
- | + | ||
- | Exec=/usr/bin/mClock | + | |
- | + | ||
=== mClock.py=== | === mClock.py=== | ||
- | |||
Some important snippets from my code... | Some important snippets from my code... | ||
The first one is to be set as early as wanted, it will make sure that the "Loading..." banner disappers. Only needed because this is a pure pygame app right now, wouldn't be needed when using GTK! | The first one is to be set as early as wanted, it will make sure that the "Loading..." banner disappers. Only needed because this is a pure pygame app right now, wouldn't be needed when using GTK! | ||
- | + | import os | |
- | import os | + | <nowiki>os.environ["SDL_VIDEO_X11_WMCLASS"]="mClock"</nowiki> |
- | os.environ["SDL_VIDEO_X11_WMCLASS"]="mClock" | + | |
- | </ | + | |
Later on, we need to connect to our osso service or the service daemon will kill our application! | Later on, we need to connect to our osso service or the service daemon will kill our application! | ||
- | + | osso_c = osso.Context("mclock", "0.2.1", False) | |
- | osso_c = osso.Context("mclock", "0.2.1", False) | + | |
- | + | ||
(However, don't ask me IF that version string has ANY relevance, I don't know) | (However, don't ask me IF that version string has ANY relevance, I don't know) | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
[[Category:Development]] | [[Category:Development]] | ||
- | [[Category: | + | [[Category:Midgard wiki]] |
Learn more about Contributing to the wiki.