Update of /cvsroot/webware/Webware/PSP
In directory sc8-pr-cvs1:/tmp/cvs-serv9802/PSP
Modified Files:
Generators.py PSPCompiler.py PSPParser.py PSPUtils.py
Log Message:
Tabnanny revealed a number of files with mixed space and tab indentation.
I've converted them to use tabs only, as required by the Webware style
guidelines.
Index: Generators.py
===================================================================
RCS file: /cvsroot/webware/Webware/PSP/Generators.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Generators.py 26 Jan 2003 16:01:23 -0000 1.14
--- Generators.py 27 Jan 2003 16:06:06 -0000 1.15
***************
*** 2,30 ****
"""
! This module holds the classes that generate the python code reulting from the PSP template file.
! As the parser encounters PSP elements, it creates a new Generator object for that type of element.
! Each of these elements is put into a list maintained by the ParseEventHandler object. When it comes
! time to output the Source Code, each generator is called in turn to create it's source.
!
--------------------------------------------------------------------------------
! (c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
--- 2,30 ----
"""
! This module holds the classes that generate the python code reulting from the PSP template file.
! As the parser encounters PSP elements, it creates a new Generator object for that type of element.
! Each of these elements is put into a list maintained by the ParseEventHandler object. When it comes
! time to output the Source Code, each generator is called in turn to create it's source.
!
--------------------------------------------------------------------------------
! (c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
***************
*** 36,47 ****
import BraceConverter
try:
! import string
except:
! pass
try:
! import os
except:
! pass
#these are global so that the ParseEventHandler and this module agree.
--- 36,47 ----
import BraceConverter
try:
! import string
except:
! pass
try:
! import os
except:
! pass
#these are global so that the ParseEventHandler and this module agree.
***************
*** 51,56 ****
class GenericGenerator:
! """ Base class for the generators """
! def __init__(self, ctxt=None):
self._ctxt = ctxt
self.phase='Service'
--- 51,56 ----
class GenericGenerator:
! """ Base class for the generators """
! def __init__(self, ctxt=None):
self._ctxt = ctxt
self.phase='Service'
***************
*** 58,70 ****
class ExpressionGenerator(GenericGenerator):
! """ This class handles expression blocks. It simply outputs
! the (hopefully) python expression within the block wrapped
! with a _formatter() call. """
! def __init__(self, chars):
self.chars = chars
GenericGenerator.__init__(self)
! def generate(self, writer, phase=None):
writer.println('res.write(_formatter(' + PSPUtils.removeQuotes(self.chars) + '))')
--- 58,70 ----
class ExpressionGenerator(GenericGenerator):
! """ This class handles expression blocks. It simply outputs
! the (hopefully) python expression within the block wrapped
! with a _formatter() call. """
! def __init__(self, chars):
self.chars = chars
GenericGenerator.__init__(self)
! def generate(self, writer, phase=None):
writer.println('res.write(_formatter(' + PSPUtils.removeQuotes(self.chars) + '))')
***************
*** 81,88 ****
def generate(self, writer, phase=None):
! # Quote any existing backslash so generated python will not interpret it when running.
! self.chars = string.replace(self.chars, '\\', r'\\')
! # quote any single quotes so it does not get confused with our triple-quotes
self.chars = string.replace(self.chars,'"',r'\"')
--- 81,88 ----
def generate(self, writer, phase=None):
! # Quote any existing backslash so generated python will not interpret it when running.
! self.chars = string.replace(self.chars, '\\', r'\\')
! # quote any single quotes so it does not get confused with our triple-quotes
self.chars = string.replace(self.chars,'"',r'\"')
***************
*** 100,109 ****
class ScriptGenerator(GenericGenerator):
! """generates scripts"""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.chars = chars
! def generate(self, writer, phase=None):
if writer._useBraces:
--- 100,109 ----
class ScriptGenerator(GenericGenerator):
! """generates scripts"""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.chars = chars
! def generate(self, writer, phase=None):
if writer._useBraces:
***************
*** 171,182 ****
class MethodGenerator(GenericGenerator):
! """ generates class methods defined in the PSP page. There are two parts to method generation. This
! class handles getting the method name and parameters set up."""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.phase='Declarations'
self.attrs=attrs
! def generate(self, writer, phase=None):
writer.printIndent()
writer.printChars('def ')
--- 171,182 ----
class MethodGenerator(GenericGenerator):
! """ generates class methods defined in the PSP page. There are two parts to method generation. This
! class handles getting the method name and parameters set up."""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.phase='Declarations'
self.attrs=attrs
! def generate(self, writer, phase=None):
writer.printIndent()
writer.printChars('def ')
***************
*** 198,204 ****
class MethodEndGenerator(GenericGenerator):
! """ Part of class method generation. After MethodGenerator, MethodEndGenerator actually generates
! the code for th method body."""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.phase='Declarations'
--- 198,204 ----
class MethodEndGenerator(GenericGenerator):
! """ Part of class method generation. After MethodGenerator, MethodEndGenerator actually generates
! the code for th method body."""
! def __init__(self, chars, attrs):
GenericGenerator.__init__(self)
self.phase='Declarations'
***************
*** 206,210 ****
self.chars=chars
! def generate(self, writer, phase=None):
writer.pushIndent()
writer.printList(string.splitfields(PSPUtils.removeQuotes(self.chars),'\n'))
--- 206,210 ----
self.chars=chars
! def generate(self, writer, phase=None):
writer.pushIndent()
writer.printList(string.splitfields(PSPUtils.removeQuotes(self.chars),'\n'))
***************
*** 236,240 ****
if self.url == None:
raise "No path attribute in Include"
!
self.scriptgen = ScriptGenerator(self._theFunction % self.url, None)
--- 236,240 ----
if self.url == None:
raise "No path attribute in Include"
!
self.scriptgen = ScriptGenerator(self._theFunction % self.url, None)
***************
*** 248,256 ****
class InsertGenerator(GenericGenerator):
! """ Include files designated by the psp:insert syntax.
If the attribute static is set to true or 1, we include the file now, at compile time.
Otherwise, we use a function added to every PSP page named __includeFile, which reads the file at run time.
"""
! def __init__(self, attrs, param, ctxt):
GenericGenerator.__init__(self,ctxt)
self.attrs = attrs
--- 248,256 ----
class InsertGenerator(GenericGenerator):
! """ Include files designated by the psp:insert syntax.
If the attribute static is set to true or 1, we include the file now, at compile time.
Otherwise, we use a function added to every PSP page named __includeFile, which reads the file at run time.
"""
! def __init__(self, attrs, param, ctxt):
GenericGenerator.__init__(self,ctxt)
self.attrs = attrs
***************
*** 268,272 ****
if self.static == string.lower("true") or self.static == "1":
self.static=1
!
if not os.path.exists(thepath):
print self.page
--- 268,272 ----
if self.static == string.lower("true") or self.static == "1":
self.static=1
!
if not os.path.exists(thepath):
print self.page
***************
*** 277,281 ****
self.scriptgen = ScriptGenerator("self.__includeFile('%s')" % string.replace(thepath, '\\', '\\\\'), None)
! def generate(self, writer, phase=None):
""" JSP does this in the servlet. I'm doing it here because I have triple quotes.
Note: res.write statements inflate the size of the resulting classfile when it is cached.
--- 277,281 ----
self.scriptgen = ScriptGenerator("self.__includeFile('%s')" % string.replace(thepath, '\\', '\\\\'), None)
! def generate(self, writer, phase=None):
""" JSP does this in the servlet. I'm doing it here because I have triple quotes.
Note: res.write statements inflate the size of the resulting classfile when it is cached.
Index: PSPCompiler.py
===================================================================
RCS file: /cvsroot/webware/Webware/PSP/PSPCompiler.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PSPCompiler.py 20 Jan 2003 07:17:27 -0000 1.3
--- PSPCompiler.py 27 Jan 2003 16:06:07 -0000 1.4
***************
*** 6,25 ****
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
--- 6,25 ----
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
***************
*** 36,65 ****
class Compiler:
! """the main compilation class"""
! def __init__(self,context):
! self._ctxt = context
! def compile(self):
! reader = StreamReader(self._ctxt.getPspFileName(),self._ctxt)
! reader.init()
! writer = ServletWriter(self._ctxt)
!
! self._ctxt.setPSPReader(reader)
! self._ctxt.setServletWriter(writer)
! parser = PSPParser(self._ctxt)
! handler = ParseEventHandler(self._ctxt,parser)
! parser.setEventHandler(handler)
! handler.beginProcessing()
! parser.parse()
! handler.endProcessing()
! writer.close()
!
!
!
--- 36,65 ----
class Compiler:
! """the main compilation class"""
! def __init__(self,context):
! self._ctxt = context
! def compile(self):
! reader = StreamReader(self._ctxt.getPspFileName(),self._ctxt)
! reader.init()
! writer = ServletWriter(self._ctxt)
!
! self._ctxt.setPSPReader(reader)
! self._ctxt.setServletWriter(writer)
! parser = PSPParser(self._ctxt)
! handler = ParseEventHandler(self._ctxt,parser)
! parser.setEventHandler(handler)
! handler.beginProcessing()
! parser.parse()
! handler.endProcessing()
! writer.close()
+
+
!
Index: PSPParser.py
===================================================================
RCS file: /cvsroot/webware/Webware/PSP/PSPParser.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PSPParser.py 20 Jun 2002 17:48:02 -0000 1.4
--- PSPParser.py 27 Jan 2003 16:06:07 -0000 1.5
***************
*** 7,26 ****
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
--- 7,26 ----
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
***************
*** 30,50 ****
try:
! from cStringIO import StringIO
except:
! from StringIO import StringIO
class PSPParser:
! """ The PSPParser class does the actual sniffing through the input file looking for anything we're interested in.
! Basically, it starts by looking at the code looking for a '<' symbol. It looks at the code by working with a PSPReader
! object, which handle the current location in the code. When it finds one, it calls a list of functions, the xxxChecks,
! asking each if it recognizes the characters as its kind of input. When the check functions look at the characters,
! if they want it, they go ahead and gobble it up and set up to create it in the Servlet when the time comes. When they
! return, they return true if they acceptes the character, and the PSPReader object cursor is positioned past the end of
! the block that the check function accepted."""
! checklist=[]
!
! def __init__(self,ctxt):
self._reader = ctxt.getReader()
--- 30,50 ----
try:
! from cStringIO import StringIO
except:
! from StringIO import StringIO
class PSPParser:
! """ The PSPParser class does the actual sniffing through the input file looking for anything we're interested in.
! Basically, it starts by looking at the code looking for a '<' symbol. It looks at the code by working with a PSPReader
! object, which handle the current location in the code. When it finds one, it calls a list of functions, the xxxChecks,
! asking each if it recognizes the characters as its kind of input. When the check functions look at the characters,
! if they want it, they go ahead and gobble it up and set up to create it in the Servlet when the time comes. When they
! return, they return true if they acceptes the character, and the PSPReader object cursor is positioned past the end of
! the block that the check function accepted."""
! checklist=[]
!
! def __init__(self,ctxt):
self._reader = ctxt.getReader()
***************
*** 57,65 ****
self.currentFile = self._reader.Mark().getFile()
! def setEventHandler(self,handler):
"""Set the handler this parser will use when it finds psp code."""
self._handler = handler
! def flushCharData(self, start, stop):
"""Dump all the HTML that we've accumulated over to the character data handler in the event handler object."""
data = self.cout.getvalue()
--- 57,65 ----
self.currentFile = self._reader.Mark().getFile()
! def setEventHandler(self,handler):
"""Set the handler this parser will use when it finds psp code."""
self._handler = handler
! def flushCharData(self, start, stop):
"""Dump all the HTML that we've accumulated over to the character data handler in the event handler object."""
data = self.cout.getvalue()
***************
*** 69,73 ****
self.cout = StringIO()
! def commentCheck(self, handler, reader):
"""Comments just get eaten"""
OPEN_COMMENT = '<%--'
--- 69,73 ----
self.cout = StringIO()
! def commentCheck(self, handler, reader):
"""Comments just get eaten"""
OPEN_COMMENT = '<%--'
***************
*** 85,92 ****
return 0
! checklist.append(commentCheck) #add this checker to the list that the parse function will call
! def checkExpression(self, handler, reader):
""" Look for "expressions" and handle them"""
--- 85,92 ----
return 0
! checklist.append(commentCheck) #add this checker to the list that the parse function will call
! def checkExpression(self, handler, reader):
""" Look for "expressions" and handle them"""
***************
*** 108,113 ****
reader.Advance(len(end_open))
reader.skipSpaces()
! #below not implemented
! #PSPUtil.checkAttrs('Expression',attrs,validAttrs)
reader.peekChar()
--- 108,113 ----
reader.Advance(len(end_open))
reader.skipSpaces()
! #below not implemented
! #PSPUtil.checkAttrs('Expression',attrs,validAttrs)
reader.peekChar()
***************
*** 121,129 ****
return 1
! checklist.append(checkExpression)
! def checkDirective(self, handler, reader):
""" Check for directives. I support two right now, page and include."""
validDirectives = ['page','include']
--- 121,129 ----
return 1
! checklist.append(checkExpression)
! def checkDirective(self, handler, reader):
""" Check for directives. I support two right now, page and include."""
validDirectives = ['page','include']
***************
*** 138,142 ****
start = reader.Mark()
! reader.Advance(len(OPEN_DIRECTIVE))
match = None
--- 138,142 ----
start = reader.Mark()
! reader.Advance(len(OPEN_DIRECTIVE))
match = None
***************
*** 175,192 ****
return 1
! checklist.append(checkDirective)
!
! def checkEndBlock(self, handler, reader):
! OPEN_SCRIPT='<%'
! CLOSE_SCRIPT='%>'
! CLOSE_SCRIPT2='$%>'
! CENTER_SCRIPT='end'
! start=reader.Mark()
! if reader.Matches(OPEN_SCRIPT):
! reader.Advance(len(OPEN_SCRIPT))
! reader.skipSpaces()
! if reader.Matches(CENTER_SCRIPT):
reader.Advance(len(CENTER_SCRIPT))
reader.skipSpaces()
--- 175,192 ----
return 1
! checklist.append(checkDirective)
!
! def checkEndBlock(self, handler, reader):
! OPEN_SCRIPT='<%'
! CLOSE_SCRIPT='%>'
! CLOSE_SCRIPT2='$%>'
! CENTER_SCRIPT='end'
! start=reader.Mark()
! if reader.Matches(OPEN_SCRIPT):
! reader.Advance(len(OPEN_SCRIPT))
! reader.skipSpaces()
! if reader.Matches(CENTER_SCRIPT):
reader.Advance(len(CENTER_SCRIPT))
reader.skipSpaces()
***************
*** 202,215 ****
print ">>>>Putting a $ at the end of an end tag does nothing, I Say"
return 1
! #that wasn't it
! reader.reset(start)
! return 0
! checklist.append(checkEndBlock)
! def checkScript(self, handler, reader):
""" The main thing we're after. Check for embedded scripts"""
OPEN_SCRIPT = '<%'
--- 202,215 ----
print ">>>>Putting a $ at the end of an end tag does nothing, I Say"
return 1
! #that wasn't it
! reader.reset(start)
! return 0
! checklist.append(checkEndBlock)
! def checkScript(self, handler, reader):
""" The main thing we're after. Check for embedded scripts"""
OPEN_SCRIPT = '<%'
***************
*** 248,256 ****
return 1
! checklist.append(checkScript)
! def checkMethod(self, handler, reader):
""" Check for class methods defined in the page. I only support one format for these,
<psp:method name="xxx" params="xxx,xxx"> Then the function BODY, then <psp:method> """
--- 248,256 ----
return 1
! checklist.append(checkScript)
! def checkMethod(self, handler, reader):
""" Check for class methods defined in the page. I only support one format for these,
<psp:method name="xxx" params="xxx,xxx"> Then the function BODY, then <psp:method> """
***************
*** 282,290 ****
return 0
! checklist.append(checkMethod)
! def checkInclude(self, handler, reader):
"""
Check for inserting another pages output in this spot.
--- 282,290 ----
return 0
! checklist.append(checkMethod)
! def checkInclude(self, handler, reader):
"""
Check for inserting another pages output in this spot.
***************
*** 315,323 ****
return 0
! checklist.append(checkInclude)
! def checkInsert(self, handler, reader):
"""Check for straight character dumps. No big hurry for this. It's almost the same as
as the page include directive. This is only a partial implementation of what JSP does.
--- 315,323 ----
return 0
! checklist.append(checkInclude)
! def checkInsert(self, handler, reader):
"""Check for straight character dumps. No big hurry for this. It's almost the same as
as the page include directive. This is only a partial implementation of what JSP does.
***************
*** 348,355 ****
return 0
! checklist.append(checkInsert)
! def parse(self, until=None, accept=None):
""" Parse the PSP file"""
noPspElement = 0
--- 348,355 ----
return 0
! checklist.append(checkInsert)
! def parse(self, until=None, accept=None):
""" Parse the PSP file"""
noPspElement = 0
***************
*** 358,362 ****
while reader.hasMoreInput():
!
#This is for XML style blocks, which I'm not handling yet
if until !=None and reader.Matches(until):
--- 358,362 ----
while reader.hasMoreInput():
!
#This is for XML style blocks, which I'm not handling yet
if until !=None and reader.Matches(until):
***************
*** 373,378 ****
! ##in JSP, this is an array of valid tag type to check for, I'm not using it now,
! ## and I don't think JSP does either
if accept:
pass
--- 373,378 ----
! ##in JSP, this is an array of valid tag type to check for, I'm not using it now,
! ## and I don't think JSP does either
if accept:
pass
***************
*** 398,401 ****
!
--- 398,401 ----
!
Index: PSPUtils.py
===================================================================
RCS file: /cvsroot/webware/Webware/PSP/PSPUtils.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PSPUtils.py 20 Jun 2002 17:48:02 -0000 1.2
--- PSPUtils.py 27 Jan 2003 16:06:07 -0000 1.3
***************
*** 6,25 ****
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
--- 6,25 ----
(c) Copyright by Jay Love, 2000 (mailto:jsliv@...)
! Permission to use, copy, modify, and distribute this software and its
! documentation for any purpose and without fee or royalty is hereby granted,
! provided that the above copyright notice appear in all copies and that
! both that copyright notice and this permission notice appear in
! supporting documentation or portions thereof, including modifications,
! that you make.
! THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO
! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
! NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
! WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
! This software is based in part on work done by the Jakarta group.
"""
***************
*** 33,63 ****
def removeQuotes(st):
! return string.replace(st,"%\\\\>","%>")
def isExpression(st):
! OPEN_EXPR = '<%='
! CLOSE_EXPR = '%>'
!
! if ((st[:len(OPEN_EXPR)] == OPEN_EXPR) and (st[-len(CLOSE_EXPR):] == CLOSE_EXPR)):
return 1
- return 1
def getExpr(st):
! OPEN_EXPR = '<%='
! CLOSE_EXPR = '%>'
! length = len(st)
! if ((st[:len(OPEN_EXPR)] == OPEN_EXPR) and (st[-len(CLOSE_EXPR):] == CLOSE_EXPR)):
! retst = st[len(OPEN_EXPR):-(len(CLOSE_EXPR))]
! else:
! retst=''
! return retst
def checkAttributes(tagtype, attrs, validAttrs):
! #missing check for mandatory atributes
! #see line 186 in JSPUtils.java
! pass
!
--- 33,63 ----
def removeQuotes(st):
! return string.replace(st,"%\\\\>","%>")
def isExpression(st):
! OPEN_EXPR = '<%='
! CLOSE_EXPR = '%>'
!
! if ((st[:len(OPEN_EXPR)] == OPEN_EXPR) and (st[-len(CLOSE_EXPR):] == CLOSE_EXPR)):
! return 1
return 1
def getExpr(st):
! OPEN_EXPR = '<%='
! CLOSE_EXPR = '%>'
! length = len(st)
! if ((st[:len(OPEN_EXPR)] == OPEN_EXPR) and (st[-len(CLOSE_EXPR):] == CLOSE_EXPR)):
! retst = st[len(OPEN_EXPR):-(len(CLOSE_EXPR))]
! else:
! retst=''
! return retst
def checkAttributes(tagtype, attrs, validAttrs):
! #missing check for mandatory atributes
! #see line 186 in JSPUtils.java
! pass
!
|