Re: [jokosher-devel] Extensions



In principle yes. However atm Extension.py is looking at the extension to
decide how to treat it (either .py or .egg). We'd have to come up with of
another way of differentiating them.

That's OK, though; you can test whether something's an egg file with
the zipfile module.

There is another problem with extensions that occurs to me. Extensions are
meant to provide functionality that is not in core jokosher. You should also
be allowed to cater for dependencies that are not in core jokosher. E.g. I
have in the back of mind an idea of connecting from my phone using
bluetooth. Whether this would actually work or not I don't know but it would
mean the extension importing lots of dependencies that are completely
useless for anyone without bluetooth capability on their machine. The
question is what to do about these missing dependencies. We can trap for
these on startup (it goes down in Extension.LoadAllExtensions()) but what do
we do?

The extension should handle that, in a perfect world. It should neatly
not offer its functionality, or maybe add a menu item that just pops
up a "you need the bluetooth libraries" dialog, if it doesn't have all
its dependencies. All we should do in Extension.py is trap a failed
import (if the extension just tries to import something that isn't
there without checking, or any other error) and print to the debug log
"Import of extension Whatever failed", which we already do.

In the future, when the Extension Manager exists, we can have it
display what the error was, and give people a chance of fixing it, but
that's the Extension Manager's job.

sil

--
2. Make it halfway normal. I don't have any use for
laser-beam-shooting pocket combs, or non-existent existents existing
within their own existences, or ballpoint pens made out of lettuce.
          -- CardinalT dictates rules for the raif Silly Game



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