modified: interface/ri_tk.py
modified: interface/ri_tk_cmd.py
This commit is contained in:
@@ -105,13 +105,16 @@ def create_widget_sub(w, p_win):
|
||||
tk_func = getattr(Tkinter, w.tp)
|
||||
w_win = tk_func(p_win, tk_attr)
|
||||
|
||||
# save tk widget instance into w (widget instance)
|
||||
setattr(w, 'tk_widget', w_win)
|
||||
|
||||
# display sub widgets
|
||||
for sub_w in w.widgets:
|
||||
create_widget_sub(sub_w, w_win)
|
||||
|
||||
# process action init
|
||||
if 'action' in dir(w) and 'init' in w.action.dict:
|
||||
getattr(sys.modules['ri_cmd'], w.action.dict['init'])(w_win)
|
||||
getattr(sys.modules['ri_cmd'], w.action.dict['init'])()
|
||||
|
||||
# handle scroll bar for sub_widgets
|
||||
if 'action' in dir(w):
|
||||
@@ -143,8 +146,6 @@ def create_widget_sub(w, p_win):
|
||||
for bd in w.bindings:
|
||||
w_win.bind(bd[0], getattr(ri_cmd, bd[1]))
|
||||
|
||||
# save tk widget instance into w (widget instance)
|
||||
setattr(w, 'tk_widget', w_win)
|
||||
|
||||
return w_win
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ import re
|
||||
import copy
|
||||
import sys
|
||||
|
||||
def serial_no_init(w=''):
|
||||
def serial_no_init():
|
||||
display.var_dict['serial_no.number'].set(value=ri_data.SerialNumber.value)
|
||||
|
||||
def serial_no_quit():
|
||||
ri_data.SerialNumber.value = display.var_dict['serial_no.number'].get()
|
||||
|
||||
def mount_list_init(w=''):
|
||||
def mount_list_init():
|
||||
''' initialize mount list '''
|
||||
ri_data.MountPoint.init_from_internal()
|
||||
l = []
|
||||
@@ -34,7 +34,7 @@ def mount_list_modify(*args):
|
||||
tw = ri_widget.TopWindow.dict['mount_list_modify']
|
||||
tw.show()
|
||||
|
||||
def mp_top_init(w=''):
|
||||
def mp_top_init():
|
||||
''' mount dir top window initialize '''
|
||||
ml_win = ri_widget.Widget.dict['mount.list'].tk_widget
|
||||
idxs = ml_win.curselection()
|
||||
@@ -94,7 +94,7 @@ def mp_top_cancel():
|
||||
ri_widget.TopWindow.dict['mount_list_modify'].hide()
|
||||
pass
|
||||
|
||||
def network_init(w=''):
|
||||
def network_init():
|
||||
''' network initialize '''
|
||||
display.var_dict['network_host_name']. set(value=ri_data.Network.hostname)
|
||||
ri_widget.Widget.dict['network_config_%s' %(ri_data.Network.configuration and ri_data.Network.configuration or 'static')].tk_widget.invoke()
|
||||
@@ -150,7 +150,7 @@ class GroupCheck(GroupButton):
|
||||
if v.get() == 'yes':
|
||||
display.SoftwarePackageWindow.dict[self.name].show()
|
||||
|
||||
def software_group_mandatory_construct(w=''):
|
||||
def software_group_mandatory_construct(w):
|
||||
''' construct widgets based actual data
|
||||
w - Widget instance '''
|
||||
mdt = [ m for m in ri_data.Group.dict.values() if m.install == 'mandatory' ]
|
||||
@@ -167,7 +167,7 @@ w - Widget instance '''
|
||||
wi.attr['command'] = vn
|
||||
w.add_sub_widget(wi)
|
||||
|
||||
def software_group_optional_construct(w=''):
|
||||
def software_group_optional_construct(w):
|
||||
''' construct widgets based actual data
|
||||
w - Widget instance '''
|
||||
opt = [ o for o in ri_data.Group.dict.values() if o.install != 'mandatory' ]
|
||||
@@ -195,7 +195,7 @@ def software_group_optional_quit():
|
||||
i.install = display.var_dict[vn].get()
|
||||
print i.name, i.install
|
||||
|
||||
def dependency_list_init(w=''):
|
||||
def dependency_list_init():
|
||||
''' init function for list in dependency step '''
|
||||
func_dep_list = []
|
||||
f_dep_text = ["function dependency list"]
|
||||
@@ -216,7 +216,7 @@ def dependency_list_init(w=''):
|
||||
display.var_dict['dependency.list'].set(value=tuple(l))
|
||||
|
||||
|
||||
def service_construct(w=''):
|
||||
def service_construct(w):
|
||||
''' construct service widget based on actual data
|
||||
w - Widget instance '''
|
||||
|
||||
@@ -236,7 +236,7 @@ w - Widget instance '''
|
||||
wi.grid_location.dict['row'] = idx / int(w.grid_management.columns)
|
||||
w.add_sub_widget(wi)
|
||||
|
||||
def service_init(w=''):
|
||||
def service_init():
|
||||
''' initialize service checkboxes, based on package selection '''
|
||||
# first refresh service state
|
||||
ri_data.Service.change_state()
|
||||
@@ -254,7 +254,7 @@ def service_quit():
|
||||
vn = "service_%s" %(i.name)
|
||||
i.start = display.var_dict[vn].get()
|
||||
|
||||
def raid_raw_init(w=''):
|
||||
def raid_raw_init():
|
||||
''' initialize raid raw devices (parttion with id 'fd' '''
|
||||
global raid_raw_initialized
|
||||
if not raid_raw_initialized:
|
||||
@@ -302,7 +302,7 @@ def raid_spare_to_raw():
|
||||
''' move device from spare to raw '''
|
||||
list_to_list('raid_spare.list', 'raid_spare_devs', 'raid_raw_devs')
|
||||
|
||||
def raid_device_init(w=''):
|
||||
def raid_device_init():
|
||||
''' initialize raid device list '''
|
||||
raid_devs = [ r.device for r in ri_data.Raid.list ]
|
||||
display.var_dict['raid_devs'].set(value=tuple(raid_devs))
|
||||
@@ -376,8 +376,9 @@ def raid_device_list_detail(*args):
|
||||
|
||||
raid_raw_initialized = False
|
||||
|
||||
def install_information_init(w=''):
|
||||
def install_information_init():
|
||||
'''install information initialize'''
|
||||
ins_info = ri_data.install_information()
|
||||
w.insert(1.0,ins_info)
|
||||
t= ri_widget.Widget.dict['install_information.list'].tk_widget
|
||||
t.insert(1.0,ins_info)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user