modified: ri_data.py

modified:   ri_tk.py
	modified:   ri_tk_cmd.py
    fix:
    raid.get_size() return string
    during destory widget instance, delete variables in ri_tk.var_dict
This commit is contained in:
fling
2010-10-19 18:10:47 +08:00
parent a4ed7fc27f
commit f97703aa6c
3 changed files with 9 additions and 5 deletions

View File

@@ -300,9 +300,9 @@ p_node - xml node (parent node) '''
''' calculate raid device size '''
rd = Raid.dict[dev]
sz = min([ float(Partition.dict[d].size) for d in rd.active_components])
if rd.level == '0': return sz*len(rd.active_components)
elif rd.level == '1': return sz*len(rd.active_components)/2
elif rd.level == '5': return sz*(len(rd.active_components)-1)
if rd.level == '0': return str(sz*len(rd.active_components))
elif rd.level == '1': return str(sz*len(rd.active_components)/2)
elif rd.level == '5': return str(sz*(len(rd.active_components)-1))
@staticmethod
def get_next_device():

View File

@@ -159,10 +159,14 @@ def process_action_quit(w):
if 'action' in dir(w) and 'quit' in w.action.dict:
getattr(sys.modules['ri_cmd'], w.action.dict['quit'])()
if 'variables' in dir(w):
for v_n, v_t, v_v in w.variables:
del var_dict[v_n]
if 'widgets' in dir(w):
for sub_w in w.widgets:
process_action_quit(sub_w)
def destroy_widget(w):
''' w - Widget instance '''
process_action_quit(w)

View File

@@ -76,7 +76,7 @@ def mp_top_ok():
# if format, use the filesystem just set
idx2 = int(idxs2[0])
fs = eval(display.var_dict['mp_top_fs'].get())[idx2]
elif fm == 'no' and dev in ri_data.Partition.dict.keys():
elif dev in ri_data.Partition.dict.keys():
# else use the filesystem in Partition
fs = ri_data.Partition.dict[dev].filesystem
else: