Sorry if I didn't do enough research and make my first question clear the first
time around.
It was MiscUtils/DataTable.py that was trying to load xxx.mkmodel/Classes.csv
that gave me the problem. DataTable.py at line 293 does an open for the
relative filename 'xxx.mkmodel/Classes.csv'. My script did not modify the CWD
and it was pointing to /python/webware at the point of failure.
(When I did modify the CWD to fix the above problem, something else broke - I
won't do that again.)
So I think my answer is the directory xxx.mkmodel/ must be placed in or copied
to the directory
/python/webware and the CWD must not be changed by any script (before
connecting to the MySQL database by calling MySQLObjectStore and
.readModelFileNamed). If that were documented in Quick Start, I would be
happy. Else DataTable.py must figure out the absolute address of the
Classes.csv file used by the generate process.
Your answer confused me. I downloaded and installed Webware/WebKit as a
(stable, yes I realize it is beta) Python application so I have the structure
/Python/Webware/WebKit. My code is not on the Python directory branch.
I think your answer said you are developing WebKit along with another
application, and have WebKit installed off the Python directory branch in an
application directory. Your different directory structure may be yielding
different results.
Roger Haase
Chuck Esterbrook wrote:
> 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
> Webware-discuss@...
> http://lists.sourceforge.net/lists/listinfo/webware-discuss
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|