Re: [Webware-devel] web site

2001-05-23 Thread Chuck Esterbrook


I always intended that each tab would have a URL, so let's try again:

- Site is Tabbed
- Tabs are things like /Intro /News /Download  etc.
- A cookie remembers what tab you were on.
- The next time you go to the site, the cookie is retrieved and a redirect 
puts you on, for example, News, because you were looking at news last time.


The point is there that we try to fit News and Intro on the same page, but 
that's a lot of content. If we favor Intro, that goes against anyone who 
has already read it. If we favor News, then that goes against a brand new 
visitor.

The cookie deal is just a simple way to let the person stick to the URL/tab 
they were last at.


-Chuck


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



Re: [Webware-devel] web site

2001-05-23 Thread Chuck Esterbrook

At 02:10 PM 5/23/2001 -0700, Tavis Rudd wrote:
>I like all this except for the part about cookies.  I agree with
>Ian and Mike about leaving this to the user and bookmarks.
>With cookies how would a person that has already been to
>the homepage then gone to News ever get back to the
>homepage?  Wouldn't it keep on redirecting them back to
>News?

If you click the Home tab, then the cookie is set to Home.
If you click the News tab, then the cookie is set to News.


None of what I mentioned precludes navigating the site, or says that once 
the cookie is set, it never sets again.

-Chuck


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



Re: [Webware-devel] you won't believe this coincidence

2001-05-23 Thread Chuck Esterbrook

At 02:00 PM 5/23/2001 -0700, Tavis Rudd wrote:
>Hi,
>I was thinking about the TemplateServer name issue again
>and did a search for 'TemplateServer' on google.
>It turns out that a company called 'The WebWare Group' filed
>a patent on something called 'TemplateServer' back in 1999!!!
>
>http://www.webwaregroup.com/product.asp?CONTENTID=69
>
>I guess it's not called TemplateServer for much longer ;)
>
>Tavis


First of all: This is utterly astounding.  :-)

Second of all: I can't believe these hosers are trying to patent the 
separation content from design. Gee, as if that never happened before 1999.


-Chuck


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



Re: [Webware-devel] web site

2001-05-23 Thread Chuck Esterbrook

At 02:33 AM 5/24/2001 +0300, Baruch Even wrote:
>What is meant is the following scenario, the last page I was in is Intro
>and I bookmarked News, when I go to my bookmarked page, I'll be
>forwarded to Intro, obviously this is not what the user wanted.

Gosh darn users!

Well, that's certainly a compelling example and I don't know of a work 
around, so I guess the smart cookie thing is out.

Thanks,
-Chuck


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



[Webware-devel] exception handling flaw in light of new streaming

2001-05-27 Thread Chuck Esterbrook

I have a servlet that flush()es it's response in order to show progress. I 
notice that if an exception occurs during the process, instead of getting 
the normal Python exception page, I get yet another exception:

Traceback (most recent call last):
   File "/usr/lib/python2.0/threading.py", line 376, in __bootstrap
 self.run()
   File "/usr/lib/python2.0/threading.py", line 364, in run
 apply(self.__target, self.__args, self.__kwargs)
   File "/var/opt/dailies/20010527/Webware/WebKit/ThreadedAppServer.py", 
line 146, in threadloop
 rh.handleRequest()
   File "/var/opt/dailies/20010527/Webware/WebKit/ThreadedAppServer.py", 
line 370, in handleRequest
 transaction = self.server._app.dispatchRawRequest(dict, strmOut)
   File "/var/opt/dailies/20010527/Webware/WebKit/Application.py", line 
317, in dispatchRawRequest
 return self.dispatchRequest(self.createRequestForDict(newRequestDict), 
strmOut)
   File "/var/opt/dailies/20010527/Webware/WebKit/Application.py", line 
355, in dispatchRequest
 self.handleExceptionInTransaction(sys.exc_info(), transaction)
   File "/var/opt/dailies/20010527/Webware/WebKit/Application.py", line 
875, in handleExceptionInTransaction
 self._exceptionHandlerClass(self, transaction, excInfo)
   File "/var/opt/dailies/20010527/Webware/WebKit/ExceptionHandler.py", 
line 41, in __init__
 self.work()
   File "/var/opt/dailies/20010527/Webware/WebKit/ExceptionHandler.py", 
line 69, in work
 self._res.reset()
   File "/var/opt/dailies/20010527/Webware/WebKit/HTTPResponse.py", line 
235, in reset
 assert self._committed == 0


At some point, we'll need more sophisticated handling. Like maybe the 
exception handler could check if the response is committed and if so, only 
display exception information if the content/type is HTML.

(This is on Linux, Apache 1.3.x, Webware CVS, mod_webkit)

-Chuck


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



[Webware-devel] Re: [Webware-discuss] TemplateServer release 0.8.0

2001-05-29 Thread Chuck Esterbrook

At 03:05 AM 5/29/2001 +0200, Tom Schwaller wrote:
>AsyncThreadedAppServer (5.1-rc3) crashes with
[snip]
>ThreadedAppServer seems to work ok..

Seems like Async:
 - has problems in general
 - is often slower than plain Threaded
 - adds more code and complexity and maintenance
 - adds more moving parts

My current impression is that we should axe it.

Opinions?


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



Re: [Webware-devel] CVS update

2001-05-29 Thread Chuck Esterbrook

At 07:54 AM 5/29/2001 -0400, Geoff Talvola wrote:
>Launch.py doesn't always get used.  For instance, OneShot.cgi and 
>ThreadedAppServerService.py don't use launch, I think.  Maybe _those_ need 
>the path fix, not Cookie?

Good point. Perhaps we need to move this to a FixPath.py which gets used by 
Launch, OneShot and ...Service.py.

-Chuck


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



[Webware-devel] verbose suggestion

2001-05-29 Thread Chuck Esterbrook

The WebKit app server in Verbose mode prints something like this:

BEGIN REQUEST
Tue May 29 08:00:46 2001
receiving request from 
request has keys: format, time, environ, input
request uri = /webkit/monkey/StyleSheet.css
connection closed.
0.06 secs
END REQUEST


Note that sometimes these messages overlap and nest when there are 
simultaneous requests.

I have never found any use for the socket address or the request keys. I 
suggest we switch to:

00548  Tue May 29 08:00:46 2001  /webkit/monkey/StyleSheet.css
00548  0.06 secs

00549  Tue May 29 08:00:50 2001  /webkit/monkey/StyleSheet.css
00549  0.03 secs


The points are:
  - reduce clutter
  - get rid of extraneous output
  - number requests so that output can be matched
  - keep the useful stuff: time stamp, URL, duration

Comments?


-Chuck


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



[Webware-devel] RE: WebKit, htmlForDict, WebSkin

2001-05-29 Thread Chuck Esterbrook

At 02:50 PM 5/29/2001 +0200, Ruggier, Mario wrote:
>The (rather terse) discussion at the beginning of xyaptu.py tries
>to list the main requirements for something like xyaptu. Other than
>**simplicity**, an important feature is that the extra template-mark-up
>in a html/xml document must itself not invalidate the html/xml document.
>But, whether the html/xml document is valid or not in the first place
>is the responsability of the author.

Right, but I was also pointing out that TS might already allow this, or be 
easy to modify to allow it. That would save you some re-invention as TS has 
plenty of features, a growing test suite, etc.


>In the case of HTML/XML, such faithfullness is a significant
>advantage as this would keep open the option to manipulate
>templates (HTML/XML + extra template mark-up) with any tool in
>the ever-growing world of XML tools. (I am quite surprised that
>*sp frameworks throw away xml-compliancy so easily, making
>generation of asp or jsp pages, from obvious tool choices such
>as xslt, require unnecessary twists and acrobatics.)

I don't personally subscribe to the "XML tools" argument, which has been 
presented to me for so long. As of today, I don't personally know anyone 
both using various XML tools and requiring that they work with their 
templates. Actually, I don't know anyone using XML tools.  :-)


>And, even if only for HTML, something as innocuos-looking as:
>
>   
> #for logEntry in $logEntries:
> ...
> 
> #end for
>
>will choke an html parser, as text is not allowed between
>table and tr. Thus the option to use parser-based html tools,
>to process and rewrite templates, is lost.

I have an HTML parser (Webware.WebUtils.HTMLTag) that works fine for the 
above. Knowing that HTML is not always precise and that various templating 
languages are already out there, my parser allows arbitrary  to 
contain text. Whether or not you want to force the issue after parsing, is 
up to you.

Likewise, most browsers will deal with the above in some fashion or another 
without balking.


>Imagine a web application with an extensive user interface, and
>an abstract description of that interface in, naturally, xml.

Actually, I find these things to be _much_ more natural in CSV than XML. 
Easier to read, edit and process. Admittedly, CSV doesn't do well with 
arbitrarily nested structures. So far, that hasn't been an issue for me.


> From this description you want to generate every actual
>'pageview' that the user sees... targeted for different contexts
>(HTML, WML, ...), different languages, and so on. The interest in
>being able to use xml-based tools to straightforwardly generate
>all pageview templates would be rather high...

My choice here is Python, which is a simple, but complete language with 
lots of power and libraries. I use XML only for communicating with other 
systems. Not for "coding", generation and such.


>Admittedly, seeing the code in a (current web) browser is a
>convenience. But this is viewer dependent. XML viewers may be used.

An XML viewer will not *render* the [X]HTML. The page designers I work with 
want to see a rendered page in Netscape or IE _with_ the templating 
instructions. So do I.


>Also note that, xyaptu syntax can also change to something like:
>for logEntry in LogEntries: ... for
>which, by default, web browsers would show the code when previewing.
>This, other than being very easy to do (change 4 regexp's), would
>be a bit of a design compromise in my view.
>
>No best way exists, ofcourse, and the gain some--lose some
>syndrome is always nagging. And then there are aesthetics...
>which is where I will stop ;-)

You're right. There are pros and cons on both sides and I've had numerous 
discussions over the past few months about them. Ultimately, I came to the 
conclusion that a Velocity-like syntax is the most productive for the most 
cases.

BTW I CCed webware-devel where these discussions on templating design are 
taking place. Although recently they have quieted down as we have phased 
out of "What should it look like?" to "Who's implementation is doing what?".


-Chuck


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



[Webware-devel] async

2001-05-29 Thread Chuck Esterbrook

At 08:20 AM 5/29/2001 -0700, Mike Orr wrote:
>But AsyncThreadedHTTPServer is also "experimental" and has its own
>problems.  (Remember how it timed out whenever I tried to log in to a
>protected page?)  So why not just give AsyncThreadedAppServer the
>same status?  Then just change the AppServer shell script to launch
>ThreadedAppServer instead of AsyncThreadedAppServer.

That's fine for the very short term, but what I'm really getting at is that 
I want to axe the async code out of the repository. It sucks up time and 
energy but doesn't seem to pay off. It was good to try it out to learn from 
it, but the lesson seems to be over.

Another problem is that there is still duplication between the various app 
servers. So if I change the verbose mode, for example, I think it has to be 
changed in at least 2 places. That's no good.

I'm interested in hearing objections to Async disappearing completely.


-Chuck


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



Re: [Webware-devel] async

2001-05-29 Thread Chuck Esterbrook

At 12:16 PM 5/29/2001 -0400, Geoff Talvola wrote:
>I'll bet some of the problems in AsyncThreadedHTTPServer would be easier 
>to fix using ThreadedAppServer as the base instead of Async, just because 
>it's simpler.  It'll just take somebody's time to do the rewrite.

[snip]


>No objection, just wait until someone has time to switch the HTTP server 
>to Threaded before completely axing the code.  I _might_ have time to do 
>it but I'd love for someone else to step up and give it a shot.

Another thought is to skip that approach and go straight for allowing 
AppSever to listen on multiple ports, each with it's own protocol. Then 
serving HTTP (FTP, BXXP, whatever) becomes an issue of a request handler 
and some configuration.

I always wanted that in the first place and others, like Terrel, have 
voiced their desire for this approach.


-Chuck


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



[Webware-devel] Re: [Webware-discuss] WebKit at WWW

2001-05-29 Thread Chuck Esterbrook

