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

`A bunch of utility functions for the PSP generator.
(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.`

Functions

``

checkAttributes(tagtype, attrs, validAttrs)
  `Missing check for mandatory atributes.`

getExpr(st)
  `Get the content of a PSP expression.`

isExpression(st)
  `Check whether this is a PSP expression.`

normalizeIndentation(pySource, tab='\t')
  `Take a block of code that may be too indented, and move it all to the left.
  See PSPUtilsTest for examples.
  First written by Winston Wolff.
  Improved version by Christoph Zwerschke.`

removeQuotes(st)

splitLines(text, keepends=0)
  `Split text into lines.`

startsNewBlock(line)
  `Determine whether line starts a new block.
  Utility function for normalizeIndentation
  Added by Christoph Zwerschke.`