rudi wrote:About the index: in my opinion that should be a tool in itself, that is, a general purpose index, a service other pytools modules could use, for example the completer. I mean, if you take the effort of managing an index (creating it, updating it, etc), maybe it is worth to store into it something more than the modules definitions and path.
Agreed, this could definitely be usefull elsewhere. It would be good to abstract as much of the common buisness logic into a base class as possible.
Note the sys.prefix will only work for finding the prefix of the running instance of Editra. If the user is wanting to work with other version of python (i.e 3.0) then it won't be found via this method.
So I propose adding a simple configuration dialog for this and pre populating it the best we can when the first time the plugin is used then leave it up the user to tell it what to work with.
My mind runs on Unix so I can probably work out any osx/unix issues when I get to testing .
rudi wrote:About the conf. dialog: is there an established way to save/read configurations for plugins? The .ppb file?
PYTOOLS_CONFIG = 'PyTools.Something'.
from profiler import Profile_Get, Profile_Set
store_path = util.ResolvConfigDir(u"cache")
store_path = ed_glob.CONFIG['CACHE_DIR']
cody wrote:Yes I suggest using the facilities in Editra\src\profiler.py for storing configuration info.
Ok. I added a dictionary to the main configuration. It contains just one key now (the choosen base python path) but I leave it open for more keys) and it's missing a way to change the configuration (i could add it somewhere in the find dialog or wait for a common interface for plugins configuration).
rudi wrote:Can you give it a try on osx? I tested on windows and linux but I haven't a Mac. I assume that on MacOSX python is laid out exactly as on linux: sys.prefix is something like '/usr' and python libraries are laid out like this:
Users browsing this forum: No registered users and 1 guest