At 01:54 PM 5/29/2001 -0500, Ian Bicking wrote:
>If you have an auxiliary directory, how about putting CAdapter in it?
>It really is a lot faster than the Python version, and easier to
>install than mod_python|snake.  I've used it happily for quite a while
>now.

The only question I have at this point is a concern about maintaining the C 
Adapter. For example, at first glance it doesn't appear to have retry 
feature that the other adapters have.

mod_webkit is also based on C and I'm wondering if these two guys, 
mod_webkit and "C CGI Adapter" should share some C library code. For 
example, mod_webkit already has the retry feature.

We could call it the "C Adapter Library" and use it for any C based 
adapters including these 2.

Jay wrote mod_webkit. Jay, what do you think?


-Chuck


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



Re: [Webware-devel] verbose suggestion

2001-05-29 Thread Chuck Esterbrook

At 11:20 AM 5/29/2001 -0700, Donovan Preston wrote:
>Comments welcome, especially if there is a better way to do this.

Currently I do this like so:

python Launch.py ThreadedAppServer > Logs/stdioerr.log 2>&1 &

e.g., I know that the op sys can redirect stdout and stderr so instead of 
adding yet-another-feature, I figure I can use that.

BTW "2>&1" is a bash-ism. Other shells could be different.


Does that work for you, or is there a technical reason why Launch.py needs 
to provide this?


-Chuck


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



Re: [Webware-devel] RE: WebKit, htmlForDict, WebSkin

2001-05-29 Thread Chuck Esterbrook

At 01:40 PM 5/29/2001 -0500, Ian Bicking wrote:
>Though if IE had just kept the HTMLINPUT tag, that would have helped a
>lot too.  It was such a good idea.  Sigh.

What was that? I never heard of it.


>It's quite improper, but it works, and it gets around the fact that
> is paragraph-level.

Oh, yeah! I did the exact same thing to avoid the extra space. (sigh)


>I must say that MiddleKit's CSV model descriptions are awfully
>annoying.  I write code in a text editor, the model is part of the
>code (even if it declarative), and counting commas is difficult.

You're only annoyed because you're using a text editor.
Use any spreadsheet. Then you will be very happy.


>But I'd personally prefer it just be a Python expression, like maybe:
>
>Klass('Video', isAbstract=True, attributes=[
> Attribute('title', 'string', isRequired=True, min=1, max=100),
> Attribute('directors', ['Person'], isRequired=False, max=100),
> Attribute('cast', ['Role'], isRequired=False),
> ])
>
>Or something like that.  I don't like 'list of Person', but ['Person']
>isn't that good either.

You can do this now. Check out the test suite for UserKit. I create an MK 
model there *in Python*.

Knock yourself out.  ;-)


>Anyway, XML would still be much more readable for me, and better able
>to support future expansion without getting unreadable.

Well, you can add the support if you like. MK models can be created by CSV 
or Python. XML would just be another technique.

I'm not sure at what point we should break out the reading of models into 
mix-ins rather than the main base...


I'd also be curious if ArgoUML's flavor of XML could be read *and* if 
ArgoUML is flexible enough to capture non-UML-corresponding aspects of MK's 
model via attribute dictionaries (or some other technique) in the GUI. 
Why?  Because then you could define your object model in Argo and use it in 
MiddleKit.

http://www.argouml.org/



>I have kind of moved elsewhere, as I've decided I've needed to do
>more, um, concretely productive work.  But I still kind of like the
>ZPT syntax.  Specifically, there's no good way to do table-row
>repetition solely within a WYSIWYG editor with the Velocity-style
>syntaxes (which is, on the larger level, the same syntax that most
>template systems use -- i.e., on the text level).  It's also nice with
>dynamic SRC attributes in a IMG tag, where Velocity-style means you
>get a broken image, and also don't get automatic HEIGHT and WIDTH
>tags, or whatever else your WYSIWYG editor can do for you.

I'm not clear on why Velocity breaks images:



$foo could expand to:
 "foo.gif"
or even:
 "foo.gif" width=10 height=10

What am I missing?


>I also like the ability to use the same system to do HTML-level
>transformations.  Similar to XSLT, except in a procedural language we
>already know (Python).

Would WebUtils.HTMLTag help at all here? It puts HTML into a Pythonic 
structure. It doesn't have many manipulative conveniences right now. Just 
searching and writing the HTML back out.


-Chuck


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



Re: [Webware-devel] webkit rc script

2001-05-29 Thread Chuck Esterbrook

At 02:16 PM 5/29/2001 -0500, Ian Bicking wrote:
>The webkit rc script includes /etc/rc.d/init.d/functions.  My Debian
>system doesn't have such a file.  It seems like the only function used
>is "success".  If that definition was inlined, it would make it more
>portable.
>
>But otherwise it works good.

I'd prefer to do something like:

if debian():
 def success():
 foobar()
else:
 source functions


The idea being that if a distro or sys admin customizes the 'functions' 
file, then WebKit behaves like a good citizen.

However, I'm bash-illiterate and I don't know how to detect Debian. Ian, 
would you like to patch and submit?


-Chuck


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



Re: [Webware-devel] Re: [Webware-discuss] WebKit at WWW

2001-05-29 Thread Chuck Esterbrook

At 05:59 PM 5/29/2001 -0500, Ian Bicking wrote:
>Well, retry is just a code structure issue, not something that could
>fit in a library.  It could be added easily enough.

Retrying has 2 settings: How many times to retry and how long to wait in 
between. Code is required to read those settings.


>The whole thing is just 248 lines, there's not a lot there to share
>anyway.  The most useful might be the marshalling.  mod_webkit uses
>Python's marshalling functions, I think.  I just recreated the small
>portion needed to send the request, with about 40 lines.  The other
>portion might be reading and parsing address.text, and opening the
>connection to it.  That's 25 lines of C.  Not really worthy of reuse.

Disagree. Things like marshalling, reading address.text, reading the config 
will continue to grow over time. Why write all this stuff twice?


>I could add the retry, but just haven't.  I would actually prefer to
>add something that restarted the AppServer upon failure or timeout, as
>I feel this solves the problem much more robustly than retrying does.

So here's another example. If we write code to restart the app server, I 
understand that we have to write it once in Python and once in C. But I 
don't ever want to write it four times in Python (which is why we have a 
base Adapter class) and twice in C.

I already have problems with the various AppServer classes which duplicate 
code and make maintenance more of a chore.


>I don't think it should be too hard to maintain, really.  All the
>adapters are well partitioned from the rest of Webware.  As long as
>Webware continues to take input over the socket in the same format,
>the adapter won't need any updating.

It would be strange to have a mismatch in features:
- mod_webkit: will retry, but not restart
- c cgi: will not retry, but will restart

Our current situation is that switching adapters is a matter of 
configuration preference, not functionality. I'd like to keep it that way.


>The one big problem is that it doesn't have any configurability,
>except to recompile it.  Right now there's nothing to configure except
>the location of address.text, which is just as easily configured with
>a symbolic link.  If there were timeouts and such, those would need
>configurability, though maybe recompiling would be fine too.

CAdapterLib
 - read address.text
 - read a config file
 - retry loop?
 - restart app
 - future features X, Y and Z


-Chuck


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



Re: [Webware-devel] RE: WebKit, htmlForDict, WebSkin

2001-05-29 Thread Chuck Esterbrook

At 06:24 PM 5/29/2001 -0500, Ian Bicking wrote:
>Chuck Esterbrook <[EMAIL PROTECTED]> wrote:
> > At 01:40 PM 5/29/2001 -0500, Ian Bicking wrote:
> > >Though if IE had just kept the HTMLINPUT tag, that would have helped a
> > >lot too.  It was such a good idea.  Sigh.
> >
> > What was that? I never heard of it.
>
>Apparently for a beta (5.0 beta, maybe) they had something like
>TEXTAREA... maybe it was called HTMLAREA.  Anyway, you could enter
>rich text, with bold, italic, etc.  IE would then send it as text with
>HTML markup.  But they took it out :-(

Holy cow, I could have totally used that for my current CMS project.


>I don't like spreadsheets.  I code in Emacs.  I read my mail in
>Emacs.  I love Emacs.  I never ever use spreadsheets, why use them for
>this one thing?

Because Emacs does not and never will contain the entire world. It doesn't 
do diagrams, it doesn't do spreadsheets, it doesn't play video games, it's 
not a bash shell (AFAIK), etc.

And it shouldn't be. If you eventually poured everything in there, you 
would have an op sys and a bunch of programs. But we already have that.


> > You can do this now. Check out the test suite for UserKit. I create an MK
> > model there *in Python*.
> >
> > Knock yourself out.  ;-)
>
>I'm unclear, once I've created the model how do I create the store
>based on that model?

I think there are 2 methods. readModelFileNamed() and setModel() or 
something like that. It's all in UserKit/Tests/Test.py. Find makeModel() 
and go from there.

Also, since white space is stripped off of field values by default, you 
could align your CSV columns with spaces.

Or use a spreadsheet.  :-)


> > I'd also be curious if ArgoUML's flavor of XML could be read *and* if
> > ArgoUML is flexible enough to capture non-UML-corresponding aspects of 
> MK's
> > model via attribute dictionaries (or some other technique) in the GUI.
> > Why?  Because then you could define your object model in Argo and use 
> it in
> > MiddleKit.
> >
> > http://www.argouml.org/
>
>I've never really understood what UML languages really offer over just
>reading something and thinking about it.

If you read and think that doesn't produce anything that someone else can 
use. I guess UML becomes more useful as you work with more people.

Also, if MK could drive off of UML, then that would be another way (vs. CSV 
and Python) to create the models that MK requires.


> > 
> >
> > $foo could expand to:
> >  "foo.gif"
> > or even:
> >  "foo.gif" width=10 height=10
> >
> > What am I missing?
>
>The WYSIWYG editor would really like to know what image you are
>inserting.  The editor of course can't find any image named $foo.  It
>would be easier for it to understand
>
>
>
>Or whatever.

I see. The preview will be broken. Good point.


> > >I also like the ability to use the same system to do HTML-level
> > >transformations.  Similar to XSLT, except in a procedural language we
> > >already know (Python).
> >
> > Would WebUtils.HTMLTag help at all here? It puts HTML into a Pythonic
> > structure. It doesn't have many manipulative conveniences right now. Just
> > searching and writing the HTML back out.
>
>Yes.  Like I said before, HTMLTag is fairly close to equivalent to the
>structure I used.  The transformer I used that implemented the
>ZPT-style attribute-based language also could be used to transform the
>HTML from one form to another.  I felt this was best handled as a
>transformation, not a method of the HTML parse tree.
>
>To give an example of HTML transformation, here's the code to change
>all A HREF tags to use redirects (so you can log it) and have some
>JavaScript to hide you are doing that:
>
>def a_transform(node):
> if not node.has_key("href"):
> # It must be a  node, which we don't care about
> return node
> loc = node["href"]
> if loc[:7] != "http://"; and loc[:8] != "https://":

In Py 2.0 and later:
 if not loc.startswith('http://') and not loc.startswith('https://'):


> # It's a local site or something, so we don't need to log
> return node
> node["href"] = '/redirect.cgi?loc=%s' % urllib.quote(loc)
> node["onMouseOver"] = "window.status='%s'" % htmlEncode(loc)
> node["onMouseOut"] = "window.status=''"
> return node


-Chuck


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



Re: [Webware-devel] RE: WebKit, htmlForDict, WebSkin

2001-05-29 Thread Chuck Esterbrook

At 08:08 PM 5/29/2001 -0500, Ian Bicking wrote:
>Python code is well-structured and far richer than what a spreadsheet
>can represent, because it structures it in a grammar.  No novice is
>ever going to edit a model description, so it's no hinderance to use.

I've had novices read MK models and glean much information from them. Heck, 
I even have users reviewing models so they know what information is being 
tracked and can speak up if something is missing.

Furthermore you can use a model in combination with code to do things. For 
MiddleKit models, we have SQL creation statements, runtime SQL code, HTML 
input forms and HTML tables.

There's a place for models and there's a place for general programming code.


