Skip to content

Commit b6b0667

Browse files
committed
Add repeat Functionality
1 parent 409af51 commit b6b0667

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

piduck.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from importlib import import_module
44
from time import sleep
55

6+
last_line = ""
67
key_layout = "us"
78
default_delay = 10
89
string_delay = 1
@@ -48,6 +49,8 @@ def pharse(line, known, deltrue):
4849
elif command[0] == "REM":
4950
return
5051
elif command[0] == "REPEAT":
52+
for i in range(6):
53+
pharse(last_line.strip(), [[], []], False)
5154
return # todo
5255
elif command[0] == "DEFAULTCHARDELAY":
5356
string_delay = int(command[1])
@@ -102,13 +105,15 @@ def out(ccl):
102105

103106

104107
def main():
108+
global last_line
105109
if piargs.input is not None:
106110
file1 = open(piargs.input, "r")
107111
while True:
108112
line = file1.readline()
109113
if not line:
110114
break
111115
pharse(line.strip(), [[], []], False)
116+
last_line = line
112117
file1.close()
113118
else:
114119
while True:

0 commit comments

Comments
 (0)