URGENT: Sanity check on some changes that may affect all of you!

34 views
Skip to first unread message

dangyogi

unread,
Jan 10, 2009, 4:27:23 PM1/10/09
to PyKE
In trying to fix the bug reported by Emma, I am going to need to
further redo how the PyKE engine initialization finds its source
files.

The 0.6 pyke.knowledge_engine.engine parameters include a tuple of
paths (defaulting to ('.',)) and a generated_root_pkg (defaulting to
'compiled_krb').

This currently lets you place your .krb files anywhere (not
necessarily on the Python Path). The examples all place the .krb
files in the same directory as the .py source files. This means that
the .krb files are in a directory accessible from the Python Path and
in the same directory as the .py module creating the engine object.

The problem is that easiest way to specify the paths is as a relative
path (hence the default of '.'), but on Windows, the program's current
working directory is often meaningless and arbitrary.

So I'm wondering whether anybody would mind terribly if I changed the
paths to be Python dotted module paths. This would require that the
location of your .krb files also be accessible (possibly indirectly)
from your Python Path. It would also require that you have an
__init__.py file in this directory to mark it as a Python package.

Please respond ASAP so that I can proceed with this.

Thanks!

-bruce

Emmanuel Laborin

unread,
Jan 10, 2009, 9:42:38 PM1/10/09
to py...@googlegroups.com
There is no problem but it seems that i was the only one working on
windows and i am not using it under windows anymore, so i don't mind
if you deprecate windows version :P.

2009/1/10 dangyogi <dang...@gmail.com>:

Jeremy

unread,
Jan 12, 2009, 2:32:52 PM1/12/09
to PyKE
This logic is one of the things I'd pull out into a separate class to
modularize for ease of porting to non-filesystem based persistence,
but I think maybe there would be payoff even for supporting different
OS filesystems.

Try to think of this as a language translation problem. Current
working directory is really an idiom for "stuff I'm working on now." I
think './' is a reasonable default path for unix-y operating systems,
but in Windows it's probably something like "%HOMEDRIVE%%HOMEPATH%
\Desktop". It's common to have different default behavior for
different OS flavors in order to try and be a good citizen in each.

I assume you just want to leverage the python import to deal with OS
file search idiosyncrasies?

Jeremy

unread,
Jan 12, 2009, 2:33:34 PM1/12/09
to PyKE
Would you still be able to test a patch?

On Jan 10, 8:42 pm, "Emmanuel Laborin" <labo...@gmail.com> wrote:
> There is no problem but it seems that i was the only one working on
> windows and i am not using it under windows anymore, so i don't mind
> if you deprecate windows version :P.
>
> 2009/1/10 dangyogi <dangy...@gmail.com>:

Bruce Frederiksen

unread,
Jan 13, 2009, 10:56:39 AM1/13/09
to py...@googlegroups.com
Jeremy wrote:
> Try to think of this as a language translation problem. Current
> working directory is really an idiom for "stuff I'm working on now." I
> think './' is a reasonable default path for unix-y operating systems,
> but in Windows it's probably something like "%HOMEDRIVE%%HOMEPATH%
> \Desktop". It's common to have different default behavior for
> different OS flavors in order to try and be a good citizen in each.
>
> I assume you just want to leverage the python import to deal with OS
> file search idiosyncrasies?
>
Yes, but even ignoring the OS idiosyncrasies, it seems like the pyke
sources are always intermingled with the python sources. So, since
python already has a mechanism to locate python sources it seems to make
sense to leverage off of that mechanism rather than developing some
other mechanism for Pyke.

Another mechanism for Pyke would also mean that developers would have
yet another mechanism to set up and configure. So using the already
configured python mechanism seems easier for the developer using Pyke too.

Reply all
Reply to author
Forward
0 new messages