61 lines
1.3 KiB
Python
61 lines
1.3 KiB
Python
#!/usr/bin/python
|
|
|
|
import ri_widget
|
|
import ri_tk
|
|
import ri_data
|
|
|
|
import sys
|
|
import getopt
|
|
from xml.dom import minidom
|
|
import os.path
|
|
|
|
def print_usages():
|
|
print 'Usages: %s [-b|--begin step_name] [interface_xml_file] [install_xml_file]' %sys.argv[0]
|
|
|
|
try:
|
|
opts, args = getopt.getopt(sys.argv[1:], "b:", ["begin=",])
|
|
except getopt.GetoptError:
|
|
print_usages()
|
|
sys.exit(1)
|
|
|
|
begin_step=None
|
|
for opt, arg in opts:
|
|
if opt in ('-b', '--begin'):
|
|
begin_step = arg
|
|
|
|
if len(args) == 0:
|
|
itf_xml = "../xml/interface_t.xml"
|
|
ins_xml = "../xml/install.xml"
|
|
elif len(args) == 1:
|
|
itf_xml = args[0]
|
|
ins_xml = "../xml/install.xml"
|
|
else:
|
|
itf_xml = args[0]
|
|
ins_xml = args[1]
|
|
|
|
xmldoc = minidom.parse(itf_xml)
|
|
ri_data.install_xml = ins_xml
|
|
|
|
if os.path.isfile(ins_xml):
|
|
ri_data.init_from_xml()
|
|
else:
|
|
ri_data.init()
|
|
|
|
ri_widget.construct(xmldoc.firstChild)
|
|
|
|
base_widget_name = xmldoc.firstChild.attributes["base_widget"].value
|
|
ri_widget.init_display(base_widget_name)
|
|
|
|
main_sequence_name = xmldoc.firstChild.attributes["sequence"].value
|
|
ri_widget.Sequence.set_current_sequence(main_sequence_name)
|
|
main_sequence = ri_widget.Sequence.dict[main_sequence_name]
|
|
|
|
if begin_step is None:
|
|
begin_step = main_sequence.steps[0]
|
|
else:
|
|
main_sequence.set_current_step(begin_step)
|
|
|
|
ri_widget.Widget.dict[begin_step].show()
|
|
|
|
ri_widget.mainloop()
|