Package gui :: Module interpreter :: Class Interpreter
[hide private]
[frames] | no frames]

Class Interpreter

source code


The threaded interpreter.

Instance Methods [hide private]
func
_get_backend(self, uf)
Return the user function object corresponding to the given string.
source code
bool
apply(self, uf, *args, **kwds)
Apply a user function for synchronous execution.
source code
 
empty(self)
Determine if the interpreter thread queue is empty.
source code
 
exit(self)
Cause the thread to exit once all currently queued user functions are processed.
source code
 
flush(self)
Return only once the queue is empty.
source code
 
join(self)
Wrapper method for the Queue.join() method.
source code
bool
queue(self, uf, *args, **kwds)
Queue up a user function.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(self, *args, **kargs)
Replacement method for implementing the singleton design pattern.
source code
Class Variables [hide private]
  _instance = Interpreter()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(self, *args, **kargs)
Static Method

source code 

Replacement method for implementing the singleton design pattern.

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

_get_backend(self, uf)

source code 

Return the user function object corresponding to the given string.

Parameters:
  • uf (str) - The name of the user function.
Returns: func
The user function object.

apply(self, uf, *args, **kwds)

source code 

Apply a user function for synchronous execution.

Parameters:
  • uf (str) - The user function as a string.
  • args (any arguments) - The user function arguments.
  • kwds (any keyword arguments) - The user function keyword arguments.
Returns: bool
Whether the user function was successfully applied or not.

empty(self)

source code 

Determine if the interpreter thread queue is empty.

This is a wrapper method for the thread method.

exit(self)

source code 

Cause the thread to exit once all currently queued user functions are processed.

This is a wrapper method for the thread method.

flush(self)

source code 

Return only once the queue is empty.

This is a wrapper method for the interpreter thread.

queue(self, uf, *args, **kwds)

source code 

Queue up a user function.

This is a wrapper method for the interpreter thread.

Parameters:
  • uf (str) - The user function as a string.
  • args (any arguments) - The user function arguments.
  • kwds (any keyword arguments) - The user function keyword arguments.
Returns: bool
Whether the user function was successfully applied or not (though as this is asynchronous, this cannot be checked so True will always be returned.