Hello, I was wondering if there is a way in distutils to include/indicate a program icon that will be used in the program menus / desktop shortcuts. I'm actualy packaging for debian with `stdeb` and I was expecting some stdeb-specific way to include the icon in the pacakge but to the best of my knowledge there isn't. I'm presently including in my setup.py file: data_files=[('/usr/share/pixmaps/', ['my-package-name.xpm'])], but this - while working - seems the wrong thing to do, as it insert in the general python package something that is platform-specific. Any ideas or primers on the subject? Thanks in advance, /mac
Hi Mac,
I was wondering if there is a way in distutils to include/indicate a program icon that will be used in the program menus / desktop shortcuts. Nothing standard, no. You may find python-distutils-extra (that’s the Debian/Ubuntu package name) interesting.
but this - while working - seems the wrong thing to do, as it insert in the general python package something that is platform-specific. That’s the state of things with distutils. For distutils2/packaging we’re working on a better system, but it’s not fully there yet.
Regards
On Tuesday 13 September 2011 01:20:06 Éric Araujo wrote:
Hi Mac,
I was wondering if there is a way in distutils to
include/indicate a program icon that will be used in the program menus / desktop shortcuts.
Nothing standard, no. You may find python-distutils-extra (that’s the Debian/Ubuntu package name) interesting.
but this - while working - seems the wrong thing to do, as it
insert in the general python package something that is platform-specific.
That’s the state of things with distutils. For distutils2/packaging we’re working on a better system, but it’s not fully there yet.
Regards
Is it possible to inlcuding icon with the Application in PyQt? Clearly GUI is involved, if we talk about Aplication icons. I know the topic is out of scope here, but I was just wondering... OldAl.
[Mac Ryan, 2011-09-12]
I was wondering if there is a way in distutils to include/indicate a program icon that will be used in the program menus / desktop shortcuts.
why do you want to use distutils for that? If it's Debian specific, use Debian tools to install these files (adding "dir/file.xpm /usr/share/pixmaps/" line to debian/binary-package-name.install file should be enough) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645
On Thu, 15 Sep 2011 16:46:28 +0200
Piotr Ozarowski
why do you want to use distutils for that? If it's Debian specific, use Debian tools to install these files
Hi Piotr, having an icon for a running program it's hardly a debian-specific thing: more or less any OS have icons for programs, so it seemed a candidate good enough to have been put in the abstraction layer represented by setup.py. That said, I am very new to packaging, and so far the only way I have been able to successfully build a package has been with: python setup.py --command-packages=stdeb.command bdist_deb so I was just hoping there was a way to keep it this simple! :)
(adding "dir/file.xpm /usr/share/pixmaps/" line to debian/binary-package-name.install file should be enough)
Thanks for this, sooner or later I will try again to have a crack at packaging "from the scratch" but so far I got lost in the many possible way one could do that... [I know - from the presentation you gave somewhere and I found on the intertubes - that I should focus my attention on dh_python2, but so far I haven't been able to find a tutorial easy enough for me to follow. Recommendations on learning material are most than welcome, of course!] /mac
On Sep 15, 2011, at 06:50 PM, Mac Ryan wrote:
Thanks for this, sooner or later I will try again to have a crack at packaging "from the scratch" but so far I got lost in the many possible way one could do that... [I know - from the presentation you gave somewhere and I found on the intertubes - that I should focus my attention on dh_python2, but so far I haven't been able to find a tutorial easy enough for me to follow. Recommendations on learning material are most than welcome, of course!]
Packaging a simple, well-behaved Python package, with a well-written setup.py *can* be pretty easy, although as I'm finding with my back-and-forth with Piotr and Jakub on my flufl.* packages, not as easy as it *should* be. Still, I think it would be worthwhile to provide some concrete and modern instructions for packaging Python applications from scratch. I'm thinking something more step-by-step instructional than the Debian Python Policy, and less dependent on converting existing packages than TransitionToDHPython2. Once the four of my packages pass muster and get sponsored into Debian, I'll cobble something together for wiki.debian.org/Python. Cheers, -Barry
[Mac Ryan, 2011-09-15]
having an icon for a running program it's hardly a debian-specific thing: more or less any OS have icons for programs, so it seemed a candidate good enough to have been put in the abstraction layer represented by setup.py.
/usr/share/pixmaps (or rather "menu" package that uses icons installed there) is Debian specific. More general solution - Freedesktop.org's desktop files is *nix specific (and used f.e. by GNOME or KDE in Debian)... anyway packaging (AKA distutils2) will make it easier to install such files. -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645
On Thu, 15 Sep 2011 14:15:52 -0400
Barry Warsaw
I think it would be worthwhile to provide some concrete and modern instructions for packaging Python applications from scratch. I'm thinking something more step-by-step instructional than the Debian Python Policy, and less dependent on converting existing packages than TransitionToDHPython2.
Once the four of my packages pass muster and get sponsored into Debian, I'll cobble something together for wiki.debian.org/Python.
If you need somebody to "beta test" your tutorial (meaning: somebody who does not know much about packaging and that will try to follow it reporting parts that are unclear or question that do not find answer), just drop me a line! :) /mac
On 09/16/2011 12:50 AM, Mac Ryan wrote:
having an icon for a running program it's hardly a debian-specific thing: more or less any OS have icons for programs, so it seemed a candidate good enough to have been put in the abstraction layer represented by setup.py.
I'm thinking subclass the install command to write a myapp_config.py file which contains all the installation options. The myapp_config.py should then be installed with the program package. In the program, just import myapp_config and find application data under os.path.join(myapp_config.prefix, "share/myapp/pixmaps/....") Don't know how to make this sheme works with .eggs. Most python GUI programs use some crude hacks to find their UI data. Others simply use Makefile files. All the distutil documents/tutorials avoid to talk about this problem.
participants (6)
-
Algis Kabaila
-
Barry Warsaw
-
Just Fill Bugs
-
Mac Ryan
-
Piotr Ozarowski
-
Éric Araujo