PSPUtils

A bunch of utility functions for the PSP generator.

Copyright (c) by Jay Love, 2000 (mailto:jsliv@jslove.org)

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.

This software is based in part on work done by the Jakarta group.

exception PSP.PSPUtils.PSPParserException

Bases: Exception

PSP parser error.

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

PSP.PSPUtils.checkAttributes(tagType, attrs, validAttrs)

Check for mandatory and optional atributes.

PSP.PSPUtils.getExpr(s)

Get the content of a PSP expression.

PSP.PSPUtils.isExpression(s)

Check whether this is a PSP expression.

PSP.PSPUtils.normalizeIndentation(pySource)

Take code block that may be too indented and move it all to the left.

PSP.PSPUtils.removeQuotes(s)
PSP.PSPUtils.splitLines(text, keepends=False)

Split text into lines.

PSP.PSPUtils.startsNewBlock(line)

Determine whether a code line starts a new block.