>Probably.  But I think a good English description is useful too, and
>general enough to be all-encompassing, flexible enough to be as formal
>as you desire.  And it's easy to inline ASCII representations of the
>description, and I suppose possible (though more difficult :) to
>inline spreadsheets.

You can't generate anything precise off of an English description, which in 
general can't be reasonably formalized (while still being worthwhile to 
read, write and parse for these purposes).


>I mean, I'm not *opposed* to them or anything.  It just always seemed
>like organizational cruft to me, but I've never actually been in a
>situation where they've been used.

I'll have to hire you some day, so I can make you use models, config files, 
metadata, etc.  :-)


-Chuck


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



Re: [Webware-devel] # in Templates

2001-05-29 Thread Chuck Esterbrook

At 12:49 AM 5/30/2001 -0500, Ian Bicking wrote:
>Well, if ## comments seem odd, how about:
>
>#comment 
>
>That's easy, easy to read, and doesn't propogate funny symbols.  I
>think I considerably prefer it to ##, especially since I prefer # as a
>terminator too, since that feels balanced to me.

Isn't the terminator for TS  #;  ?
Or was it ;#  ? I forget...

I like ##. It's not ambiguous and it's easy to type.


-Chuck


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



[Webware-devel] cvs update: AppServer CheckInterval setting

2001-05-29 Thread Chuck Esterbrook

Just a minor update. There is a new CheckInterval setting that defaults to 
100. The value is passed to sys.setcheckinterval().

As shown in earlier benchmarks, this improves WebKit's performance by a 
worthwhile amount. Higher values achieve almost nothing.

100 is also the same value baked into Zope, which is an interesting 
reference point.


-Chuck


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



Re: [Webware-devel] # in Templates

2001-05-29 Thread Chuck Esterbrook

At 01:11 AM 5/30/2001 -0500, Ian Bicking wrote:
>Yeah.  *I* just *think* it should be #.  I don't actually remember
>quite what it is either.

Well, for what it's worth, I prefer ;

I think ;# looks awkward at best and confusing at worst.


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



Re: [Webware-devel] # in Templates

2001-05-29 Thread Chuck Esterbrook

At 11:31 PM 5/29/2001 -0700, Tavis Rudd wrote:
>I agree with you about that. It's just a pain in the ass to
>switch to a single char closure - i.e. create
>a parser that would be able to handle all the different types of
>directives in addition to $placeholders.  Adding a new directive
>is currently a 5-10 minute process.  I suspect it would be much
>more difficult to add new directives to a parser.  For the amount
>of use the explicit closures are going to see it's just not worth
>the effort.

Although I wonder for the amount of new directives that will be added, if 
keeping that process short on time is a big deal. Velocity docs mentioned 
that macros eliminated much of the need for additional directives past the 
basic set.

Just a thought.

-Chuck


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



[Webware-devel] cvs update: verbose output

2001-05-29 Thread Chuck Esterbrook

I tightened up the verbose output of the app server (Threaded only; not 
Async) as described earlier. I ended up putting the request URI on the 
second line with duration for even easier matching.

I don't currently have PATH_INFO in there, or any configuration options, 
both of which need to be looked at in the future.

-Chuck


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



Re: [Webware-devel] # in Templates

2001-05-30 Thread Chuck Esterbrook

(starting to chant)

Parse! Parse! Parse! Parse! Parse! Parse!


:-)


Actually, I'm curious: What are the other syndromes? I forget.


At 02:00 AM 5/30/2001 -0500, Ian Bicking wrote:
>Just bite the bullet already and use the parser!  It won't be 1.0
>until you use a parser, no matter what, because this is only one
>syndrome of the lack of a parser among many syndromes.
>
>Tavis Rudd <[EMAIL PROTECTED]> wrote:
> > On Tuesday 29 May 2001 23:34, Ian Bicking wrote:
> > > To be safe, any use of this syntax in a WYSIWYG editor
> > > should use explicit closures -- newlines are meaningless
> > > in HTML, and you never can be sure how the editor will
> > > treat them, or preserve them.
> >
> > Good point. You raised this before, but I'd forgotten.
> >
> > Short of going the parser route how about
> > #if $test /#
> > instead of
> > #if $test ;#
> > ?
> >
> >
>
>___
>Webware-devel mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/webware-devel


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



[Webware-devel] Fwd: [Zope-Annce] Zope Survey results posted

2001-05-30 Thread Chuck Esterbrook

FYI

>MBOX-Line: From [EMAIL PROTECTED] Wed May 30 19:00:18 2001
>X-Yahoo-Forwarded: from [EMAIL PROTECTED] to [EMAIL PROTECTED]
>X-Track: -10
>From: Gary Graham <[EMAIL PROTECTED]>
>To: Zope Questions <[EMAIL PROTECTED]>
>cc: <[EMAIL PROTECTED]>
>Organization: Digital Creations
>X-Mailer: GoldMine [5.50.10424]
>Subject: [Zope-Annce] Zope Survey results posted
>Sender: [EMAIL PROTECTED]
>X-BeenThere: [EMAIL PROTECTED]
>X-Mailman-Version: 2.0.5 (101270)
>List-Help: 
>List-Post: 
>List-Subscribe: ,
> 
>List-Id: Zope Web Application Server Announcements 
>List-Unsubscribe: ,
> 
>List-Archive: 
>Date: Wed, 30 May 2001 12:18:09 -0400
>
>
>Digital Creations recently sent out a survey request to find out more
>about how Zope is being used. The results of that survey request have
>been posted. If you would care to view the survey summary see :
>
>http://www.zope.org/Members/gary/Zope_survey
>
>Thanks again to everyone for participating!
>
>--Gary
>
>Gary Graham
>[EMAIL PROTECTED]
>
>Digital Creations
>
>office : 540.361.1720   mobile : 540.840.3813
>fax: 540.371.1201   main   : 540.371.6909
>www.digicool.comwww.zope.com
>www.python.org  www.zope.org
>
>___
>Zope-Announce maillist  -  [EMAIL PROTECTED]
>http://lists.zope.org/mailman/listinfo/zope-announce
>
>   Zope-Announce for Announcements only - no discussions
>
>(Related lists -
>  Users: http://lists.zope.org/mailman/listinfo/zope
>  Developers: http://lists.zope.org/mailman/listinfo/zope-dev )


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



Re: [Webware-devel] async

2001-06-01 Thread Chuck Esterbrook

At 09:40 PM 5/31/2001 -0400, Jay Love wrote:
>But, I can also maintain it locally just as easily, as I am the only one
>with an interest in it. :)

My only concern is the number of users that will attempt to use it and have 
issues, report problems, etc. As a Webware developer, I don't want to be 
required to maintain it as I muck with AppServer.

However, I can understand the desire to have it in CVS for various reasons.

Putting that all together, perhaps we can put it under an Experiements/ 
directory. Or a different branch.

Comments?


-Chuck


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



Re: [Webware-devel] cvs update

2001-06-03 Thread Chuck Esterbrook

At 10:26 AM 6/3/2001 -0400, Jay Love wrote:
>I've looked through and all looks good.  It builds on Linux.  Thanks for 
>the effort, Geoff.
>
>FYI, I'm going to rearrange the directory layout for mod_webkit later 
>today.  I'll create a native subdirectory of WebKit, and put in there 
>mod_webkit1.3, mod_webkit2.0, wk_isapi, wk_cgi, and common.  All is for C 
>source.

What'll we call it?


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



[Webware-devel] cvs update: Launch.py revamp

2001-06-04 Thread Chuck Esterbrook

I ran into a problem where an "import Foo" was picking up the Foo in 
WebKit. Launch.py was previously tweaked to fix this but then got tweaked 
back. However, we don't ever want "import Foo" to assume WebKit.

I made the following changes:

- Incorporated Geoff's path cleaning code from Cookie.py. No path ending in 
'webkit' or equal to '.' is kept.

- '' is always the first sys.path element.

- The cur dir becomes Webware/

- Got rid of WebwarePathLocation usage. A script always knows where it's at 
with:
os.path.dirname(os.path.join(os.getcwd(), sys.argv[0]))


I tested on Windows ME. Please give it a try.

If you think further Launch.py mods are required in the area of path 
management, let's discuss them on the list first.


-Chuck


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



Re: [Webware-devel] cvs updates: Dynamic Number of Thread

2001-06-04 Thread Chuck Esterbrook

At 10:41 AM 6/4/2001 -0400, Geoff Talvola wrote:
>At 09:36 PM 6/3/01 -0400, Jay Love wrote:
>
>>We talked about this a while back, and I thought the conclusion was to do 
>>it.  It's not very complex, anyway.  But let's revive the debate
>
>Last time we went around on this issue, I argued that you're better off 
>preallocating all needed threads up front.  At least on Windows NT, the 
>overhead of a thread that's merely blocking on a Python Queue is basically 
>nil.  Other OS's may have worse thread implementations though -- for all 
>of NT's faults, it seems that threading is one thing it gets right.

I don't have a strong opinion on this particular one at this point.


>I also argued that we'd be better off storing the threads on a stack 
>instead of a queue.  That way the most recently used threads get reused, 
>which may produce slightly better performance.  I wonder if there's a 
>thread-safe Stack class analogous to the Queue class that comes with Python?

That's a good point. Queue.py is only 140 lines of code and it would 
probably be pretty easy to create a Stack.py. I'd be curious about the 
change in benchmarks, if any. Stack.py is only worth it if it results in a 
gain.


-Chuck


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



Re: [Webware-devel] cvs update: Launch.py revamp

2001-06-06 Thread Chuck Esterbrook

At 08:56 PM 6/5/2001 -0400, Jay Love wrote:
>Chuck Esterbrook wrote:
>
>>I ran into a problem where an "import Foo" was picking up the Foo in 
>>WebKit. Launch.py was previously tweaked to fix this but then got tweaked 
>>back. However, we don't ever want "import Foo" to assume WebKit.
>
>Because WebKit is a package, any modules in the WebKit package that call 
>"import Foo" should get WebKit.Foo first.  The WebKit part is 
>automatically appended.  That is why it doesn't matter in your servlets if 
>you say "from WebKit import Page" or just "import Page".  Either way, if 
>you look in sys.modules, you'll see WebKit.Page.

