Active Topics

 


Reply
Thread Tools
lostinmirkwood's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#51
Originally Posted by Khertan View Post
In case also you are interested ... i ve also write a piece of code to trap every untraped exception to be able to display dialog to user asking him if it want to report it to my bugtracker.
khertan, I'm quite interested in looking at that snippet if you wouldn't mind sharing.
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#52
Originally Posted by attila77 View Post
An alternative for handling this ^ is in the postinst/postrm script on the device, that way the debs are kept smaller and apt needs to track less files (at the cost of doing that yourself and a longer install time). Plus, should a system update be shipped with a pyc incompatible Python version, reinstalling the packages updates the pyc/pyo-s without any maintainer intervention.
Isn't python-support and python-central exactly for this? Python-support is even very easy to use, basically just add dh_pysupport to debian/rules and python-support to build-depends and depends. Just make sure that postinst has #DEBHELPER# somewhere
 

The Following 7 Users Say Thank You to mikkov For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#53
what he says ^, no idea how I could have forgotten about dh_pysupport
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 144 | Thanked: 134 times | Joined on Jan 2010 @ Hamburg
#54
i've managed to build my app with dh_pysupport and it seems to load faster now.

.pyc files were build. Is there a significant difference to .pyo files?
 

The Following User Says Thank You to mbo For This Useful Post:
chemist's Avatar
Administrator | Posts: 1,036 | Thanked: 2,019 times | Joined on Sep 2009 @ Germany
#55
Afaik you should not hack something "always on" in python as it is not able to properly free ram and will cause to slow down your system! Is the daemon running in background coded in python?
 
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#56
Originally Posted by chemist View Post
Afaik you should not hack something "always on" in python as it is not able to properly free ram and will cause to slow down your system! Is the daemon running in background coded in python?
Hmm? I thought Python's garbage collection was rather good.
 
lostinmirkwood's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#57
Originally Posted by mbo View Post
i've managed to build my app with dh_pysupport and it seems to load faster now.

.pyc files were build. Is there a significant difference to .pyo files?
mbo, I browsed your source code but couldn't see how you built with it, I added dh_pysupport to my build file but I'm not to certain how to edit the postinstall?
 
Posts: 144 | Thanked: 134 times | Joined on Jan 2010 @ Hamburg
#58
i'm using a hacked version of py2deb. I added python-support to build_depends and depends in debian/control and dh_pysupport to debian/control. It's important to add the path of your installed app to dh_pysupport. e.g. "dh_pysupport /opt/your-package", because your module will not be installed in a standard public path.

i've used the extras-assistant to upload the files. If something is wrong with the syntax, the build log will tell you.

The builder runs dh_pysupport and the .pyc files will be added to your .deb.

Editing postinstall was not necessary. I don't know, if this is the right way, but it worked in the end...
 

The Following User Says Thank You to mbo For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#59
Originally Posted by cb22 View Post
Hmm? I thought Python's garbage collection was rather good.
"Know thy garbage collector". No garbage collector is perfect, and Python's is no exception. It would be unfair to say that it leaks constantly and can't properly free memory - I would rather say you have to be just a little bit careful with your references and all will be well even in the longest running processes.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following 3 Users Say Thank You to attila77 For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#60
Originally Posted by chemist View Post
Afaik you should not hack something "always on" in python as it is not able to properly free ram and will cause to slow down your system! Is the daemon running in background coded in python?
The python garbage isn't weak ... there is just some things that are not auto release and you should do it yourself as there is a purpose to not release it. (read the documentation)

Personnaly i use : python -m compileall /home/opt/pygtkeditor in my post install script of pygtkeditor

Last edited by Khertan; 2010-05-05 at 06:46.
 

The Following User Says Thank You to Khertan For This Useful Post:
Reply

Tags
performance, python


 
Forum Jump


All times are GMT. The time now is 10:31.