Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b0d0a57d24
@ -233,16 +233,47 @@ def print_cursor():
|
|||||||
print('Cursor on ' + str(index) + " out of " + str(len(metadata)) + " - " + metadata[index]['filename'])
|
print('Cursor on ' + str(index) + " out of " + str(len(metadata)) + " - " + metadata[index]['filename'])
|
||||||
|
|
||||||
|
|
||||||
|
testCommands=[]
|
||||||
|
testscriptData=[]
|
||||||
|
|
||||||
|
def test_script(argv):
|
||||||
|
try:
|
||||||
|
testscriptData.append(False)
|
||||||
|
testscriptData.append(0)
|
||||||
|
opts, args=getopt.getopt(argv,"t")
|
||||||
|
except getopt.GetoptError:
|
||||||
|
print("Error by starting test script")
|
||||||
|
sys.exit(2)
|
||||||
|
for opt, arg in opts:
|
||||||
|
if opt == '-t':
|
||||||
|
testscriptData.clear()
|
||||||
|
testscriptData.append(True)
|
||||||
|
testCommands.append("deleteall")
|
||||||
|
#testCommands.append("fetchall")
|
||||||
|
testCommands.append("trigger")
|
||||||
|
testCommands.append("trigger")
|
||||||
|
testCommands.append("fetchall")
|
||||||
|
testCommands.append("exit")
|
||||||
|
testscriptData.append(len(testCommands))
|
||||||
|
else:
|
||||||
|
testscriptData.append(False)
|
||||||
|
testscriptData.append(0)
|
||||||
|
|
||||||
|
|
||||||
# main input loop
|
# main input loop
|
||||||
command = "dummy"
|
command = "dummy"
|
||||||
|
test_script(sys.argv[1:])
|
||||||
|
i=0
|
||||||
while (command.lower() not in ["exit", "quit", "end"]):
|
while (command.lower() not in ["exit", "quit", "end"]):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if testscriptData[0] and i < testscriptData[1]:
|
||||||
|
command=testCommands[i]
|
||||||
|
i+=1
|
||||||
|
else:
|
||||||
command = input("Please enter command: ")
|
command = input("Please enter command: ")
|
||||||
except:
|
except Exception as ex:
|
||||||
print()
|
print(ex)
|
||||||
print("Error while reading keyboard input")
|
print("Error while reading keyboard input")
|
||||||
break
|
break
|
||||||
command_split = command.split(" ")
|
command_split = command.split(" ")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user