We had problems earlier where these 2 statements resulted in the module 
being loaded twice (which was flushed out by the assertion that the servlet 
really was a subclass of WebKit's Servlet):

 import Page
 import WebKit.Page

Contexts are now required to qualify WebKit in their imports as WebKit is 
it's own package. Only modules inside WebKit/ can (and should) use "import 
Foo" which is the natural, Pythonic style for importing "neighbor" modules 
in the same package.

Also, a .py in my context said "import Message" and got the Message inside 
of WebKit. That's not what was intended.


>>I made the following changes:
>>- Incorporated Geoff's path cleaning code from Cookie.py. No path ending 
>>in 'webkit' or equal to '.' is kept.
>>- '' is always the first sys.path element.
>
>Note that '' is not os.cwd.  '' is the directory the module calling 
>"import" is in.  Therefore, you ARE including WebKit, assuming you are 
>calling import from a module in the WebKit directory, or any subdirectory 
>(since its a package).  So that's not what you want.

No, that *is* what I want. If Foo.py and Bar.py exist in the same package, 
then the Pythonic way for them to access each other is via "import Bar" or 
"import Foo". However, everything outside the pkg should specify the pkg name.

Likewise, anything outside WebKit (e.g., a context) should also qualify 
WebKit, while things inside it should not.


>>- The cur dir becomes Webware/
>
>Why don't we eliminate this reliance on the cwd?  Why are you insisting on 
>that?

Because in the end, the combination of all these things I have listed works.


>I am not sure that everyone is on the same page on this path stuff.
>Clearly, I think I know, but so do you Chuck.  I don't like the reliance 
>on CWD, because it means that you may have to do some tricks to call it 
>from an init script or elsewhere.

What tricks? Can't you just do this:

python /foo/bar/Webware/WebKit/Launch.py ThreadedAppServer


-Chuck


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



Re: [Webware-devel] cvs update: Launch.py revamp

2001-06-06 Thread Chuck Esterbrook

At 09:30 PM 6/5/2001 -0400, Jay Love wrote:
> > Chuck Esterbrook wrote:
> > >
> > > - Got rid of WebwarePathLocation usage. A script always knows where
> > > it's at with:
> > > os.path.dirname(os.path.join(os.getcwd(), sys.argv[0]))
> >
> > That might work.  Good idea.
>
>Whoops, this'll need some work.  On Linux, sys.argv[0] will be different
>depending on how the script is launched, either "python Launch.py" or
>"./Launch.py".

That's not what I would expect and don't recall experiencing that in the 
past. After all, it's not even useful behavor? What version of Python and 
Linux are you using?

Mine works fine:


[echuck ~]$ cat foo.py
#!/usr/bin/env python
import sys
print sys.argv

[echuck ~]$ ./foo.py
['./foo.py']

[echuck ~]$ python foo.py
['foo.py']

[echuck ~]$ uname -a
Linux 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686 unknown

 >>> sys.version_info
(2, 0, 0, 'final', 1)



-Chuck


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



[Webware-devel] TS 0.8.1 bug

2001-06-06 Thread Chuck Esterbrook

I switched from TS 1.2.2 (an older version) to 0.8.1 (a newer version). My 
tiny test suite now fails:

FAIL
--
Traceback (most recent call last):
  File "test.py", line 23, in checkCases
assert plate.results()==output, 'Failed\n\tinput = %r\n\toutput = 
%r\n\tresults = %r\n' % (input, output, results)
AssertionError: Failed
input = '$a and $b'
output = '1 and 2'
results = '$a and 2'

==

For some reason, TS is not picking up the first $variable.


This can be recreated at the interactive prompt:

 >>> from TemplateServer.Server import Server as TS
Traceback (most recent call last):
   File "", line 1, in ?
ImportError: cannot import name Server
 >>> from TemplateServer.Server import TemplateServer as TS
 >>> d = {'a': 1}
 >>> print TS('$a', d)
$a



-Chuck


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



Re: [Webware-devel] TS 0.8.1 bug

2001-06-06 Thread Chuck Esterbrook

At 12:16 PM 6/6/2001 -0700, Tavis Rudd wrote:
>Hi Chuck,
>can you try this with TS 0.8.2, which I've just uploaded.
>It includes half-complete docs, which should be 3/4 complete
>by the end of the day.

Have you tried it? It's 2 lines:

 >>> from TemplateServer.Server import TemplateServer as ts
 >>> print ts('$a', {'a':1})
$a

Doesn't work for me. What about you?


>CHANGES TO NOTE:
>- the explicit tag closure is now /#

Does that mean that
 #end if
no longer works?


>- <# multi-line comments #> are now #comment /# ... #/comment/#

You mean:
 <#
 blah blah
 #>
becomes:
 #comment /#
 blah blah
 #/comment/#
???

That seems arcane at best. Why is there /# after the first #comment? Why 
does it end with #/comment/#? My chances of remembering the new format are 
close to zero.


-Chuck


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



Re: [Webware-devel] TS 0.8.1 bug

2001-06-06 Thread Chuck Esterbrook

At 01:05 PM 6/6/2001 -0700, Tavis Rudd wrote:
>On Wednesday 06 June 2001 12:28, Chuck Esterbrook wrote:
> > Have you tried it? It's 2 lines:
> >  >>> from TemplateServer.Server import TemplateServer as
> >  >>> ts print ts('$a', {'a':1})
> > $a
> > Doesn't work for me. What about you?
>
>Yes, it works fine with ver 0.8.2, though I can't vouch for 0.8.1.
>It also passes all 143 test cases.

Well I installed over 0.8.1. I tried setup.py's help and didn't see an 
option for un-install.

So now I removed TemplateServer from my Python directory. I then tried to 
import while in C:\ and got "unknown module" or whatever. This verifies the 
installation was gone. Then I went to the right directory and did this:

C:\All\Packages\Python\TemplateServer-0.8.2>python
ActivePython 2.0, build 202 (ActiveState Tool Corp.)
 >>> from TemplateServer.Server import TemplateServer as TS
 >>> print TS('$a', {'a': 1})
$a

So it still has the bug.

I ran Tests.py and got half failures:
--
Ran 143 tests in 2.200s
FAILED (failures=71)


Here is the first failure:
==
FAIL: runTest (__main__.VerifyTemplateOutput)
--
Traceback (most recent call last):
   File "Tests.py", line 69, in runTest
 assert output == self.expectedOutput, \
AssertionError: Template output mismatch
 Test Title: posixCases: single $var
 Input Template = %(template)s
 Expected Output = blarg
 Actual Output = $c


That's on Windows ME. On Linux, I get identical results:

[echuck@devo TemplateServer]$ python Tests.py > results.text
[echuck@devo TemplateServer]$ tail results.text
bloggs
#/arg

#/callMacro


--
Ran 143 tests in 1.948s

FAILED (failures=71)



Are you testing your workspace for 0.8.2, or a fresh download of the 0.8.2 
package at http://calrudd.com/TemplateServer/?


> > >CHANGES TO NOTE:
> > >- the explicit tag closure is now /#
> > Does that mean that
> >  #end if
> > no longer works?
>
>You're referring to the end tag.  I'm referring to
>the explicit tag closure.  Remember it used to be ;#
>Implicit closures are the end of the line.
>
>But also remember that we scrapped #end if in favour of
>#/if many weeks ago.

Who is "we"?  :-)

At some point both were supported. I don't remember if both still are or 
not. I'm getting the impression that just #/if is supported now.


>I'm not totally set on this but, the reason I changed it
>from <# #>  was to make it
>symmetrical with the rest of the directives.
>I want to have only 2 tag types in TemplateServer:
>$placeholders and #directives.  Comments should be a type
>of directive <# #> doesn't fit with the rest of the syntax.  Ian
>suggested #comment.
>
>Velocity uses #*  blarg *# for multiline comments.  I could go
>for that as well.  It's almost symmetrical.

Comments are almost always special in various languages--because they 
really are special. :)   Hence Python's # and C's /* */ which have nothing 
to do with the rest of the language.

I thought <# ... #> was fine, but if you want something else and closer to 
directives, then I'd prefer   #/* blarg */#  or even  /* ... */

/* ... */ is already used in CSS and C so it has some mind share, even with 
designers...


-Chuck


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



Re: [Webware-devel] TS 0.8.1 bug

2001-06-06 Thread Chuck Esterbrook

At 01:53 PM 6/6/2001 -0700, Tavis Rudd wrote:
>I wonder if it's a Python version problem. I'm using 2.1.
>checking  yep!! it doesn't work with 2.0, but I have no
>idea why.  I haven't used nested scopes and can't think of
>anything else that is 2.1 specific.  Any suggestions for where
>to look?

Wow. Scary.   I don't know enough about 2.1 to say. I didn't see enough 
changes in the release notes to make me think such incompatibilities easily 
arose.

Well, it might be just in one place that gets used a lot.


> > >But also remember that we scrapped #end if in favour of
> > >#/if many weeks ago.
> >
> > Who is "we"?  :-)
>well ... I posted about doing this, got no objections, posted that
>I had done it, still no objections and assumed it was 'we' ;-)

Sorry. I must have missed it.


>I'd really like to keep only one style or the other.  / or end
>for the end tags.  I'd also like to have it consistent from one
>directive to the next.

I strongly favor 'end' as it keeps the symbology down to just $#. And it 
reads good.


> > At some point both were supported. I don't remember if
> > both still are or not. I'm getting the impression that
> > just #/if is supported now.
>that's right.  It's my preference, but if there are strong objections
>to it I'm not against changing everything to 'end' from /

Objection.

:)


>your posting caught me in the middle of thinking and toying
>with this idea. I had literally just finished changing it as an
>experiment.  I'd like to scrap <#  #>, but am totally flexible about
>its replacement:
>/* ... */
>#* ... *#
>#--  ... --#
>
>I think I prefer the velocity style as it is simple, unique, and almost
>symmetrical with the rest of the #directives.  Any objections?

I slightly prefer /* */, but I won't harrass anyone over #* *#.


-Chuck


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



[Webware-devel] TS 0.8.4

2001-06-07 Thread Chuck Esterbrook

Tavis,

Thanks for getting the "#end if" change in so fast.

The first time I run the test suite, I get 8 failures all related to #parse 
and #include. However, every time after that the suite passes.

The difference seems to be that the first run creates a parseTest.txt file. 
There is probably a minor flaw in the logic that doesn't create this file 
the first time.

I get the same results on Windows ME & Linux, Python 2.0.

Also, on Linux I cannot see the periods (.) being printed as progress is 
made. On Windows I can. That might be a flaw in unittest related to terminals.


Tonight I will install Py 2.1 on a Linux box and then write a PyVerTests.py 
that runs the test suite for 2.0 and 2.1 (assuming you have both installed).

-Chuck


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



[Webware-devel] TS change request

2001-06-07 Thread Chuck Esterbrook

TS currently uses #parse and #include. The first groks the file, the second 
just copies the contents with no interpretation.

I think the functionalities are good, but not the names.

Consider the terms used by other languages:
   - SSI: include
   - IE/HTML: @import
   - Python:  import
   - Objective-C: import
   - Modula:  use
   - C/C++:   include

All of these languages have to read, lex, parse, bind, interpret/compile, 
etc. to make imports happen. But instead of naming the statement after a 
particular step of that process, they used a high level name (usually 
"include" or "import").

That also points to another flaw in the #parse name. It could just as 
easily be named after any of the other various operations, for example #lex 
or #compile or #bind.

Another difficulty is that with so many languages, including SSI, using 
#include for one thing, having it mean something else in TS will be confusing.


I'd like to rename #parse to #include and #include to #copy. So that would 
be #include and #copy.

My reason for #include over #import is that most languages see to use 
#include for actually including contents (such as an SSI include or a C 
header file) and "import" for referring to something loaded, but not made 
part of output (Python). Also, page designers might recognize #include from 
SSI.


-Chuck


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



Re: [Webware-devel] TS 0.8.4

2001-06-07 Thread Chuck Esterbrook

At 10:09 AM 6/7/2001 -0700, Tavis Rudd wrote:
>Would you mind sending me a copy that I can put in the
>package.

That was my plan.


-Chuck


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



Re: [Webware-devel] TS change request

2001-06-07 Thread Chuck Esterbrook

At 10:18 AM 6/7/2001 -0700, Tavis Rudd wrote:
>Chuck,
>I agree with all this, but don't like the name #copy
>
>#verbatimInclude
>or
>#verbatim-include
>or
>#plainInclude
>or
>#plain-include
>
>would be better. Your thoughts?

I prefer #copy to the above.

Another choice is to have an optional argument to #include:
#include "foo.text" interpret=0

Or insert:
#insert "foo.text"
All though that is a little vague and starting with "in" like "include" 
might create brainspace competition. Forget "insert".

BTW your examples bring up the interesting point of compound word 
directives. I don't see any reason why we can't allow a space like we do 
with "#end if". For example:
#include verbatim "foo.text"


-Chuck


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



[Webware-devel] Fwd: Re: [Quixote-users] PTL docs

2001-06-07 Thread Chuck Esterbrook

FYI, here is how the Quixote folks do templating. I personally don't find 
it very attractive. I'd rather write servlets, PSP or Velocity-like 
templates. Maybe I'm just biased.


