<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://bugs.maemo.com/index.php?action=history&amp;feed=atom&amp;title=Python%2FHarmattan%2FDocumentation_for_pyside-assistant</id>
		<title>Python/Harmattan/Documentation for pyside-assistant - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://bugs.maemo.com/index.php?action=history&amp;feed=atom&amp;title=Python%2FHarmattan%2FDocumentation_for_pyside-assistant"/>
		<link rel="alternate" type="text/html" href="http://bugs.maemo.com/index.php?title=Python/Harmattan/Documentation_for_pyside-assistant&amp;action=history"/>
		<updated>2026-04-07T07:50:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.15.5-7</generator>

	<entry>
		<id>http://bugs.maemo.com/index.php?title=Python/Harmattan/Documentation_for_pyside-assistant&amp;diff=45836&amp;oldid=prev</id>
		<title>wmoreira:&amp;#32;Documentation for pyside-assistant moved to Python/Harmattan/Documentation for pyside-assistant</title>
		<link rel="alternate" type="text/html" href="http://bugs.maemo.com/index.php?title=Python/Harmattan/Documentation_for_pyside-assistant&amp;diff=45836&amp;oldid=prev"/>
				<updated>2011-11-24T17:51:40Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;a href=&quot;/Documentation_for_pyside-assistant&quot; class=&quot;mw-redirect&quot; title=&quot;Documentation for pyside-assistant&quot;&gt;Documentation for pyside-assistant&lt;/a&gt; moved to &lt;a href=&quot;/Python/Harmattan/Documentation_for_pyside-assistant&quot; title=&quot;Python/Harmattan/Documentation for pyside-assistant&quot;&gt;Python/Harmattan/Documentation for pyside-assistant&lt;/a&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:51, 24 November 2011&lt;/td&gt;
		&lt;/tr&gt;
		&lt;!-- diff generator: internal 2026-04-07 07:50:22 --&gt;
&lt;/table&gt;</summary>
		<author><name>wmoreira</name></author>	</entry>

	<entry>
		<id>http://bugs.maemo.com/index.php?title=Python/Harmattan/Documentation_for_pyside-assistant&amp;diff=45813&amp;oldid=prev</id>
		<title>wmoreira:&amp;#32;New page: == Setting up ==  ==== Installing from Ubuntu PPA ====  If you are using Ubuntu then you can add PySide's ppa and get ''pyside-assistant'' from there:   &lt;nowiki&gt; sudo add-apt-repository pp...</title>
		<link rel="alternate" type="text/html" href="http://bugs.maemo.com/index.php?title=Python/Harmattan/Documentation_for_pyside-assistant&amp;diff=45813&amp;oldid=prev"/>
				<updated>2011-11-22T18:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;New page: == Setting up ==  ==== Installing from Ubuntu PPA ====  If you are using Ubuntu then you can add PySide&amp;#39;s ppa and get &amp;#39;&amp;#39;pyside-assistant&amp;#39;&amp;#39; from there:   &amp;lt;nowiki&amp;gt; sudo add-apt-repository pp...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Setting up ==&lt;br /&gt;
