ServerPortfolio  2.0
Python parsers and server
 All Classes Namespaces Files Functions Variables Properties Pages
Validation.v1.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 ## @package serverportfolio.Validation
4 # @brief For user validation before updating the data
5 
6 # todo extend to console, extend to the update of list_csv/divsplit
7 
8 # ScrollVerticalFrame seems to work, but consums lots of memory, even crash, maybe memory leack ?
9 # see simple tests in bin..scroll3.py
10 # not seems to good to mix grid and pack "in the same container"
11 
12 import logging
13 
14 import Tkinter as tk
15 from Tkinter import *
16 from ttk import *
17 
18 ## @class ValidationTkinter
19 # @brief Small GUI to validate the update of data
20 class ValidationTkinter(tk.Frame):
21 
22  def __init__(self, dict_input, master=None):
23  tk.Frame.__init__(self, master)
24 
25  # default cell of the top-level windows can expend
26  self.grid(sticky=tk.N+tk.S+tk.E+tk.W)
27 
28  # dict_interactive in input/output
29  self.dict_input = dict_input
30  #self.grid()
31  self.createWidgets()
32 
33  def createWidgets(self):
34 
35  top=self.winfo_toplevel()
36  top.columnconfigure(0, weight=1)
37  #top.rowconfigure(0, weight=1)
38 
39  self.columnconfigure(0, weight=1)
40  # TO not forget for each column
41  #self.columnconfigure(1, weight=1)
42  #self.rowconfigure(0,weight=1)
43 
44  # will contains the IntVars
45  self.dict_choice = {}
46 
47  #i = 0
48  labf = {}
49  for key_action, value_action in self.dict_input.iteritems():
50 
51  # create key for each action
52  #self.dict_choice[key_action] = {}
53 
54  # move all the rest to create_one_input_xml, makes sense
55  # create a Label Frame for each action, expand horizontally
56  labf[key_action] = tk.LabelFrame(self, text=key_action)
57  # always add in the next row, column 0
58  labf[key_action].grid( sticky=tk.E+tk.W, pady=8,padx=5 )
59 
60  # create key for each action
61  self.dict_choice[key_action] = {}
62 
63  # same behaviour, if here, more logic
64  i = 0
65 
66  # list of value
67  for key_value, value_value in value_action.iteritems():
68 
69  name = key_value
70  old_value = value_value['xml_value']
71  new_value = value_value['new_value']
72  state = value_value['repl_add']
73  # can send dict_choice[key_action]
74  self.create_one_input_xml(i, labf[key_action], key_action, name, old_value, new_value, state) #, self.lchoice, self.lrb)
75  i += 1
76 
77  #
78  frame_button = tk.Frame(self)
79  frame_button.grid()
80  # parent first argument
81  self.validButton = tk.Button(frame_button, text='Valid', command=self.valid)
82  self.validButton.grid(column=0, row=0, sticky=tk.E, pady=5)
83 
84  self.quitButton = tk.Button(frame_button, text='Quit', command=self.quit)
85  self.quitButton.grid(column=1, row=0, sticky=tk.W, pady=5)
86 
87  #for child in self.winfo_children(): child.grid_configure(padx=5, pady=5)
88 
89  ## @brief Check Validation is valid (all radiobuttons selected)
90  def valid(self):
91  #print "Validation Button"
92  #print 'dict_choice ', self.dict_choice
93 
94  # check all values have been validated, could be common, never error in HistPrice
95  for key_action, value_action in self.dict_choice.iteritems():
96  for value in self.dict_choice[key_action].values():
97 
98  if not ((value.get() == 0) | (value.get() == 2)):
99  # make message, not all selected, continue, cancel...
100  self.popupmsg("All entries must be selected as Accepted or Rejected to continue,\nor press Quit to validate the default")
101  return
102 
103  # update dict_interactive, specific xml
104  for key_action in self.dict_choice.keys():
105 
106  #while any(self.dict_choice[key_action]):
107  for name in self.dict_choice[key_action].keys():
108 
109  # only one element
110  value = self.dict_choice[key_action][name]
111  #print "key, value ", value
112  self.dict_input[key_action][name]['repl_add'] = value.get()
113 
114  # quit application
115  self.quit()
116 
117  def create_one_input_xml(self, i, labframe, action, name, old_value, new_value, state):
118 
119  var = tk.IntVar()
120  var.set( state )
121 
122  # consider name is unique here, but still tricky to get the data
123  self.dict_choice[action][name] = var
124 
125  # this column, after new value, only can expad, looks ok, radio button always on the right
126  # minsize ok for initial, but bad when minimised
127  labframe.columnconfigure(2, weight=1,minsize=100 )
128  tk.Label( labframe, text=name).grid(column=0, row=i, sticky=tk.W, padx=5, pady=2)
129  tk.Label( labframe, text=str(old_value)).grid(column=1, row=i, sticky=tk.W, padx=5, pady=2)
130  # option Label width=50 makes text center
131  tk.Label( labframe, text=str(new_value)).grid(column=2, row=i, sticky=tk.W, padx=5, pady=2)
132  # radio button
133  tk.Radiobutton( labframe, text='Rej.', variable=var, value=0).grid(column=3, row=i, sticky=tk.E)
134  tk.Radiobutton( labframe, text='Acc.', variable=var, value=2).grid(column=4, row=i, sticky=tk.E)
135 
136 
137  def popupmsg(self,msg):
138 
139  popup = tk.Toplevel(takefocus=True)
140  popup.title('Message')
141  tk.Label( popup, text=msg).grid( padx=10, pady=10)
142  tk.Button(popup, text='Ok', command=popup.quit).grid( pady=10 )
143 
144 # to combine later, maybe base class and derived ones...
145 # or one class, and in a specific LabelFrame can be deal with both
146 
147 # http://tkinter.unpythonic.net/wiki/VerticalScrolledFrame
148 
149 class VerticalScrolledFrame(tk.Frame):
150  """A pure Tkinter scrollable frame that actually works!
151  * Use the 'interior' attribute to place widgets inside the scrollable frame
152  * Construct and pack/place/grid normally
153  * This frame only allows vertical scrolling
154 
155  """
156  def __init__(self, parent, *args, **kw):
157  tk.Frame.__init__(self, parent, *args, **kw)
158 
159  # create a canvas object and a vertical scrollbar for scrolling it
160  vscrollbar = tk.Scrollbar(self, orient=tk.VERTICAL)
161  vscrollbar.pack(fill=Y, side=RIGHT, expand=FALSE)
162  canvas = tk.Canvas(self, bd=0, highlightthickness=0,
163  yscrollcommand=vscrollbar.set)
164  canvas.pack(side=LEFT, fill=BOTH, expand=TRUE)
165  vscrollbar.config(command=canvas.yview)
166 
167  # reset the view
168  canvas.xview_moveto(0)
169  canvas.yview_moveto(0)
170 
171  # create a frame inside the canvas which will be scrolled with it
172  self.interior = interior = tk.Frame(canvas)
173  interior_id = canvas.create_window(0, 0, window=interior, anchor=tk.NW)
174 
175  # track changes to the canvas and frame width and sync them,
176  # also updating the scrollbar
177  def _configure_interior(event):
178  # update the scrollbars to match the size of the inner frame
179  size = (interior.winfo_reqwidth(), interior.winfo_reqheight())
180  canvas.config(scrollregion="0 0 %s %s" % size)
181  if interior.winfo_reqwidth() != canvas.winfo_width():
182  # update the canvas's width to fit the inner frame
183  canvas.config(width=interior.winfo_reqwidth())
184  interior.bind('<Configure>', _configure_interior)
185 
186  def _configure_canvas(event):
187  if interior.winfo_reqwidth() != canvas.winfo_width():
188  # update the inner frame's width to fill the canvas
189  canvas.itemconfigure(interior_id, width=canvas.winfo_width())
190  canvas.bind('<Configure>', _configure_canvas)
191 
192 
193 ## @class ValidationTkHP
194 # @brief Small GUI, specific for dealing with list_csv
195 class ValidationTkHP(tk.Frame):
196 
197  def __init__(self, dict_input, master=None):
198  tk.Frame.__init__(self, master)
199 
200  self.logger = logging.getLogger('SP.ValidationtTkHP')
201  # default cell of the top-level windows can expend
202  self.grid(sticky=tk.N+tk.S+tk.E+tk.W)
203 
204  # dict_interactive in input/output
205  self.dict_input = dict_input
206  self.logger.debug("init ValidationTkHP")
207 
208  self.createWidgets()
209 
210  def createWidgets(self):
211  # to make resizable frame, columnconfigure must be called/ same with rowconfigure
212  top=self.winfo_toplevel()
213  # make column 0 resizable
214  top.columnconfigure(0, weight=1)
215  # only colomn 0, here need more
216 
217  self.columnconfigure(0, weight=1)
218  #self.quit.grid( 0,0 sticky=tk.N+tk.S+tk.E+tk.W)
219  # will contains the IntVars, common with XML
220  self.dict_choice = {}
221 
222 
223  #i = 0
224  # a priori only one label with csv, maybe DivSplit can be combined later
225  self.labf = {}
226  label_frame = {}
227 
228  for key_action, value_action in self.dict_input.iteritems():
229 
230  # create key
231  self.dict_choice[key_action] = {}
232 
233  label_frame = tk.LabelFrame(self, text=key_action)
234  # allow the scrollbar to stay on the rigth
235  label_frame.columnconfigure(0, weight=1)
236  label_frame.grid(sticky=tk.E+tk.W, pady=8,padx=5)
237 
238  # here common
239  # create a Label Frame for each action, parent is self (tk.Frame)
240  #labf[key_action] = tk.LabelFrame(self, text=key_action) #.grid()
241  # always add in the next row, column 0
242  #labf[key_action].grid( sticky=tk.E+tk.W, pady=8,padx=5 )
243 
244  self.labf[key_action] = VerticalScrolledFrame(label_frame) #self)
245  # grid or pack working ? both like said
246 
247  self.labf[key_action].grid(sticky=tk.E+tk.W) #pack()
248 
249  #self.label = Label(self, text="Shrink the window to activate the scrollbar.")
250  #self.label.grid() #pack()
251 
252  #buttons = []
253  #for i in range(50):
254  # buttons.append(Button(self.labf[key_action].interior, text="Button " + str(i)))
255  # buttons[-1].grid() #pack()
256 
257 #
258  i = 0
259  # list of value, integer number, value == [ error: ['error_str',[list_values]], repl_add : intger
260  for key_value, value_value in value_action.iteritems():
261 
262  print "key_value/ value_value ", key_value, value_value
263 
264  #name = key_value, only an integer
265  #old_value = value_value['xml_value']
266  #new_value = value_value['new_value']
267  label_values = ' '.join(str(value) for value in value_value['error'][1])
268  #print "label_values ", label_values
269  label_error = value_value['error'][0]
270 
271  # most important
272  state = value_value['repl_add']
273  # or send self.dict_choice[action][name] ??
274  #self.createOneInput(i, labf[key_action], key_action, name, old_value, new_value, state) #, self.lchoice, self.lrb)
275  self.create_one_input_csv( i, self.labf[key_action], key_action, label_values, label_error, state )
276  i += 1
277  # if list long enought it is ok
278  self.create_one_input_csv( i, self.labf[key_action], key_action, label_values, label_error, state )
279  i += 1
280  self.create_one_input_csv( i, self.labf[key_action], key_action, label_values, label_error, state )
281  i += 1
282 
283  # this is similar with Valid XML
284  # to make a specific Frame to contain these buttons
285  # parent first argument, should combine with .grid()
286  frame_button = tk.Frame(self)
287  self.validButton = tk.Button(frame_button, text='Valid', command=self.valid)
288  # to make it print
289  #self.validButton.grid(column=1, row=i+2, sticky=tk.E+tk.W) #sticky=tk.N+tk.S+tk.E+tk.W)
290  self.validButton.grid(column=0, row = 0)
291  self.quitButton = tk.Button(frame_button, text='Quit', command=self.quit)
292  # to make it print
293  self.quitButton.grid(column=1, row=0, sticky=tk.N+tk.S+tk.E+tk.W )
294 
295  # strange not call to frame_button.grid( column=0, row =count_action) ??
296  #frame_button.
297  # not call to labf.grid() ? default
298 
299  # need sticky for each ??
300  #for child in self.winfo_children(): child.grid_configure(padx=5, pady=5)
301 
302  ## @brief Check Validation is valid (all radiobuttons selected)
303  def valid(self):
304  #print "Validation Button"
305  print 'dict_choice ', self.dict_choice
306 
307  # check all values have been correctly selected
308  # key is an integer here
309  for key_action, value_action in self.dict_choice.iteritems():
310 
311  for value in self.dict_choice[key_action].values():
312 
313  if not ((value.get() == 0) | (value.get() == 2)):
314  # make message, not all selected, continue, cancel...
315  return
316 
317  # modify repl_add, similar to XML
318  print "Ok, all selected, Apply the selection"
319  for key_action in self.dict_choice.keys():
320 
321  for name in self.dict_choice[key_action].keys():
322 
323  # only one element
324  value = self.dict_choice[key_action][name]
325  #print "key, value ", value
326  self.dict_input[key_action][name]['repl_add'] = value.get()
327 
328  # quit application
329  self.quit()
330 
331  # label different
332  def create_one_input_csv(self, i, labframe, action, label_values, label_error, state):
333 
334  var = tk.IntVar()
335  var.set( state )
336 
337  # consider name is unique here, but still tricky to get the data
338  #self.dict_choice[action][name] = var
339  self.dict_choice[action][i] = var
340 
341  if state == 0:
342  color_lab = 'red'
343  else:
344  color_lab = 'black'
345 
346  # need interior here, or assign before ??
347  labframe.interior.columnconfigure(1, weight=1,minsize=100 )
348  label1 = tk.Label( labframe.interior, text=label_values, fg=color_lab).grid(column=0, row=i+1, sticky=tk.W )#, sticky=tk.N+tk.S+tk.E+tk.W ) # sticky=tk.N+tk.S+tk.E+tk.W how to strech
349  label2 = tk.Label( labframe.interior, text=label_error, fg=color_lab).grid(column=1, row=i+1, sticky=tk.W )
350  #label1 = tk.Label( labframe, text=str(old_value)).grid(column=2, row=i+1)
351  #label2 = tk.Label( labframe, text=str(new_value)).grid(column=3, row=i+1)
352 
353  # radio button, common to all as well
354  rb1 = tk.Radiobutton( labframe.interior, text='Rej.', variable=var, value=0).grid(column=3, row=i+1, sticky=tk.N+tk.S+tk.E+tk.W)
355  rb2 = tk.Radiobutton( labframe.interior, text='Acc..', variable=var, value=2).grid(column=4, row=i+1, sticky=tk.N+tk.S+tk.E+tk.W)
356 
357 
358 if __name__ == "__main__":
359 
360 # test = {
361 # 'Info': {'Sector': {'xml_value': None, 'new_value': 'Utilities', 'date': '2015-03-03', 'source': 'YQL', 'repl_add': 0},
362 # 'StockExchange': {'xml_value': None, 'new_value': 'Paris', 'date': '2015-03-03', 'source': 'YQL', 'repl_add': 2}
363 # },
364 # 'Other': {'Industry': {'xml_value': None, 'new_value': 'Diversified Utilities', 'date': '2015-03-03', 'source': 'YQL', 'repl_add': 2},
365 # 'Name': {'xml_value': None, 'new_value': 'GDF SUEZ', 'date': '2015-03-03', 'source': 'YQL', 'repl_add': 1}
366 # }
367 # }
368 # # ValidationTkXML
369 # app = ValidationTkinter( test )
370 
371  #test = {'HistPrice': {0: {'repl_add': 0, 'error': ['volume 0', [1425510000, 4929.04, 4974.64, 4926.09, 4963.51, 0.0]]}, 1: {'repl_add': 0, 'error': ['volume 0', [1425423600, 4882.94, 4917.35, 4856.14, 4917.35, 0.0]]}, 2: {'repl_add': 2, 'error': []}, 3: {'repl_add': 2, 'error': []}, 4: {'repl_add': 2, 'error': []}, 5: {'repl_add': 2, 'error': []}, 6: {'repl_add': 2, 'error': []}, 7: {'repl_add': 2, 'error': []}, 8: {'repl_add': 2, 'error': []}, 9: {'repl_add': 2, 'error': []}, 10: {'repl_add': 0, 'error': ['volume 0', [1424300400, 4788.4, 4841.69, 4770.17, 4833.28, 0.0]]}, 11: {'repl_add': 0, 'error': ['volume 0', [1424214000, 4782.59, 4806.68, 4775.87, 4799.03, 0.0]]}, 12: {'repl_add': 0, 'error': ['volume 0', [1424127600, 4720.93, 4766.67, 4683.19, 4753.99, 0.0]]}, 13: {'repl_add': 2, 'error': []}, 14: {'repl_add': 0, 'error': ['volume 0', [1423782000, 4748.04, 4779.54, 4741.2, 4759.36, 0.0]]}, 15: {'repl_add': 0, 'error': ['volume 0', [1423695600, 4670.08, 4746.75, 4664.03, 4726.2, 0.0]]}, 16: {'repl_add': 2, 'error': []}, 17: {'repl_add': 2, 'error': []}, 18: {'repl_add': 2, 'error': []}, 19: {'repl_add': 0, 'error': ['volume 0', [1423177200, 4698.84, 4707.24, 4675.37, 4691.03, 0.0]]}, 20: {'repl_add': 2, 'error': []}, 21: {'repl_add': 2, 'error': []}, 22: {'repl_add': 0, 'error': ['volume 0', [1422918000, 4651.07, 4701.52, 4645.15, 4677.9, 0.0]]}, 23: {'repl_add': 2, 'error': []}, 24: {'repl_add': 2, 'error': []}, 25: {'repl_add': 2, 'error': []}, 26: {'repl_add': 2, 'error': []}, 27: {'repl_add': 0, 'error': ['volume 0', [1422313200, 4671.76, 4679.26, 4592.62, 4624.21, 0.0]]}, 28: {'repl_add': 2, 'error': []}, 29: {'repl_add': 2, 'error': []}, 30: {'repl_add': 2, 'error': []}, 31: {'repl_add': 2, 'error': []}, 32: {'repl_add': 0, 'error': ['volume 0', [1421708400, 4406.96, 4463.51, 4405.94, 4446.02, 0.0]]}, 33: {'repl_add': 2, 'error': []}, 34: {'repl_add': 0, 'error': ['volume 0', [1421362800, 4303.55, 4387.22, 4294.76, 4379.62, 0.0]]}, 35: {'repl_add': 0, 'error': ['volume 0', [1421276400, 4262.94, 4338.73, 4119.35, 4323.2, 0.0]]}, 36: {'repl_add': 2, 'error': []}, 37: {'repl_add': 0, 'error': ['volume 0', [1421103600, 4204.77, 4307.92, 4197.81, 4290.28, 0.0]]}, 38: {'repl_add': 0, 'error': ['volume 0', [1421017200, 4196.78, 4252.27, 4165.15, 4228.24, 0.0]]}, 39: {'repl_add': 0, 'error': ['volume 0', [1420758000, 4249.26, 4272.83, 4149.14, 4179.07, 0.0]]}, 40: {'repl_add': 0, 'error': ['volume 0', [1420671600, 4176.16, 4270.11, 4163.63, 4260.19, 0.0]]}, 41: {'repl_add': 0, 'error': ['volume 0', [1420585200, 4111.73, 4144.95, 4080.78, 4112.73, 0.0]]}, 42: {'repl_add': 0, 'error': ['volume 0', [1420498800, 4129.89, 4151.41, 4076.16, 4083.5, 0.0]]}, 43: {'repl_add': 0, 'error': ['volume 0', [1420412400, 4221.99, 4276.92, 4105.45, 4111.36, 0.0]]}, 44: {'repl_add': 0, 'error': ['volume 0', [1420153200, 4294.05, 4311.0, 4224.34, 4252.29, 0.0]]}, 45: {'repl_add': 0, 'error': ['volume 0', [1419980400, 4256.17, 4275.58, 4255.33, 4272.75, 0.0]]}, 46: {'repl_add': 0, 'error': ['volume 0', [1419894000, 4293.9, 4296.02, 4245.54, 4245.54, 0.0]]}, 47: {'repl_add': 0, 'error': ['volume 0', [1419807600, 4301.66, 4317.93, 4249.95, 4317.93, 0.0]]}, 48: {'repl_add': 0, 'error': ['volume 0', [1419375600, 4309.75, 4316.39, 4295.02, 4295.85, 0.0]]}, 49: {'repl_add': 0, 'error': ['volume 0', [1419289200, 4264.54, 4314.97, 4259.21, 4314.97, 0.0]]}, 50: {'repl_add': 0, 'error': ['volume 0', [1419202800, 4255.88, 4295.15, 4239.36, 4254.43, 0.0]]}, 51: {'repl_add': 0, 'error': ['volume 0', [1418943600, 4282.39, 4291.2, 4202.07, 4241.65, 0.0]]}, 52: {'repl_add': 0, 'error': ['volume 0', [1418857200, 4186.26, 4249.49, 4159.95, 4249.49, 0.0]]}, 53: {'repl_add': 0, 'error': ['volume 0', [1418770800, 4052.23, 4131.81, 4035.3, 4111.91, 0.0]]}, 54: {'repl_add': 0, 'error': ['volume 0', [1418684400, 4027.51, 4094.19, 3926.34, 4093.2, 0.0]]}, 55: {'repl_add': 0, 'error': ['volume 0', [1418598000, 4094.46, 4144.31, 4000.8, 4005.38, 0.0]]}, 56: {'repl_add': 0, 'error': ['volume 0', [1418338800, 4197.48, 4202.52, 4103.49, 4108.93, 0.0]]}, 57: {'repl_add': 0, 'error': ['volume 0', [1418252400, 4225.33, 4249.12, 4196.53, 4225.86, 0.0]]}, 58: {'repl_add': 0, 'error': ['volume 0', [1418166000, 4280.34, 4306.72, 4216.18, 4227.91, 0.0]]}, 59: {'repl_add': 2, 'error': []}, 60: {'repl_add': 2, 'error': []}, 61: {'repl_add': 2, 'error': []}, 62: {'repl_add': 2, 'error': []}, 63: {'repl_add': 2, 'error': []}, 64: {'repl_add': 2, 'error': []}, 65: {'repl_add': 2, 'error': []}, 66: {'repl_add': 2, 'error': []}, 67: {'repl_add': 2, 'error': []}, 68: {'repl_add': 2, 'error': []}, 69: {'repl_add': 2, 'error': []}, 70: {'repl_add': 2, 'error': []}, 71: {'repl_add': 2, 'error': []}, 72: {'repl_add': 2, 'error': []}, 73: {'repl_add': 2, 'error': []}, 74: {'repl_add': 2, 'error': []}, 75: {'repl_add': 2, 'error': []}, 76: {'repl_add': 2, 'error': []}, 77: {'repl_add': 2, 'error': []}, 78: {'repl_add': 2, 'error': []}, 79: {'repl_add': 2, 'error': []}, 80: {'repl_add': 2, 'error': []}}}
372  # 10 entries, error and no errors
373  #test = {'HistPrice': {0: {'repl_add': 0, 'error': ['volume 0', [1425510000, 4929.04, 4974.64, 4926.09, 4963.51, 0.0]]}, 1: {'repl_add': 0, 'error': ['volume 0', [1425423600, 4882.94, 4917.35, 4856.14, 4917.35, 0.0]]}, 2: {'repl_add': 2, 'error': []}, 3: {'repl_add': 2, 'error': []}, 4: {'repl_add': 2, 'error': []}, 5: {'repl_add': 2, 'error': []}, 6: {'repl_add': 2, 'error': []}, 7: {'repl_add': 2, 'error': []}, 8: {'repl_add': 2, 'error': []}, 9: {'repl_add': 2, 'error': []}, 10: {'repl_add': 0, 'error': ['volume 0', [1424300400, 4788.4, 4841.69, 4770.17, 4833.28, 0.0]]}}}
374 
375 #
376 # {'HistPrice': {0: {'repl_add': 0, 'error': ['volume 0', [1425510000, 4929.04, 4974.64, 4926.09, 4963.51, 0.0]]}, 1: {'repl_add': 0, 'error': ['volume 0', [1425423600, 4882.94, 4917.35, 4856.14, 4917.35, 0.0]]}, 2: {'repl_add': 2, 'error': ['', [1425337200, 4922.43, 4936.47, 4863.92, 4869.25, 116619800.0]]}, 3: {'repl_add': 2, 'error': ['', [1425250800, 4937.43, 4950.59, 4900.11, 4917.32, 149942900.0]]}, 4: {'repl_add': 2, 'error': ['', [1424991600, 4905.77, 4951.48, 4903.09, 4951.48, 120717900.0]]}, 5: {'repl_add': 2, 'error': ['', [1424905200, 4884.89, 4910.62, 4877.24, 4910.62, 105228900.0]]}, 6: {'repl_add': 2, 'error': ['', [1424818800, 4885.0, 4894.6, 4863.22, 4882.22, 117214700.0]]}, 7: {'repl_add': 2, 'error': ['', [1424732400, 4865.68, 4899.52, 4843.96, 4886.44, 106329800.0]]}, 8: {'repl_add': 2, 'error': ['', [1424646000, 4872.13, 4875.97, 4832.36, 4862.3, 102128000.0]]}, 9: {'repl_add': 2, 'error': ['', [1424386800, 4821.38, 4837.93, 4780.81, 4830.9, 140055500.0]]}, 10: {'repl_add': 0, 'error': ['volume 0', [1424300400, 4788.4, 4841.69, 4770.17, 4833.28, 0.0]]}}},
377 
378  test = {
379  'HistPrice': {0: {'repl_add': 0, 'error': ['volume 0', [1425510000, 4929.04, 4974.64, 4926.09, 4963.51, 0.0]]}, 1: {'repl_add': 0, 'error': ['volume 0', [1425423600, 4882.94, 4917.35, 4856.14, 4917.35, 0.0]]}, 2: {'repl_add': 2, 'error': ['', [1425337200, 4922.43, 4936.47, 4863.92, 4869.25, 116619800.0]]}, 3: {'repl_add': 2, 'error': ['', [1425250800, 4937.43, 4950.59, 4900.11, 4917.32, 149942900.0]]}, 4: {'repl_add': 2, 'error': ['', [1424991600, 4905.77, 4951.48, 4903.09, 4951.48, 120717900.0]]}, 5: {'repl_add': 2, 'error': ['', [1424905200, 4884.89, 4910.62, 4877.24, 4910.62, 105228900.0]]}, 6: {'repl_add': 2, 'error': ['', [1424818800, 4885.0, 4894.6, 4863.22, 4882.22, 117214700.0]]}, 7: {'repl_add': 2, 'error': ['', [1424732400, 4865.68, 4899.52, 4843.96, 4886.44, 106329800.0]]}, 8: {'repl_add': 2, 'error': ['', [1424646000, 4872.13, 4875.97, 4832.36, 4862.3, 102128000.0]]}, 9: {'repl_add': 2, 'error': ['', [1424386800, 4821.38, 4837.93, 4780.81, 4830.9, 140055500.0]]}, 10: {'repl_add': 0, 'error': ['volume 0', [1424300400, 4788.4, 4841.69, 4770.17, 4833.28, 0.0]]}},
380  'Div': {0: {'repl_add': 0, 'error': ['volume 0', [1425510000, 4929.04, 4974.64, 4926.09, 4963.51, 0.0]]}, 1: {'repl_add': 0, 'error': ['volume 0', [1425423600, 4882.94, 4917.35, 4856.14, 4917.35, 0.0]]}, 2: {'repl_add': 2, 'error': ['', [1425337200, 4922.43, 4936.47, 4863.92, 4869.25, 116619800.0]]}, 3: {'repl_add': 2, 'error': ['', [1425250800, 4937.43, 4950.59, 4900.11, 4917.32, 149942900.0]]}, 4: {'repl_add': 2, 'error': ['', [1424991600, 4905.77, 4951.48, 4903.09, 4951.48, 120717900.0]]}, 5: {'repl_add': 2, 'error': ['', [1424905200, 4884.89, 4910.62, 4877.24, 4910.62, 105228900.0]]}, 6: {'repl_add': 2, 'error': ['', [1424818800, 4885.0, 4894.6, 4863.22, 4882.22, 117214700.0]]}, 7: {'repl_add': 2, 'error': ['', [1424732400, 4865.68, 4899.52, 4843.96, 4886.44, 106329800.0]]}, 8: {'repl_add': 2, 'error': ['', [1424646000, 4872.13, 4875.97, 4832.36, 4862.3, 102128000.0]]}, 9: {'repl_add': 2, 'error': ['', [1424386800, 4821.38, 4837.93, 4780.81, 4830.9, 140055500.0]]}, 10: {'repl_add': 0, 'error': ['volume 0', [1424300400, 4788.4, 4841.69, 4770.17, 4833.28, 0.0]]}}
381  }
382  app = ValidationTkHP( test )
383  app.master.title('Manual Validation')
384  app.mainloop()
385 
386  # test modified with new values of repl_add
387  print "\n== Test Output ", test
def create_one_input_xml
Fill the frame specific to xml data: Info / Fundamental.
Definition: Validation.py:234
A pure Tkinter scrollable frame that actually works!.
Definition: Validation.py:28
def valid
Check Validation is valid (all radiobuttons selected)
def valid
Check all radio buttons have been selected and update repl_add entry with _var_radiob.
Definition: Validation.py:206
Small GUI, specific for dealing with list_csv.
def popupmsg
Message indicating that some entries have not been validated.
Definition: Validation.py:312