>To: [EMAIL PROTECTED]
>Subject: Re: [Quixote-users] PTL docs
>Mail-Followup-To: [EMAIL PROTECTED]
>From: Andrew Kuchling <[EMAIL PROTECTED]>
>Sender: [EMAIL PROTECTED]
>List-Subscribe: ,
> 
>List-Id: Discussion of the Quixote Web development framework 
>
>Date: Thu, 7 Jun 2001 13:08:27 -0400
>
> >On 05 June 2001, Goodger, David said:
> >> One more question: Are there some newbie examples or docs that I could get
> >> my hands on? Thanks again.
>
>Here's a first cut at a PTL.txt file that will be in Quixote 0.3.
>Comments?
>
>--amk
>
>
>Python Template Language (PTL)
>==
>
>The good news is that PTL's syntax is almost exactly like Python.  The
>differences are a single different keyword, and expressions inside
>templates have their values kept, not discarded.  Here's a sample
>template:
>
>template foo (x, y = 5):
>   "This is a chunk of static text."
>   greeting = "hello world" # statement, no PTL output
>   print 'Input values:', x, y
>   z = x + y
>   """You can plug in variables like x (%s)
>in a variety of ways.""" % x
>
>   "\n\n"
>   "Whitespace is important in generated text, \n"
>   "and z = "
>   str(z)
>   ", but y is "
>   y
>   "."
>
>Templates are the PTL analogue to Python functions.  Templates are
>defined using the 'template' keyword, obviously, and they can't have
>docstrings, but otherwise they follow Python's syntactic rules:
>indentation indicates scoping, single-quoted and triple-quoted strings
>can be used, the same rules for continuing lines apply, and so forth.
>PTL also tries to follow the semantics of normal Python code as far as
>is possible, so templates can have parameters, and the parameters can
>have default values, be treated as keyword arguments, etc.
>
>The difference between a template and a regular Python function is
>that inside a template the result of expressions get saved as the
>result of that template.  Look at the first part of the example again:
>
>template foo (x, y = 5):
>   "This is a chunk of static text."
>   greeting = "hello world" # statement, no PTL output
>   print 'Input values:', x, y
>   z = x + y
>   """You can plug in variables like x (%s)
>in a variety of ways.""" % x
>
>Calling this template with foo(1,2) results in the following output:
>
> This is a chunk of static text.You can plug in variables like x (1)\n
> in a variety of ways.
>
>Normally when Python evaluates expressions inside functions, it just
>discards their values, but in PTL the value is converted to a string
>using str() and appended to the output for the template.  There's a
>single exception to this rule: None is the only value that's ever
>ignored, adding nothing to the output.  (If this wasn't the case,
>calling methods or functions that return None would require assigning
>their value to a variable.  You'd have to write 'dummy = list.sort()'
>in PTL code, which would be strange and confusing.)
>
>The initial string in a template isn't treated as a docstring, but is
>just incorporated in the generated output; therefore, templates can't
>have docstrings.  No whitespace is ever automatically added to the
>output, resulting in "...text.You can ..." from the example.  You'd
>have to add an extra space to one of the string literals to correct
>this.
>
>The assignment to the 'greeting' local variable is a statement, not an
>expression, so it doesn't return a value and produces no output.  The
>output from the 'print' statement will be printed as usual, but won't
>go into the string generated by the template.  Quixote directs
>standard output into Quixote's debugging log; if you're using PTL on
>its own, you should consider doing something similar.  'print' should
>never be used to generate output returned to the browser, only for
>adding debugging traces to a template.
>
>Inside templates, you can use all of Python's control-flow statements:
>
>template numbers(n):
> for i in range(n):
> i
> " " # PTL does not add any whitespace
>
>numbers(5) will return "1 2 3 4 5 ".  You can also have conditional
>logic or exception blocks:
>
>template international_hello(language):
> if language == "english":
> "hello"
> elif language == "french":
> "bonjour"
> else:
> raise ValueError, "I don't speak %s" % language
>
>PTL templates are kept in files with the extension .ptl.  Like Python
>files, they are byte-compiled on import, and the byte-code is written
>to a compiled file with the extension '.ptlc'.  To import PTL files,
>an import hook needs to be installed first.
>
>from quixote import imphoo

[Webware-devel] more on TS #parse

2001-06-07 Thread Chuck Esterbrook

Also, can we change:
#parse file="foo.text"

to:
#parse "foo.text"

The "file=" gets redundant by the second time you use #parse.


-Chuck


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



Re: [Webware-devel] Re: more on TS #parse

2001-06-07 Thread Chuck Esterbrook

At 10:47 AM 6/7/2001 -0700, Tavis Rudd wrote:
>Agreed. So it would be
>
>#include $var
>or
>#include "file.txt"
>
>or
>
>#include verbatim $var
>or
>#include verbatim "file.txt"

Looks great. Also need a setting, API or hook to provide a custom list of 
paths that the file can exist in.

-Chuck


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



Re: [Webware-devel] TS change request

2001-06-07 Thread Chuck Esterbrook

At 10:52 AM 6/7/2001 -0700, Tavis Rudd wrote:
>I think people would learn it's meaning fairly fast as it's
>also used in the #verbatim directive  There's good
>symmetry in that.  Can you think of any easier words
>that mean the same thing?

I can live with verbatim and find it preferable to the alternatives you 
listed. I understood what it meant the first time and later I saw the 
#verbatim in the docs and thought that was a nice tie in.

My vote remains:
 #include [verbatim] "file.text"|$file

As in:
 #include "footer.text"
 #include verbatim $userProfile


-Chuck


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



Re: [Webware-devel] TS change request

2001-06-07 Thread Chuck Esterbrook

At 12:54 PM 6/7/2001 -0500, Ian Bicking wrote:
>unparsed

Don't forget unlexed, uncompiled and unbound.


>plain text
>text/plain (from MIME)

If you're template and include are both something like XML or HTML, then 
the text/plain could be somewhat confusing. A user might be tempted to say 
"text/xml".


>raw
>raw text
>
>I think raw text makes the most sense to me.  Plain text also seems
>like a good description.

I could go for "#raw" and "#include raw" in place of "verbatim". The "text" 
is unnecessary.

Examples:

#raw
 foo bar baz
#end raw

#include raw $userHTProfile
#include "footer.htmlf"


-Chuck


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



Re: [Webware-devel] Re: more on TS #parse

2001-06-07 Thread Chuck Esterbrook

At 11:19 AM 6/7/2001 -0700, Tavis Rudd wrote:
>TemplateServer uses its .getFileContents(fileName) method to locate the 
>file to be included.  This method can be overriden in subclasses if you 
>want to modify or extend its behaviour.  It is possible to implement the 
>logic for getting remote files such as \code{http://myserver.com/file.txt}.

Thanks. I see this was already in 0.8.x, I just didn't know where.

The rest looks good.


-Chuck


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



Re: [Webware-devel] TS change request

2001-06-07 Thread Chuck Esterbrook

At 11:38 AM 6/7/2001 -0700, Tavis Rudd wrote:
>one other minor point:
>should we require the quotation marks on files?
>
> > #include raw $userHTProfile
> > #include "footer.html"
>  becomes
> > #include raw $userHTProfile
> > #include footer.html

I could easily live without them. That means "raw" can never be included, 
but who cares? It's uncommon as a filename especially considering most 
names have an extension.

Or you could allow "#include raw" by itself to mean include the file named 
"raw". Up to you.

But, yes, we can do without quotes. After all, $foo doesn't even expand 
with quotes unless $foo really contains them.


-Chuck


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



[Webware-devel] TS question

2001-06-08 Thread Chuck Esterbrook

My designers want to generate some links like:
a | b | c

Note the vertical bars between the elements. My first cut is something like:
#for $foo in $bars
$bar |
#end for

But this gives:
a | b | c |

DTML solves this by offering a higher-level for (called ). The 
loop has access to the value, index, etc. If TS has this, it would be 
something like:
#for $foo in $bars
$foo.value
#if not $foo.isLast
|
#end if
#end for

My questions:
   - Can I accomplish "a | b | c" in TS now? If so, how?
   - Should we expand TS's #for with the power of ? (I think so.)

The docs for  are at:
   http://www.zope.org/Members/michel/ZB/AppendixA.dtml
Unfortunately, there are no anchors for the sections. Search for "in:" on 
the page (sans quotes) and you will hit it the first time.


-Chuck


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



Re: [Webware-devel] TS question

2001-06-08 Thread Chuck Esterbrook

At 09:55 AM 6/8/2001 -0700, Mike Orr wrote:
>Perhaps better would be to port dtml-in's batching capability.  This would
>probably be a large project, however.  #for would need keywords for the batch
>size and where to start.  Then $foo.sequenceNumber() would be the relative
>index from the start of the page (1-based), etc.  We'd also need to support
>"previous" and "next" pseudo-batches for people's navigation
>links (or maybe not: $foo.previousSequenceStartNumber() etc. may overlap
>it).
>
>Supporting something comparable to dtml-in would be a major feature.
>Someday I've been meaning to look at dtml-in's source and see if it's
>self-contained enough to leverage.

Perhaps it would make sense to separate #for from #batch, which still 
providing additional power to #for.

-Chuck


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



Re: [Webware-devel] PSP include directives

2001-06-08 Thread Chuck Esterbrook

At 01:52 PM 6/8/2001 -0400, Geoff Talvola wrote:
>I just noticed that the documentation for PSP specifies the following syntax:
>
>If you want to include another PSP file in this PSP file and have it be 
>parsed for PSP content:
><%@include file="myfile.txt"%>
>
>If you want to forward the request to another servlet, including the 
>result in the output:
>

It looks strange that <[EMAIL PROTECTED] and If you want to insert a file verbatim into the output:
>
>
>But, it turns out that you actually have to use path="myfile.psp">.  The other two ones do work as advertised with "file=".
>
>Any objections to making all three of them use file=, to be consistent 
>with each other and with the documentation?

No objection from me, but I'm really bothered by what I noticed above.


-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 02:01 PM 6/8/2001 -0400, Geoff Talvola wrote:
>OK, I misunderstood.  I thought the compile step would be something you'd 
>have to run repeatedly.  I guess I really shouldn't comment on 
>TemplateServer without at least reading the docs :-)

Yeah, but now it appears according to Tavis' earlier e-mail that you're 
really not supposed to work with the .py. Makes sense to me since templates 
are supposed to be "I'm a designer, not a programmer"-friendly.

I think the issue remains.


-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 08:16 PM 6/8/2001 +0200, Tom Schwaller wrote:
>B.T.W. take a look at www.python.de, there is some
>surprise about Webware, but it's not finished yet.
>I need a stable AsyncThreadedHTTPServer,
>because I have no Apache on the uCSimm.
>Unfortunately it does not seem to run stable.
>I have to use a different thread Library for Python
>(there are no pthreads on Linux/m68k), but we have
>Python running with floating point emulation on
>that hardware. Take a look at the page, you
>will understand what I'm talking about (Kind of Pippy
>for Linux/m68k). It's really cool stuff, but
>not 100% finished..

We don't recommend Async* anymore because of various problems with it. It 
is considered experimental.

If you look at the "AppServer" script in CVS, you will see that the new 
default app server is ThreadedAppServer.

Whether or not that makes any difference in your app, I don't know. But I 
wanted to point this out.


-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 02:17 PM 6/8/2001 -0400, Geoff Talvola wrote:
>- PSP could do the same thing as TemplateServer -- just write out the .py 
>file into the same directory as the PSP, with the same filename and class 
>name.  That requires write access.

That would be fairly Pythonic in the same way that .pyc's are handled. 
Especially if there were no complaints when write access wasn't available.


>- there was some compelling reason why PSP chose to use a different 
>directory and different naming convention, and TemplateServer will run 
>into the same issues :-)  Maybe it's the write access issue, or maybe it 
>was just done to hide the details of the implementation from the end user 
>and avoid cluttering up the directory.  Or, maybe it's because if you 
>automatically compile the .tmpl file into a .py file of the same name, 
>then it's ambiguous which one you want to serve?

The .psp vs. .py ambiguity seems to be the biggest item. WebKit currently 
will refuse to serve a file with more than one extension available. I would 
consider retooling that policy if it helps out PSP and TS and whatever 
other processes want to do Python compilation.

-Chuck


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



[Webware-devel] TS Names

2001-06-08 Thread Chuck Esterbrook

I also like:

Pylocity

Pyplates

I'm guessing Tavis does not since he has refrained from passing on these 
suggestions which I made to him earlier.  :-)

Although I'm growing to like "Cheetah" all by itself.


-Chuck


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



Re: [Webware-devel] quick vote on CheetahTemplate name proposal

2001-06-08 Thread Chuck Esterbrook

At 11:25 AM 6/8/2001 -0700, Tavis Rudd wrote:
>Hi,
>could everyone that's around please humour me
>with a quick vote on the 'CheetahTemplate'
>name proposal:
>
>-1 for 'I hate it'
>0 for "I'm not bothered"
>1 for 'Yes please'


