merge ri_seq into ri_widget
change image file location in interface.xml, and change python file to use relative file location for it.
This commit is contained in:
56
python/test.py
Normal file
56
python/test.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import ri_widget
|
||||
import ri_tk
|
||||
import ri_data
|
||||
|
||||
import sys
|
||||
import getopt
|
||||
from xml.dom import minidom
|
||||
|
||||
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
|
||||
ri_data.init_from_xml()
|
||||
#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_step(begin_step)
|
||||
|
||||
ri_widget.Widget.dict[begin_step].show()
|
||||
|
||||
ri_widget.mainloop()
|
||||
Reference in New Issue
Block a user