PSP.Context | index /usr/local/share/webware/PSP/Context.py

`Utility class for keeping track of the context.
A utility class that holds information about the file we are parsing
and the environment we are doing it in.
(c) Copyright by Jay Love, 2000 (mailto:jsliv@jslove.net)
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.`

Modules

``

PSP.BraceConverter PSP.PSPUtils | os re | string time |

Classes

``

PSPContext
  PSPCLContext

class PSPCLContext(PSPContext)
`` | `A context for command line compilation. Currently used for both cammand line and PSPServletEngine compilation. This class provides all the information necessary during the parsing and page generation steps of the PSP compilation process.`

Methods defined here:

__init__(self, pspfile, trans=None)

getBaseUri(self)

getClassPath(self)

getFullClassName(self)
  `Return class name including package prefixes.
  Won't use this for now.`

getFullPspFileName(self)

getOutputDirectory(self)
  `Provide directory to dump PSP source file to.
  I am probably doing this in reverse order at the moment.
  I should start with this and get the python filename from it.`

getPspFileName(self)

getPythonFileName(self)
  `The filename that we are generating to.`

getReader(self)
  `Return the PSPReader object assigned to this context.`

getServletClassName(self)
  `Return the class name of the servlet being generated.`

getServletWriter(self)
  `Return the ServletWriter object assigned to this context`

resolveRelativeURI(self, uri)
  `This is used mainly for including files.
  It simply returns the location relative to the base context
  directory, ie Examples/. If the filename has a leading /,
  it is assumed to be an absolute path.`

setClassName(self, name)
  `Set the class name to create.`

setPSPReader(self, reader)
  `Set the PSPReader for this context.`

setPythonFileName(self, name)
  `Sets the name of the .py file to generate.`

setServletWriter(self, writer)
  `Set the ServletWriter instance for this context.`

Methods inherited from PSPContext:

getWriter(self)

class PSPContext
`` | `PSPContext is an abstract base class for Context classes. Holds all the common stuff that various parts of the compilation will need access to. The items in this class will be used by both the compiler and the class generator.`

Methods defined here:

__init__(self)

getClassPath(self)

getFullClassName(self)
  `Return class name including package prefixes.
  Won't use this for now.`

getOutputDirectory(self)
  `Provide directory to dump PSP source file to.`

getPythonFileName(self)
  `the filename that we are generating to`

getReader(self)

getServletClassName(self)
  `Return the class name of the servlet being generated.`

getWriter(self)

setPSPReader(self)
  `Set the PSPReader for this context.`

setPythonFileName(self)
  `Set the name of the .py file to generate.`

setServletWriter(self)
  `Set the PSPWriter instance for this context.`

Data
`` |  | AwakeCreated = 0 ResponseObject = 'res'