An interpreter can process chunks of empy code.
Methods
|
|
|
|
__del__
|
__del__ ( self )
|
|
__init__
|
__init__ (
self,
output=None,
argv=None,
globals=None,
prefix=DEFAULT_PREFIX,
)
|
|
close
|
close ( self )
|
|
context
|
context ( self )
|
|
die
|
die (
self,
error,
bufferedOutput=False,
rawErrors=False,
exitOnError=True,
)
Handle an actual error that occurred.
|
|
escape
|
escape (
self,
data,
more='',
)
Escape a string so that nonprintable characters are replaced
with compatible empy expansions.
|
|
evaluate
|
evaluate (
self,
expression,
locals=None,
)
Evaluate an expression.
|
|
execute
|
execute (
self,
statements,
locals=None,
)
Execute a statement.
|
|
expand
|
expand (
self,
data,
locals=None,
)
Do an explicit expansion on a subordinate stream.
|
|
file
|
file (
self,
file,
name='<file>',
locals=None,
processBangpaths=True,
)
Parse the entire contents of a file. processBangpaths indicates
whether or not a bangpath at the start of a file will be treated
as a comment.
|
|
finalize
|
finalize ( self )
Execute any remaining final routines.
|
|
flush
|
flush ( self )
|
|
handle
|
handle ( self, meta )
Handle a MetaError.
|
|
include
|
include (
self,
fileOrFilename,
locals=None,
processBangpaths=True,
)
Do an include pass on a file or filename.
|
|
installProxy
|
installProxy ( self )
Install a proxy if necessary.
|
|
interact
|
interact (
self,
bufferedOutput=False,
rawErrors=False,
exitOnError=True,
)
Perform interaction.
|
|
invoke
|
invoke (
self,
hookName,
**keywords,
)
Invoke the hook(s) associated with the hook name, should they
exist.
|
|
meta
|
meta ( self, exc=None )
Construct a MetaError for the interpreter's current state.
|
|
one
|
one (
self,
scanner,
locals=None,
)
Process exactly one expansion (starting at the beginning of
the buffer).
Exceptions
|
|
NotImplementedError, "no Unicode support"
ParseError, "invalid escape control code"
ParseError, "invalid numeric escape code"
ParseError, "no whitespace between % and key"
ParseError, "significator must have nonblank key"
ParseError, "unknown token: %s%s" %( self.prefix, primary )
ParseError, "unrecognized escape code"
TransientParseError, "comment expects newline"
TransientParseError, "significator expects newline"
|
|
|
parse
|
parse (
self,
scanner,
locals=None,
)
Parse as much from this scanner as possible.
|
|
quote
|
quote ( self, data )
Quote the given string so that if it were expanded it would
evaluate to the original.
|
|
reset
|
reset ( self )
|
|
safe
|
safe (
self,
scanner,
final=False,
locals=None,
)
Do a protected parse. Catch transient parse errors; if
final is true, then make a final pass with a terminator,
otherwise ignore the transient parse error (more data is
pending).
|
|
shutdown
|
shutdown ( self )
Declare this interpreting session over; close the stream file
object.
|
|
significate
|
significate (
self,
key,
value,
)
Declare a significator.
|
|
stream
|
stream ( self )
|
|
string
|
string (
self,
data,
name='<string>',
locals=None,
)
Parse a string.
|
|
substitute
|
substitute (
self,
substitution,
locals=None,
)
Do a command substitution.
Exceptions
|
|
ParseError, "unknown substitution type"
|
|
|
wrap
|
wrap (
self,
callable,
args,
bufferedOutput=False,
rawErrors=False,
exitOnError=True,
)
Wrap around an application of a callable and handle errors.
Return true if no error occurs.
|
|
write
|
write ( self, data )
|
|
writelines
|
writelines ( self, stuff )
|
|