0 for CheetahTemplates (notice the 's')
+0.8 for Cheetah


After all, Velocity didn't need the "Templates" suffix.

-Chuck


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



Re: [Webware-devel] Notes on TAL

2001-06-08 Thread Chuck Esterbrook

At 01:26 PM 6/8/2001 -0500, Ian Bicking wrote:
>Anyway, I thought I'd note that it works with HTML (not just XHTML)
>now.  This means it also contains a parser for HTML.  It looks better
>informed than any parser we have at this point.  Even if we just
>snagged the general algorithm, and not the code, it would be a step
>up.

What would make it better than HTMLTag?


-Chuck


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



Re: [Webware-devel] Notes on TAL

2001-06-08 Thread Chuck Esterbrook

At 01:48 PM 6/8/2001 -0500, Ian Bicking wrote:
>It's intelligent about paragraph-level, block-level,
>bigger-than-paragraph-level, and maybe some other stuff too.
>
>I.e., it knows that  ends , for instance.

I suspected that would be it. I was curious if there was anything else.

HTMLTag isn't that far away from being able to do that. I outlined the 
approach in the source for this.


-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 08:59 PM 6/8/2001 +0200, Tom Schwaller wrote:
>yes I know, but having the smallest Web Appliction on earth
>would be quite something...
>
> > If you look at the "AppServer" script in CVS, you will see that the new
> > default app server is ThreadedAppServer.
> >
> > Whether or not that makes any difference in your app, I don't know. But I
> > wanted to point this out.
>
>I do not have a choice in that case, because I need a Python only
>solution..

I'm not understanding this at all. If Async works on this chip, why 
wouldn't Threaded? They both use threads.

Maybe you mentioned something about mods and I missed it...

-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 12:06 PM 6/8/2001 -0700, Mike Orr wrote:
>One issue would be getting the content manager's editor to
>syntax-highlight the template in HTML style.  (nedit does this, BTW,
>even while highlighting the Python parts as Python.)  A bigger issue
>would be content managers who want to use visual editors; that's
>probably impossible with this approach.

Yeah, overall, I just don't see this manual kludging as a good idea. Even 
if it results in faster code.

Out of the box users should be able to make a .plate file and have it work 
with no messin' around. If they later want to embrace some methodology to 
get more speed, then so be it.

-Chuck


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



Re: [Webware-devel] PlateKit

2001-06-08 Thread Chuck Esterbrook

At 03:35 PM 6/8/2001 -0400, Geoff Talvola wrote:
>I think he's looking for a pure-python standalone HTTP server like 
>AsyncThreadedHTTPServer.

Oh, got it.

So that would be facilitated by our decision to have AppServer handle 
multiple ports and protocols.

-Chuck


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



Re: [Webware-devel] TS transition to "Cheetah"

2001-06-08 Thread Chuck Esterbrook

At 05:57 PM 6/8/2001 -0700, Tavis Rudd wrote:
>I propose that we provide an updated copy of Chuck's
>Template overview page as a start for the homepage and move
>it to a sublink once something more substantial has been
>built.  Thoughts?

I think you'd be better off with a pro-Cheetah page and then a side link to 
the templates page.

-Chuck


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



Re: [Webware-devel] PSP include directives

2001-06-09 Thread Chuck Esterbrook

At 08:37 AM 6/9/2001 -0400, Jay Love wrote:

>No, it should be "path" for psp:include.  I just haven't updated the 
>documentation.  @include includes the source of a file, psp:include 
>actually does a application.includeURL call.

Perhaps it should be "url"?

-Chuck


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



[Webware-devel] Cheetah change request: caching

2001-06-09 Thread Chuck Esterbrook

"The value of each reference will be calculated once at start-up and a 
cached version will be used thereafter." -- that's just sooo no-intuitive. 
And why would I even keep the template object around then? The string would 
do just fine.

Consider:

 >>> from Cheetah.Template import Template as T
 >>> values = {'name': 'chck'}
 >>> src = 'Hello $name.'
 >>> t = T(src, values)
 >>> print t
Hello chck.
 >>> values['name'] = 'Chuck'
 >>> print t
Hello chck.


I currently work around this by throwing the Template away every time. But 
then I don't get any benefit from the compilation. Maybe I'm even getting 
some overhead.

I hope you're not gonna give the me '*' explanation as in $*var. No other 
templating system, not Velocity, WebMacro, DTML, etc., makes template 
writers add an extra symbol in order to emphatically declare that "yes, 
this variable will vary".

Consider a simple news template:

--
$title
 $date
 $body

$author
--

I can't create a Template out of this and reuse it for N records in the 
database. I have to throw it away each time and lose the benefits of 
compilation. Or I could tell my users that Cheetah, for practical purposes, 
is really a $*# syntax:

--
$*title
 $*date
 $*body

$*author
--

Which is opposite of shell syntax, Velocity, "reduced symbology", etc.

I think the default behavior should be that variable values are fetched 
upon rendering.


-Chuck


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



[Webware-devel] Re: Cheetah change request: caching

2001-06-09 Thread Chuck Esterbrook

At 09:03 AM 6/9/2001 -0700, Tavis Rudd wrote:
>Chuck,
>I see where you're coming from on this.  I was just getting
>sick of putting * in for all the vars that I wanted to
>cache, which was almost every single one.
>Here's a proposal that should remove my frustration, while
>using dynamic vars as the $placeholder default:
>
>==
>  $var1
>  $*var2  ## statically cached
>  $*15*var3## timed refresh
>#cache
>  $var4   ## statically cached
>  $var5
>#cache
>==
>Thoughts?
>
>Tavis

Looks good to me. I assume you meant "#end cache" instead of "#cache" the 
second time around. Also, "#cache" could take an optional number as in 
"#cache 15".

In addition to the above, you could also provide a setting (if there isn't 
already) for Template, although that could lead to ?incompatible? templates 
between systems.


-Chuck


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



[Webware-devel] Cheetah: #include binding

2001-06-09 Thread Chuck Esterbrook

Similar to $vars, I think #include should take effect during rendering, not 
during construction. Otherwise, we're back to the same situation. For 
example, a Template must be discarded every time if there is any chance the 
#include files could change.

Or does Cheetah check the timestamp of #includes and recompile when this 
occurs?

-Chuck


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



[Webware-devel] Re: [Cheetahtemplate-discuss] getFileContents()

2001-06-09 Thread Chuck Esterbrook

At 10:24 AM 6/9/2001 -0700, Tavis Rudd wrote:
>I'm just about to upload the HTML docs as the homepage for
>now.
>
>BTW, shouldn't this be on the devel list?
>What was your opinion about how to manage the crossover
>between Cheetah and the webware 'templates' meta-thread?

Well the biggest thing is that a missing #include should behave like a 
missing $var. That's a -discuss item. The other stuff was -devel-style.

However, I don't know that it's useful for both a -devel and -discuss list 
for Cheetah. We didn't have both lists in the early days of Webware because 
the community wasn't large enough. Then over time as things grew -devel 
naturally occurred.

Regarding the template discussions, so far, I have sent to both 
webware-devel and cheetah-discuss when it comes to design issues. When it 
comes to minor Cheetah items such as HTML docs, I don't bug Webware with it.

I'm thinking that there should be a python-templating-modules list at 
eGroups, just like there is a python-web-modules list. However, I suggested 
a separate templating mailing list earlier, but the interest was low.

-Chuck


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



Re: [Webware-devel] def Klass: instead of class Klass(Klass)?

2001-06-11 Thread Chuck Esterbrook

At 10:11 AM 6/11/2001 -0400, Jeff Johnson wrote:
>Hi everyone,
>
>I'm trying to figure out the best way to pool database connections so
>I was looking into how MiddleKit does it.  I noticed this piece of
>code in MSSQLObjectStore.py and didn't know python could do this:
>
>def Klass:
> def sqlTableName(self):
> '''
> Returns "[name]" so that table names do not conflict with SQL
> reserved words.
> '''
> return '[%s]' % self.sqlTableName()

It should be "class Klass:". This code has never been tested. The MSSQL 
(Dave Rogers) often splits off from the CVS repository and it takes weeks 
or months to reel him back in. I added this change, but don't have MSSQL to 
test with.

The fix is checked in now.


>I've never seen a class over-ridden with a def statement.  Is that

Neither have I.  :-)


>what this is doing?  Any idea where in the python manuals I could read
>about this?

BTW that class is picked up by MK as a mix-in. Its methods are injected 
into the real Klass located in MiddleKit.Core. This mix-in technique makes 
it convenient for the specific object stores to customize MK without having 
to subclass.


>BTW: Does anyone have a PostgreSQL SQLObjectStore module?  Any advice
>on DB pooling would also be appreciated :)

No, this comes up quite a bit, but no one has tackled it.

We also haven't tackled the DB pooling issue (in MK) yet. I'm thinking 
there could be some relation between MK and Webware.MiscUtils.DBPool but I 
haven't followed it through.


-Chuck


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



Re: [Webware-devel] DBPool

2001-06-11 Thread Chuck Esterbrook

At 01:18 PM 6/11/2001 -0400, Jeff Johnson wrote:
>If this is right, should some of it be added to the docstring for
>DBPool?  Currently it tells how to create the dbPool but not how to
>make it persist beyond a single servlet call.

We're at the intersection of a MiscUtils class and how to use it properly 
in WebKit. I suppose it does belong in the doc string of the MiscUtils 
class under "WebKit integration".

By the way, there isn't a lot of need for valueForKey() if you are passing 
a string literal. Unless you want to be able to switch the dbPool attribute 
between foo, _foo and foo() without changing SitePage.


-Chuck


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



Re: [Webware-devel] Running in other than the WebKit directory.

2001-06-11 Thread Chuck Esterbrook

At 09:24 PM 6/9/2001 -0700, Robin Dunn wrote:
>Unfortunately I realized too late that I still had my editor set to trim 
>end of line whitespace so doing a patch will have lots of diffs that are 
>only the spaces removed from the end of lines...

Actually, my editor does the same thing, so I end up with additional diffs 
as well (which I check in). I would actually appreciate if all Webware 
developers trimmed EOL and EOF whitespace. Maybe I'll put that in the Style 
Guidelines.

BTW I've been somewhat out-of-action the past few days. I'll take a look at 
the changes tomorrow and we'll go from there. I think I saw that Geoff 
already pointed out that any sizable changes other than minor bugfixes 
should be in the main branch.


-Chuck


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



RE: [Webware-devel] DBPool

2001-06-12 Thread Chuck Esterbrook

At 10:20 AM 6/12/2001 -0400, Jeff Johnson wrote:
>I can't even remember how I found valueForKey() in the first place.  I
>wanted to just refer to dbPool with self.application().dbPool but it
>doesn't work so I used valueForKey().  What's the correct way to do
>this?
>
>Hey, I just realized that Geoff's solution keeps the dbPool as a
>global instead of sticking it in the application, I keep forgetting I
>can do that :)  I've got some other persistant stuff that I was
>sticking into Application that I can move to module scope.  I'd still
>like to know the proper way to reference Application attributes though
>:)

self.application().foo  should work fine for a 'foo' that you create. This 
is ordinary Python after all.

Perhaps there was another problem where the attribute hadn't been set yet?

-Chuck


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



Re: [Webware-devel] cvs update

2001-06-12 Thread Chuck Esterbrook

At 11:55 AM 6/12/2001 -0400, Geoff Talvola wrote:
>I improved the automatic emailing on exceptions in WebKit.  It now 
>includes the appropriate headers to make my email program happy.

Just out of curiosity, what were those? And type of e-mail server?


-Chuck


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



[Webware-devel] Interesting start up message

2001-06-19 Thread Chuck Esterbrook

I reinstalled Python (2.1) but didn't get to the win32 extensions yet. Upon 
launching WebKit, I get:

Listening on ('127.0.0.1', 8086)
Creating 10 threads..
win32 extensions not present.  Webkit Will not be able to detatch from the 
controlling terminal.
Ready


Is this something I should worry about? I don't recall WebKit detaching 
from the controlling terminal in the first place.


-Chuck


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



[Webware-devel] mod_webkit build problems

