At 08:55 PM 6/28/2001 -0700, haaserd wrote:
>I first placed them in my within my project directory which
>is not a branch of the Webware directory.  This caused a
>problem because when my script was executed, the CWD was
>/webware (not my project directory) and the traceback ended
>with:
>
>   File "MiscUtils\DataTable.py", line 293, in readFileNamed
>     file = open(self._filename, 'r')
>IOError: [Errno 2] No such file or directory:
>'PetroDB.mkmodel\\Classes.csv'

This is just simply a filename issue. In any Python program, you can use 
relative filenames if they are correct for your cur dir. Otherwise use an 
abs path.

Since your MiddleKit model is more likely to be located next to your WebKit 
context, than next to your Webware installation, you want to use that.

Suppose your MK directory is next to your WebKit context like so:
MyApp/
     MyApp.mkmodel/
     Context/
         Main.py
         __init__.py


In __init__.py you could take the dirname(dirname()) of the __file__ and 
add on 'MyApp.mkmodel' to get the right path.

Under no circumstance do I recommend writing WebKit code that relies on the 
current directory. Inevitably 2 separate bodies of code will start fighting 
over this.


>My second question is why the use of (from the Quick Start
>Guide) video.serialNum() when the corresponding MySQL table
>name is videoId?  Wouldn't accessing it with video.videoId()
>or naming it serialNum be less confusing?

Someone talked me into using videoId instead of serialNum for reasons I 
forget. If no one has any objections, I would be fine with changing it to 
serialNum.


-Chuck


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to