Re: [jokosher-devel] Jokosher won't launch after r764.



On Mon, Oct 09, 2006 at 11:41:25AM -0400, Luke Tilley wrote:
> fixed the problem nibil pointed out on IRC that any module not found
> imported after TimeView owuld throw the wierd trace, so i went through
> file by file until I found that I didn't have the python-dbus module
> installed. So I installed it and now Jokosher's working fine again.
> 

This is what I think was happening. The Jokosher launch script is trying to
load jokosher modules first from the current directory and then if that
fails from a system installation i.e. from PYTHONPATH. It was doing this by
first trying to 'import JokosherApp' and if that failed it tried 'import
Jokosher.JokosherApp'. If JokosherApp is completely missing from both the
current directory and PYTHON PATH then this is OK and everything works. The
problem is if there is an exception whilst importing anything that
JokosherApp itself imports (and further down the chain). We have a nested
try... here and I think in allowing it to continue and try and do the second
import after the first failed has a somewhat unpredictable result. Possibly
something deep in the bowels of gobject has got run twice when it shouldn't
have done (hence the warning about Timeview already being registered just
before the exception).

In r769 I changed it a bit so it will first look for a file JokosherApp.py
in the current directory and if it finds that will import from there. If not
it uses imp.find_module() to see if there is a Jokosher.JokosherApp that is
importable and if so imports that. If none of these then exit with error.
Both the imports are not trapped so if there is a missing module then normal
python exception handling prevails. And I hope this fixes it. Unless someone
sees something I've missed.

-- 
John Green



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]