From 510fe63aa7bf232fcca7f2a3d0fdab2c45307b78 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 11 Jun 2009 12:46:49 +0200 Subject: add a format converter, i.e. to convert from lamedb to sat.xml files the main destination format of this converter is a sat.xml file easily extendable with further datasources --- tools/host_tools/FormatConverter/input.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/host_tools/FormatConverter/input.py (limited to 'tools/host_tools/FormatConverter/input.py') diff --git a/tools/host_tools/FormatConverter/input.py b/tools/host_tools/FormatConverter/input.py new file mode 100644 index 00000000..7a206273 --- /dev/null +++ b/tools/host_tools/FormatConverter/input.py @@ -0,0 +1,23 @@ +import sys + +def inputText(): + input = sys.stdin.readline() + return input.strip() + +def inputChoices(list, backcmd = "b", backtext = "back"): + repeat = True + while(repeat): + repeat = False + count = 0 + for item in list: + print count, "-", item + count += 1 + print backcmd, "-", backtext + input = inputText() + if input == backcmd: + return None + + action = int(input) + if action >= len(list): + repeat = True + return action \ No newline at end of file -- cgit v1.2.3