&lt;br /&gt;
==== Installing from Ubuntu PPA ====&lt;br /&gt;
&lt;br /&gt;
If you are using Ubuntu then you can add PySide's ppa and get ''pyside-assistant'' from there:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo add-apt-repository ppa:pyside&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're using Ubuntu Oneiric you have to add this to /etc/apt/sources.list.d/pyside-ppa-oneiric.list&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
deb http://ppa.launchpad.net/pyside/ppa/ubuntu natty main&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install pyside-assistant&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Building and installing from source ====&lt;br /&gt;
&lt;br /&gt;
To build and install ''pyside-assistant'' you will need a Debian-based Linux distribution. First, install ''python2.6'', ''sharutils'' and ''python-stdeb'' packages, that are runtime dependencies of ''pyside-assistant''.  Get the source from the Github [https://github.com/PySide/PySideAssistant page], then in the directory which pyside-assistant was downloaded, run: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ dpkg-buildpackage -D -rfakeroot -us -uc&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Warning: Do not install ''python-stdeb'' from the git sources, or pyside-assistant will not work properly!''' The version from Debian and Ubuntu (0.6.0+20100620-1) works as expected.&lt;br /&gt;
&lt;br /&gt;
Now go back a directory level and install the binary package:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ sudo dpkg -i pyside-assistant_&amp;lt;version&amp;gt;_all.deb&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage Instructions ==&lt;br /&gt;
&lt;br /&gt;
The main script for using ''pyside-assistant'' is &amp;lt;code&amp;gt;psa&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== list command ===&lt;br /&gt;
&lt;br /&gt;
The ''list'' command lists all templates available.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ psa list&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently available templates are:&lt;br /&gt;
&lt;br /&gt;
;fremantle&lt;br /&gt;
: For N900 devices.&lt;br /&gt;
;harmattan&lt;br /&gt;
: For N9/N950 devices.&lt;br /&gt;
;ubuntu-qml&lt;br /&gt;
: Ubuntu project using QML for user interface.&lt;br /&gt;
;ubuntu-qtgui&lt;br /&gt;
: Ubuntu project using QtGui for user interface.&lt;br /&gt;
&lt;br /&gt;
=== init command ===&lt;br /&gt;
&lt;br /&gt;
The ''init'' command creates a project from the templates. It receives two mandatory arguments: a string that identifies the entire project, called project slug, and the target template (e.g. harmattan). The following call will create a project in the current directory with the project slug sampleproject:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ psa init sampleproject harmattan&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All project files will be contained in a directory named after the project slug, which in this case is sampleproject. Additional parameters can be passed to &amp;lt;code&amp;gt;psa init&amp;lt;/code&amp;gt; to set various fields from the start; these parameters are shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    -a APPNAME, --app-name=APPNAME&lt;br /&gt;
                        Human-readable application name, refers to the Name field of sampleproject.desktop&lt;br /&gt;
    -s SECTION, --section=SECTION&lt;br /&gt;
                        Application section, refers to the section field of stdeb.cfg&lt;br /&gt;
    -d DESC, --description=DESC&lt;br /&gt;
                        Application short description, refers to the description field of setup.py&lt;br /&gt;
    -c CATEGORY, --category=CATEGORY&lt;br /&gt;
                        Application category, refers to the appname field of sampleproject.desktop&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The created projects come with a file called README.assistant, which lists what each file does. The contents of this file is listed below:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=========================================&lt;br /&gt;
README - pyside-assistant generated files&lt;br /&gt;
=========================================&lt;br /&gt;
&lt;br /&gt;
All files generated by psa init are described below. The sampleproject&lt;br /&gt;
slug used for them was 'sampleproject', with the following psa call:&lt;br /&gt;
&lt;br /&gt;
    $ psa init sampleproject &amp;lt;fremantle|harmattan|...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To list all available templates, use:&lt;br /&gt;
&lt;br /&gt;
    $ psa list&lt;br /&gt;
&lt;br /&gt;
* MANIFEST.in: Distutils considers a list of files by default for&lt;br /&gt;
installation, listed at [1].  Additional files to be distributed&lt;br /&gt;
must be supplied in the MANIFEST.in file. The generated file includes&lt;br /&gt;
the .desktop file and any QML files found.&lt;br /&gt;
&lt;br /&gt;
[1] http://docs.python.org/distutils/sourcedist.html#specifying-the-files-to-distribute.&lt;br /&gt;
&lt;br /&gt;
* setup.py: The main file for using Distutils, contains most of the&lt;br /&gt;
information needed to build the package. Information about setup.py&lt;br /&gt;
can be found at http://docs.python.org/distutils/introduction.html.&lt;br /&gt;
Two fields of this file can be modified by psa update parameters:&lt;br /&gt;
 - description: -d or --description&lt;br /&gt;
 - long_description: the contents of sampleproject.longdesc are used&lt;br /&gt;
&lt;br /&gt;
* stdeb.cfg: Configuration file for stdeb, specifying additional&lt;br /&gt;
parameters for the binary package. The specification for this&lt;br /&gt;
file can be found at https://github.com/astraw/stdeb, in the section&lt;br /&gt;
stdeb.cfg configuration file. One field of this file can be modified by&lt;br /&gt;
psa update parameters:&lt;br /&gt;
 - Section: -s or --section&lt;br /&gt;
&lt;br /&gt;
Note that the section should be a valid one,&lt;br /&gt;
as specified in http://wiki.maemo.org/Task:Package_categories#New_list_for_Diablo.&lt;br /&gt;
&lt;br /&gt;
* sampleproject.aegis: Sample credentials file, which initially is empty. Information&lt;br /&gt;
of how to populate it can be found at [2].&lt;br /&gt;
NOTE: this file is used only in harmattan projects.&lt;br /&gt;
&lt;br /&gt;
[2] http://library.developer.nokia.com/topic/MeeGo_1.2_Harmattan_API/html/guide/html/Developer_Library_Developing_for_Harmattan_Harmattan_security_6cbe.html&lt;br /&gt;
&lt;br /&gt;
* sampleproject.desktop: This file specifies how to run the application&lt;br /&gt;
from the application grid, with various fields. Information about&lt;br /&gt;
.desktop files can be found at http://wiki.maemo.org/Desktop_file_format.&lt;br /&gt;
Two fields of this file can be modified by psa update parameters:&lt;br /&gt;
 - Name: -a or --app-name&lt;br /&gt;
 - Category: -c or --category&lt;br /&gt;
&lt;br /&gt;
Note that the category should be a valid one, as specified in&lt;br /&gt;
http://standards.freedesktop.org/menu-spec/latest/apa.html.&lt;br /&gt;
&lt;br /&gt;
* sampleproject.png: The application icon, which is displayed in the&lt;br /&gt;
application grid.&lt;br /&gt;
&lt;br /&gt;
* qml/*.qml: The QML files for the application. Their contents depend&lt;br /&gt;
on the platform.&lt;br /&gt;
&lt;br /&gt;
* sampleproject: Main program. Initializes the application and provide&lt;br /&gt;
support for displaying the QML files contents.&lt;br /&gt;
&lt;br /&gt;
* sampleproject.longdesc: Holds the contents of the long_description field of&lt;br /&gt;
setup.py, which as the name implies is a more detailed description of what the project is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== build-deb command ===&lt;br /&gt;
&lt;br /&gt;
The ''build-deb'' command does all necessary steps for generating a binary package. It essentially calls stdeb to build the proper Debian package and then places the application icons inside it. For using this command, you just have to enter the project directory and run:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ psa build-deb&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The binary package will be found under the ''./deb_dist'' directory.&lt;br /&gt;
&lt;br /&gt;
If you want to add credentials to your project, you have to edit the ''.aegis'' file, which initially is empty and thus ignored. After you write all the necessary credentials to the file it will be injected into the binary package the next time the ''build-deb'' command is called. More information about credentials can be found [http://library.developer.nokia.com/topic/MeeGo_1.2_Harmattan_API/html/guide/html/Developer_Library_Developing_for_Harmattan_Harmattan_security_6cbe.html here]&lt;br /&gt;
&lt;br /&gt;
=== update command ===&lt;br /&gt;
The ''update'' command can change certain values inside the project files, minimizing the need to open and edit them directly. This command accepts the following parameters:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    -a APPNAME, --app-name=APPNAME&lt;br /&gt;
                        Human-readable application name, resides in sampleproject.desktop&lt;br /&gt;
    -s SECTION, --section=SECTION&lt;br /&gt;
                        Application section, resides in stdeb.cfg&lt;br /&gt;
    -d DESC, --description=DESC&lt;br /&gt;
                        Application short description, resides in setup.py&lt;br /&gt;
    -c CATEGORY, --category=CATEGORY&lt;br /&gt;
                        Application category, resides in sampleproject.desktop&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These parameters can be used in any order. As an example, to change the description and section of the project, run:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
    $ psa update -d &amp;quot;Sample project&amp;quot; -s games&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example workflow ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ psa init sampleproject harmattan&lt;br /&gt;
$ cd sampleproject&lt;br /&gt;
(... hack ...)&lt;br /&gt;
$ psa build-deb&lt;br /&gt;
(... copy binary package to destination and install it ...)&lt;br /&gt;
(... hack some more ...)&lt;br /&gt;
$ psa update -c AudioVideo -s graphics&lt;br /&gt;
$ psa build-deb&lt;br /&gt;
&lt;br /&gt;
(and so on.)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging generic Python applications ==&lt;br /&gt;
&lt;br /&gt;
''pyside-assistant'' was initially conceived for creating PySide applications, but in fact it can be used to build binary packages for any pure Python application that uses [http://docs.python.org/distutils/index.html Python Distutils]. &lt;br /&gt;
&lt;br /&gt;
For that purpose, follow these steps:&lt;br /&gt;
&lt;br /&gt;
* Run &amp;lt;code&amp;gt;psa init&amp;lt;/code&amp;gt; as usual, to create the initial project layout;&lt;br /&gt;
* Erase the ''qml'' directory, as its files are specific to Qt programs;&lt;br /&gt;
* Create or add all files of your Python application;&lt;br /&gt;
* Edit ''stdeb.cfg'' and replace the contents of the ''Depends'' field with the correct runtime dependencies for your application, if any. &lt;br /&gt;
* If you don't have a ''setup.py'' file for your project, edit the provided one removing the ''.qml'' file reference and adding any other project files you need. See the Python Distutils [http://docs.python.org/distutils/index.html documentation] to know how the ''setup.py'' file works and how to edit it.&lt;br /&gt;
&lt;br /&gt;
From now on, the same workflow applies: modify files, build binary package with &amp;lt;code&amp;gt;psa build-deb&amp;lt;/code&amp;gt;, update fields with &amp;lt;code&amp;gt;psa update&amp;lt;/code&amp;gt;, and so on.&lt;/div&gt;</summary>
		<author><name>wmoreira</name></author>	</entry>

	</feed>