I am pretty sure that the mxDateTime isn't "stock" in any of the python
versions. You can get it (with a bunch of other potentially useful stuff)
at: http://www.egenix.com/files/python/ (it's in the BASE package).
Also, if you set the environment variable PYTHONPATH (all uppercase, in
other words) you may have better luck getting the setting to work.
All the rest of this I have no clue about, not being a MiddleKit user (yet).
David Hancock | dhancock@... | 410-266-4384
From: Steve Freitas [mailto:sflist@...]
Sent: Saturday, May 25, 2002 6:53 AM
To: Webware Discuss
Subject: [Webware-discuss] Documentation additions/corrections
I'm going through the MiddleKit docs right now... Since I can't really
program, but merely pretend to, I figure my value to the project might be in
So, I've got some. Of course, they may all be wrong, and in fact you may all
justifiably seek my life with a tire iron, but such are the risks of open
I should say that I'm really happy with Webware's docs. Getting into Webware
is so much easier than a lot of other frameworks for this very reason.
Without further ado, I hope this is helpful:
I'm in the Quick Start section...
1. After the docs recommend constructing the "generate" script, it would
help if the docs point out that when executing "generate" your $PWD needs to
be one level above "Videos.mkmodel".
2. You need to run generate from python2, not python, or it'll choke thusly:
[steve@... Middle]$ ./generate
Traceback (innermost last):
File "/usr/local/webware/MiddleKit/Design/Generate.py", line 56, in ?
File "/usr/local/webware/MiddleKit/Design/Generate.py", line 30, in
AttributeError: 'string' object has no attribute 'lower'
3. If you copied the contents of the samples directory
(MiddleKit/Docs/Videos/Middle/Videos.mkmodel/) to your new Videos.mkmodel
directory, make sure you didn't grab Samples.csv too, because it'll confuse
your generate script. The only files that should be present the first time
you run it are Classes.csv and Settings.config.
4. One of the example insets shows Unix users executing generate as
"generate", when it should read "./generate", or "python2 generate".
5. The example of creating the script "create" uses backslashes. Also,
there's no database called "Tables_in_Videos". That should be replaced with
6. The example of creating the script "insert" uses backslashes. Darn them
things. Yes, I realize we need them on *dows, but the examples ought to be
in one format or the other and stick with it. I have a feeling we've got
more *nix users than *dows users, so we probably ought to stick with
7. The main.py example won't run under python2, because it expects to import
mx.DateTime, which doesn't come with python2, or at least it doesn't in
RedHat 7.3's distribution.
8. The main.py example won't run under python 1.x either, because it imports
MySQLObjectStore, which has syntax requiring python2.
9. Still in main.py, modifying $pythonpath didn't do the trick for me -- it
couldn't find the MiddleKit modules. So I had to add a line to main.py which
read "sys.path.append('/usr/local/webware')". I expect this is because my
$PWD didn't happen to be where it wanted it. I think relying on the user's
$PWD is a bit too fragile.
I think it'd be better to replace it with...
...and encourage the reader to insert the right directory. Fiddling with
pythonpath and wondering why its contents weren't reflected in sys.path was
irritating and (fortunately) unnecessary, since I didn't know it was
expecting me to cd to a certain directory.
Woo hoo! More to come, I'm sure. I've got to stop now since my main.py won't
run and no one can hear me scream.
BTW, if anybody wants to rewrite main.py for python2, I'd sure appreciate
it, as I can get on with this business. I don't know what python2's
equivalent for 1.x's mx.DateTime is, but I'm sure one of you does! :-)
Here's the code for the terminally lazy who are better at rewriting source
than fetching it from a webpage:
# Gain access to the Middle package
import os, sys
from mx.DateTime import DateFrom
from MiddleKit.Run.MySQLObjectStore import MySQLObjectStore
# Set up the store
store = MySQLObjectStore(user='user', passwd='password')
More soon, I'm sure! :-)