On Fri, Jun 08, 2001 at 11:20:16AM -0700, Tavis Rudd wrote:
> Yep, it does and Geoff's right - compiling isn't Pythonic.
> Mike's approach is perfectly valid and very easy, but it could 
> still scare non-programmers.  It's been one of our intentions 
> all along to make it dead simple for non-programmers so we 
> should sort this out.  

OK, what is the minimum a person would need to know to do this
approach?  Once we've got that nailed down, we can decide whether
it's feasable to explain to non-programmers.

1) Copy old.py to new.py

2) Find the line that begins with:
        templateExt = '''
   (It should be the first line in the file.)

3) Find the line after it that contains only:
        '''

4) The template is between these two lines.  Make your changes *only*
   inside the template.

5) Except you must change the name of the class to match the servlet's 
   filename.  Go to the bottom of the file and change:
           class old(TemplateServlet):
   to:
           class new(TemplateServlet):

6) Step 5 would get more complicated if there is a hierarchy of site
   superclasses.  But maybe the same principle would hold: leave the
   superclass (and the super.__init__ call) alone and only change your
   class' name.

Perhaps there could be a tool TScopy which performs steps 1 and 5,
using one of Python's source-parsing modules.

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.

-- 
-Mike (Iron) Orr, [EMAIL PROTECTED]  (if mail problems: [EMAIL PROTECTED])
   http://iron.cx/     English * Esperanto * Russkiy * Deutsch * Espan~ol

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

Reply via email to