2001-06-24 Thread Chuck Esterbrook

I'm trying to build mod_webkit from CVS on a FreeBSD 4.3 freshly installed 
box with Apache 1.3.20:

sa1# make APXS=/usr/local/apache/bin/apxs
/usr/local/apache/bin/apxs -o mod_webkit.so -cmod_webkit.c marshal.c
gcc -funsigned-char -DUSE_EXPAT -I../lib/expat-lite 
-DNO_DL_NEEDED  -I/usr/local/apache/include  -c mod_webkit.c
gcc -funsigned-char -DUSE_EXPAT -I../lib/expat-lite 
-DNO_DL_NEEDED  -I/usr/local/apache/include  -c marshal.c
   -o mod_webkit.so marshal.o mod_webkit.o
apxs:Break: Command failed with rc=255
*** Error code 1

Stop in /usr/home/webware/anoncvs/WebKit/Native/mod_webkit.


Prior to this, when building Apache, I disabled mod_asis, imap, actions and 
enabled mod_rewrite and so.

Any ideas what that last error message is all about?

-Chuck


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



Re: [Webware-devel] mod_webkit build problems

2001-06-24 Thread Chuck Esterbrook

At 10:04 AM 6/24/2001 -0400, Chuck Esterbrook wrote:
>   -o mod_webkit.so marshal.o mod_webkit.o
>apxs:Break: Command failed with rc=255


I tried on a Linux box that I knew to work. The diff is that the working 
box had a "gcc -shared" preceding the "-o mod_webkit..." line above. So I 
did this by hand and did a make install.

Whether this is a flaw in Apache 1.3.20, or FreeBSD 4.3, or mod_webkit's 
Makefile, or something else...I don't know.

-Chuck


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



Re: [Webware-devel] config files update

2001-06-26 Thread Chuck Esterbrook

At 12:01 PM 6/26/2001 -0700, Robin Dunn wrote:
>I've made the changes discussed last week (see below) for allowing
>%(WebwarePath)s type values in the config files, and for changing
>MakeAppWorkDir.py to copy and tweak the original files from WebKit into the
>new working directory.  Does anybody want to review the patch file before I
>check it in to CVS?

I'll peek at it...


-Chuck


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



Re: [Webware-devel] Muliple Service AppServer

2001-07-22 Thread Chuck Esterbrook

At 05:12 PM 7/22/2001 -0400, Jay Love wrote:
>Anyway, let me know if you can take a look at this.  It will probably be
>easiest to just send out a complete tarball.

How about just uploading that to the anon ftp area of Webware (sans .pyc & 
CVS/ files)? I always forget how to do that, but then SF docs describe how.

-Chuck


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



Re: [Webware-devel] Muliple Service AppServer

2001-07-22 Thread Chuck Esterbrook

At 06:28 PM 7/22/2001 -0400, Chuck Esterbrook wrote:
>How about just uploading that to the anon ftp area of Webware (sans .pyc & 
>CVS/ files)? I always forget how to do that, but then SF docs describe how.

Throwing in a "cvs diff > diff.text" from the top level of your workspace 
would be interesting as well.

-Chuck


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



Re: [Webware-devel] Muliple Service AppServer

2001-07-22 Thread Chuck Esterbrook

That sucks. I made use of that.

Well Jay, if you can find another place, please do so. If you can't, then 
give me the file and I'll find a place.

Thanks,
-Chuck


At 07:29 PM 7/22/2001 -0400, Jay Love wrote:
>I think they did.
>
>
>On 22 Jul 2001 17:37:12 -0500, Ian Bicking wrote:
> > Chuck Esterbrook <[EMAIL PROTECTED]> wrote:
> > > At 05:12 PM 7/22/2001 -0400, Jay Love wrote:
> > > >Anyway, let me know if you can take a look at this.  It will probably be
> > > >easiest to just send out a complete tarball.
> > >
> > > How about just uploading that to the anon ftp area of Webware (sans 
> .pyc &
> > > CVS/ files)? I always forget how to do that, but then SF docs 
> describe how.
> >
> > Didn't SourceForge eliminate anon ftp?
> >
> >   Ian
> >
> > ___
> > Webware-devel mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/webware-devel
>
>
>
>___
>Webware-devel mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/webware-devel


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



Re: [Webware-devel] cvs update: 0.5.1 branch

2001-08-05 Thread Chuck Esterbrook

At 12:44 AM 7/28/2001 -0400, Jay Love wrote:
>I just checked in a fix on the 051 branch of AsyncThreadedAppServer for
>a bug Jack Moffitt stumbled on.  The method signature of a function in
>asyncore changed between python 1.5 and Py 2. The handle_error function
>that asyncore calls to handle errors it encounters took 4 arguments in
>py 1.5, but takes only 1 in py2.  The fix handles both cases.
>
>Jay

Can you update the release notes as well? I didn't see them come up when I 
did a "cvs up" and I'd like the bug fix releases to state what they fixed.

-Chuck


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



Re: [Webware-devel] cvs update

2001-08-05 Thread Chuck Esterbrook

At 11:01 AM 8/4/2001 -0400, Geoff Talvola wrote:
>>BTW, I need a go/no go on the Services architecture.  If you haven't
>>looked at it, please do.  If you're waiting on more commentary, let me
>>know.
>
>I was hoping Chuck would comment on the design.  I also wanted to see a 
>little bit better documentation so I could make sense of all the new 
>options in the Application.config.  It really wasn't obvious to me how it 
>worked just from looking at it.

Sorry. In addition to my ordinary work load, I'm moving clear across the 
country and there's quite a bit of work to do so. My efforts will be spotty 
until about mid-September, but I will definitely look at Jay's server mods.

-Chuck


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



[Webware-devel] Python 10

2001-08-06 Thread Chuck Esterbrook

Last year I presented "Introduction to Webware" at the Python 9 conference.

Is anyone planning on presenting a paper or giving a tutorial at Python 10?

-Chuck


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



Re: [Webware-devel] Re: Session invalidate

2001-08-12 Thread Chuck Esterbrook

At 08:04 PM 8/12/2001 -0400, Jay Love wrote:
>Done.
>
>I also added dictionary style access to Session.  Also, 
>Application.isSessionIdProblematic wasn't checking the session objects 
>timeout and was using the default configuration setting.  I fixed that.
>
>Jay

Is there any reason to do this:

 def __getitem__(self, name):
 return self.value(name)

 def __setitem__(self, name, value):
 self.setValue(name, value)

 def __delitem__(self, name):
 self.delValue(self, name)


rather than this:

 __getitem__ = value
 __setitem__ = setValue
 __delitem__ = delValue


The second is faster and smaller.


-Chuck


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



Re: [Webware-devel] Re: [Webware-discuss] File Upload (w/ Binary Files)

2001-08-12 Thread Chuck Esterbrook

At 03:06 PM 8/11/2001 -0400, Jay Love wrote:
>Chuck hasn't had in comments on that yet, though.  He may still want to
>go to 1.0.

I'm cool with a 0.6. This a really bad time for me for personal reasons I 
explained earlier. If Jay or Geoff wish to lead a 0.6 release, that is fine 
with me. If you want me to lead it, I wouldn't initiate it until about mid-Sep.

Off the top of my head, for 0.6, I will do:
 - apply admin password patch for install.py
 - MK: Postgres support patch
 - MiscUtils.DataTable: Better CSV support
 - (hopeful) pydoc-generated doc string docs to complement the 
summaries and HTML highlighted source we already have, plus cross linking 
between these



-Chuck


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



Re: [Webware-devel] Request _pathContext As a generalization of Path Session

2001-08-12 Thread Chuck Esterbrook

At 11:32 PM 8/11/2001 -0400, Clark C . Evans wrote:
>  Sorry about that... but after monkeying around
>  with my editor and stuff... I just plain give up.
>  Why are you all using TABs anyway!  *shudders*

Because TABs rule.  ;-)

I shudder whenever I have to cursor through hordes of spaces as well as 
give up extra RAM and hard drive space.

Most people solve this problem by using a nice editor. I recommend 
UltraEdit, BBEdit or emacs depending on your platform.

And while most of us have TAB=4, it matters not. We use 1 TAB for 1 level 
of indentation. Sometimes I'm in pico where TAB=8 and while it looks spaced 
out, there are no problems loading, saving or running the code.


-Chuck


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



Re: [Webware-devel] Request _pathContext As a generalization of Path Session

2001-08-12 Thread Chuck Esterbrook

At 11:32 PM 8/11/2001 -0400, Clark C . Evans wrote:
>Please find attached a patch for HTTPRequest.py
>and Applicaiton.py which generalizes Heiko Hees's
>wonderful "Path Based Session" to allow for
>session-like variables to be included in the
>path *before* the servlet context.

[huge snip]

1. Prior to seeing your examples, I expected the extra values to come after 
the context as I see that as being the "entry point" of a site. Now that 
you've done it the other way around, the question arises, should they go 
before, after or both?

2. Also, if I did a multi-lingual site, I wouldn't want ".../lang=en/...", 
but instead just ".../en/...". e.g., args by position rather than name.

3. Finally, before we apply URL dissecting patches left and right, have you 
reviewed Terrel Schumway's URLDecoder? I never had time to fully digest it, 
but from what I followed he seemed to be reaching for something very 
general. Would this take care of you, or at least provide an easy hook to 
_add_ URL processing to your application, without having to modify the 
WebKit sources?
http://www.ics.uci.edu/~tshumway/webware/urldecode.html


-Chuck


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



Re: [Webware-devel] Request _pathContext As a generalization of Path Session

2001-08-12 Thread Chuck Esterbrook

At 06:19 PM 8/12/2001 -0700, Mike Orr wrote:
>On Sun, Aug 12, 2001 at 08:35:43PM -0400, Chuck Esterbrook wrote:
> > of indentation. Sometimes I'm in pico where TAB=8 and while it looks
> > spaced out, there are no problems loading, saving or running the code.
>   ^^ ^^^
>
>Pun intended?

No, that one was subconscious.

:-)


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



[Webware-devel] RE: [Webware-discuss] ThreadedAppServer hangs

2001-08-20 Thread Chuck Esterbrook

At 10:42 AM 8/20/2001 -0400, Jeff Johnson wrote:
> > - What's the load on the machine right before you stop it? 'w' at
>the
> > command line will tell you.
>Load is almost non-existant.  There's only 3 people that occasionally
>hit the box.  I'll check 'w' though and let you know.

OK.


> > - If you wait 30 secs instead of 10, does your failure rate change
>in
> > either direction?
>I'll keep an eye on it but I would guess that at 30 seconds it might
>never fail.

That would be very interesting to know.


> > - If you cache database connections, can you explicitly close
> > them first?
> > Perhaps via a little admin servlet that you would run just
> > before stopping:
>
>Hmm, good idea.  I use DBPool with another few layers on top of that.
>Is there a way to detect the "stopping" signal so I can close
>connections?

Not that I know of off the top of my head. Perhaps we should have a 
contextShutdown() to complement contextInitialize().

In the mean time, you could have a non-advertised servlet that does this 
which you could invoke via a browser:
 lynx http://localhost/myapp/shutdown


-Chuck


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



[Webware-devel] Re: [Webware-discuss] Pickle problem help

2001-08-29 Thread Chuck Esterbrook

At 12:02 PM 8/29/2001 +0200, Fionn Behrens wrote:
>Would you accept a patch if I fixed it that way?

I believe I would. Although I hope Jay or Geoff look at this if you submit 
the patch in the next week or two. I'm in the middle of moving and haven't 
even kept up with the lists recently.

-Chuck


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



Re: [Webware-devel] webware dev activity?

2001-09-24 Thread Chuck Esterbrook

At 05:49 PM 9/22/2001 +0300, Victor Sovetov wrote:
>Hello, All!
>
>Is WebWare still under active development?
>
>SY,
>
>--Victor Sovetov

Yes. Although there has been a lull in activity this summer due to 
developers vacationing, moving, etc.

BTW it's "Webware".   :)

-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] webware dev activity?

2001-09-24 Thread Chuck Esterbrook

