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

Class Interpreter

source code


The threaded interpreter.

Instance Methods [hide private]
 
__new__(self, *args, **kargs)
Replacement method for implementing the singleton design pattern.
source code
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
Class Variables [hide private]
  _instance = None
Method Details [hide private]

__new__(self, *args, **kargs)

source code 

Replacement method for implementing the singleton design pattern.

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.