ServerPortfolio
2.0
Python parsers and server
|
Manage and serialize the access to a ValidationTkinter application, necessary when UpdateStock is run with multiple threads. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | update_me |
Check regularly and indefinitely, the queue. More... | |
Queue functions, to be called by threads | |
def | write |
Write a new input to the queue. More... | |
def | read_answer |
Return the updated dict_interactive. More... | |
Public Attributes | |
queue | |
Queue to receive and send data (dict_interactive and stock symbol). More... | |
queue_answer | |
new result data. More... | |
Private Member Functions | |
def | _check_stop |
Check state of the object before stopping. More... | |
Private Attributes | |
_logger_ | |
_root_tk | |
store a Tk main environment. More... | |
Manage and serialize the access to a ValidationTkinter application, necessary when UpdateStock is run with multiple threads.
Interface to ValidationTkinter which assures serialization and thread-safety. The input dict_interactive are treated entry by entry, from an input queue and returned in an output queue. Two GUI cannot exist at the same time. The answer queue should never contain more than 1 entry.
Data are exchanged by the use of Queue for the serialization.
Usage, see main section:
Definition at line 346 of file Validation.py.
def serverportfolio.Validation.ManagerTk.__init__ | ( | self | ) |
Constructor.
Definition at line 349 of file Validation.py.
|
private |
Check state of the object before stopping.
Definition at line 410 of file Validation.py.
Referenced by serverportfolio.Validation.ManagerTk.update_me().
def serverportfolio.Validation.ManagerTk.read_answer | ( | self | ) |
Return the updated dict_interactive.
Definition at line 374 of file Validation.py.
def serverportfolio.Validation.ManagerTk.update_me | ( | self | ) |
Check regularly and indefinitely, the queue.
This function is blocking.
To stop the Manager, send the message : ['QUIT'].
Definition at line 387 of file Validation.py.
References serverportfolio.Validation.ManagerTk._check_stop(), and serverportfolio.Validation.ManagerTk._root_tk.
def serverportfolio.Validation.ManagerTk.write | ( | self, | |
new_entry | |||
) |
Write a new input to the queue.
new_entry must be a list, send ['QUIT'] to stop the manager
new_entry | list with format : ['stock_symbol',dict_interactive] |
Definition at line 370 of file Validation.py.
|
private |
Definition at line 350 of file Validation.py.
|
private |
store a Tk main environment.
Definition at line 362 of file Validation.py.
Referenced by serverportfolio.Validation.ManagerTk.update_me().
serverportfolio.Validation.ManagerTk.queue |
Queue to receive and send data (dict_interactive and stock symbol).
new data to be processed
Definition at line 355 of file Validation.py.
serverportfolio.Validation.ManagerTk.queue_answer |
new result data.
The caller should get the result before a next entry.
Definition at line 359 of file Validation.py.