At 09:45 AM 9/24/2001 +, [EMAIL PROTECTED] wrote:
>One thing which should be fixed is the link to the 0.5.1rc3 release package -
>last week, someone pointed out that it didn't work, and I managed to confirm
>this. Fortunately, someone had mirrored the package, which I really 
>discovered
>by chance, in fact.

I just tried at:
http://webware.sourceforge.net/

and it worked for me. It was really, really slow, but it worked. Can you 
try again and let me know the results?

Also, I'll add a mirror link to the home page.


>Is there some kind of release plan for 0.5.1 or 0.6, or whatever? ;-)

Um, there will be a 0.6 release, but I can't say that a plan is in place. 
There are extensive notes on the release procedures in the docs and I would 
be open to a volunteer cutting the first candidate release of 0.6.

See http://webware.sourceforge.net/Webware/Docs/ReleaseProcedures.html


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



RE: [Webware-devel] Bad cookies hang Webkit

2001-10-01 Thread Chuck Esterbrook

At 11:44 AM 10/1/2001 -0400, Geoff Talvola wrote:
>So, I'm thinking we should put this fixed version of Cookie.py directly 
>into Webware and force it to use its own fixed private copy for any Python 
>version prior to 2.2.  Does anyone disagree?
>
>I suppose before we do that, we should make sure that the fixed version is 
>still compatible with Python 1.5.2, 2.0, and 2.1.

I agree.


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] WARNING: Cannot get servlet.name for activity log.

2001-10-02 Thread Chuck Esterbrook

At 11:06 AM 10/2/2001 -0400, Jeff Johnson wrote:
>I turned on logging without modifying the defaults, I get this warning
>now.
>
>WARNING: Cannot get servlet.name for activity log.
>
>Is servlet.name supposed to be defined automatically?


I see a Servlet.name() in my WebKit/Servlet.py. Do you have it as well?

If so, then their might be a bug in either NamedValueAccess or WebKit's 
logging code.

-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



RE: [Webware-devel] WARNING: Cannot get servlet.name for activity log.

2001-10-02 Thread Chuck Esterbrook

At 11:22 AM 10/2/2001 -0400, Jeff Johnson wrote:
> > I see a Servlet.name() in my WebKit/Servlet.py. Do you have
> > it as well?
>
>Yep, I see it.
>
> > If so, then their might be a bug in either NamedValueAccess
> > or WebKit's logging code.
> > -Chuck
>
>Sounds like.  Is anyone logging activity without this warning?

I just turned my logging on and it works fine. The servlet.name column is 
correct and no warnings are printed.

I'm using Webware CVS, Apache 1.3.x, WinME.

What version of Webware are you using? If CVS, make sure you do a "cvs up 
-dP" in Webware/, not WebKit/, as NamedValueAccess resides outside of WebKit.


>I'll take a closer look at this after I track down a real bad problem
>I've got on FreeBSD, maybe someone has an idea:  When we close the
>terminal that started webkit either in background or as a daemon, if the
>servlet prints a lot of text to the stdout, the servlet hangs.  If I
>remove the print statements, it works fine.  I'm writing a test script
>now...  This might be related to the other strange FreeBSD problem where
>I have to print to stdout before the threads will shutdown sockets
>cleanly.
>
>I'm hoping this is a Webware problem so we can fix it but I suspect
>there is something wrong in FreeBSD/Python which may be much much harder
>to find and fix :(

I suspect you are correct. However, do you need a lot stdout output? I use 
this for debugging and of course, if you close the terminal you won't see 
this text anyway. Also, do you need to close the terminal? Why not leave it up?


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



RE: [Webware-devel] Terminals and Output

2001-10-03 Thread Chuck Esterbrook

At 02:47 PM 10/3/2001 -0400, Jeff Johnson wrote:
> > Maybe try running python with "python -u", which should turn off
> > buffering.
>
>Good idea.  I modified AppServer to read:
>#!/bin/sh
>/usr/bin/env python -u Launch.py ThreadedAppServer $*
>
>But it didn't fix the problem.  Maybe Launch.py is starting a new python
>interpreter that also needs the -u switch?  I can't tell.

Launch.py does not spawn a new process and it does a Python exec, but I'm 
pretty sure that would maintain the same flags.

Did you try a simple Python program yet, like you mentioned earlier?


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



RE: [Webware-devel] Terminals and Output

2001-10-03 Thread Chuck Esterbrook

At 03:25 PM 10/3/2001 -0400, Jeff Johnson wrote:
>Just did, it reproduces the problem well.  I tried running with "nohup
>python -u term.py" and it still fails.  Below is the code for term.py
>and below that is part of x.txt.  Now what?

Webware is now eliminated. Can we eliminate Python? eg., what about bash or 
perl?

If it is Python, the c.l.p. should help. If not, then it's a UNIX issue and 
we'll have to pursue those avenues.

Whatever the cause, other WebKit users will run into this, so I'll be happy 
to add the problem and solution to the docs once we nail this down.


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] MOD_Webkit

2001-10-03 Thread Chuck Esterbrook

At 04:59 PM 10/3/2001 -0700, Russell Blank wrote:
>Does anyone have a binary for Apache for Windows?

I'll upload the copy Jay gave me to the Webware site and announce it on 
webware-discuss (tonight).

-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] MiddleKit thoughts

2001-10-17 Thread Chuck Esterbrook

At 11:02 PM 10/17/2001 -0600, Jack Moffitt wrote:
> > At 07:39 PM 10/17/2001 -0600, Jack Moffitt wrote:
> > >Has anyone put any brainpower towards this already that I can jump in
> > >on?  Chuck mentioned he had some ideas... what are they? :)
> >
> > I did? Er, I use MK for just about everything.
>
>As you said in the snippet I quoted, you had some ideas for people who
>wanted to pursue this on their own :)

Oh, I see. Well what I said earlier was one idea. Bypass MK's obj ref and 
list features and roll your own.

Or if you know that your obj refs always point to a specific class and 
never any subclasses that you could customize ObjRefAttr at design and 
runtime to do 32-bit obj refs instead of the 64-bit version with class id 
embedded. Of course, if you ever make a subclass that is targeted by an obj 
ref, then you are screwed.

That's all I can think of right now.

-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] MiddleKit thoughts

2001-10-17 Thread Chuck Esterbrook

At 11:21 PM 10/17/2001 -0600, Jack Moffitt wrote:
> > Not only doesn't MK deal well with legacy databases, I don't think it
> > would deal well at all with non-MK clients accessing and updating the
> > database.  At least that is my impression, as MK does a lot of
> > caching.
>
>I'd like to hear Chuck's comments on this too.  Chuck, (or others who
>are using MK), are you using the data without MK often?  And if so how
>does that work?

MK will cache lists and such, but in practice I often refetch objects from 
the database because they may be modified by outside programs (in one 
project, another MK based program (though not a web site)).

And this is a general problem with SQL databases. While you could probably 
cook up some kind of change-notification scheme using triggers and a 
notification process that implements a subscription type service (ahem, 
just discussed that with a friend last night), I haven't seen this inherent 
in any DBs. Therefore, it's inconvenient and expensive to build.

Of course, you can tell I'm thinking about trying to work this into MK for 
the benefit of MK apps.  :-)

But it will be while before I can take a whack at it.

In direct answer to your question, yes I have projects where multiple 
clients hit the database, but no they are all MK. (Unless you count the 
MySQL GUI that I sometimes use to fix things up.)

Again, if you want to use MK, but avoid a SQL schema that other products 
will balk at, refrain from using the obj ref and list data types. That puts 
you back at using explicit foreign keys like ints and strings which you 
then have to provide for. But then you have to do that somehow whether you 
use MK or not, so it's not as if MK caused you more work. You might say 
then that MK didn't give you much, but then I say it gave you some things 
and that it's a platform on which we can continue to build good stuff on.

Object models are your friends.


Someone else wrote:
> > The database does caching itself, and personally I'd rather keep the
> > caching flat -- caching at the Python level saves some communication
> > overhead, and also caches what calculations occur to create the Python
> > object (which should really be small anyway)... but if you are
> > allowing multiple clients then that's going to kill any benefit of
> > caching.  I'd be curious just how much faster caching makes the
> > database access in the current case.

I think many web apps including my own could realize a big performance gain 
if they only had to fetch objects that changed. I'd really like to see 
databases allow clients to listen for this info, or a solution that effects 
the same thing but as an add-on/tool.

Of course, the pay off will vary immensely depending upon the application.


>I think there are at least two purposes here that are possible mixed up
>in MiddleKit.
>
>One purpose is making database stuff easier.  It certainly seems much
>easier to do stuff with MiddleKit than the manual way.  Chuck has done a
>great job in this regard.

Thanks.   :-)


>Another purpose is managing these middle objects.  In java, these are
>often managed in their own environment, usually implement RMI, and can
>be distributed, etc.  There's a lot more emphasis on caching, and how
>many copies are running, etc, and much less on making data access easier
>with the backend storage.
>
>I think MiddleKit just does both of these together, and I'm wondering if
>there's an easy way to seperate the functionality, so that I use my own
>storage stuff, but keep similar interfaces for the upper layer.

Actually MK does nothing in terms of distributing your objects as 
independent services accessed via TCP/IP. More often than not, I don't need 
that in a project, so it wasn't a focus. Actually I have never needed that.

BTW I find MK's object model increasingly useful for other tasks including 
generating views, generating forms, and traversing the class hierarchy for 
various purposes. For a partial example of this, look at the 
hardly-maintained MKBrowser, which can browser any MK repository using 
generic algorithms that work off the object model. Also, I barely touch on 
this in one of the manuals.

In the future, I picture loosening up the SQL bent than MK has so that you 
can easily use MK without getting generated SQL code or requiring a SQL 
database, if you're not interested in one.


>I supposed I should just read through the code and see if I have any
>ideas.
>
>If I wasn't so used to the php/mysql/perl/blah way of doing web apps I
>probably would have used MiddleKit right off the bat.  I may recode it
>to use that.. it certainly seems nicer.  But for other things were the
>data might be shared, like this directory, I just need the middle layer
>without being so tied to the storage.

But what do you want out of the middle layer? For starters, I'll assume 
Pythonic objects that do something useful for you in the background. Does 
that include automated storage to LDAP? Does it also include some kind 

Re: [Webware-devel] solution for bind error

2001-10-18 Thread Chuck Esterbrook

At 04:51 PM 10/18/2001 -0400, Geoff Talvola wrote:
>I've checked into CVS the changes you suggested -- I added the setsockopt 
>call, moved up the initialization of self.threadCount and 
>self.threadUseCounter, and removed the annoying print ".".  Can you update 
>your copy of ThreadedAppServer.py from CVS and verify that it fixes the 
>problem?
>
>I can confirm that it still works properly on WinNT.

Well, gee you beat me to it. I was just about to apply the change.  :-)


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] MiddleKit thoughts

2001-10-18 Thread Chuck Esterbrook

At 01:26 AM 10/18/2001 -0500, Ian Bicking wrote:
>If you turned off caching (I'm not sure how this would work in MK),
>and you used the ad-hoc-foreign-key trick, would MK work with stock
>schemas and with multiple (non-MK) clients?

Yes.

Note that what is returned from store.fetchObjectsOfClass() is always 
fetched from the database. Not cached.

If you handle object references and lists yourself, then it will really be 
you who determines what is cached and how, not MK.

So there is nothing to turn off and no voodoo to work around.


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



Re: [Webware-devel] output redirect syntax?

2001-10-18 Thread Chuck Esterbrook

At 05:21 PM 10/18/2001 -0400, Jeff Johnson wrote:
>I tried to redirect stdout and stderr to /dev/null but I get the
>following error.  (FreeBSD 4.3)  What am I doing wrong?
>
>dev5# ./AppServer start > /dev/null 2>&1
>Ambiguous output redirect.


Different shells have slightly different syntaxes for this. So my first 
guess is that your shell is different from the one where 2>&1 usually works.

Try > echo $SHELL to find out. Try switching from [ba]sh to [t]csh or the 
other way around. As in /bin/bash or /bin/csh.

Also, I don't think 2&>1 is right, but if the above doesn't work, you could 
try it.


-Chuck


___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel



  1   2   3   >