Tweaked regex
This commit is contained in:
parent
cd60394445
commit
daba1363be
11
kong.py
11
kong.py
|
|
@ -7,10 +7,10 @@ DEFAULT_SONG = "dk_rap_classic"
|
||||||
|
|
||||||
#Patterns
|
#Patterns
|
||||||
patterns = {}
|
patterns = {}
|
||||||
patterns['start'] = re.compile("^#STARTSONG (.*?)")
|
patterns['start'] = re.compile(r"#STARTSONG\a+(.*?)")
|
||||||
patterns['time'] = re.compile("^#TIMEPERLINE (\\d*)")
|
patterns['time'] = re.compile(r"#TIMEPERLINE\a+(\d*)")
|
||||||
patterns['rest'] = re.compile("^#REST")
|
patterns['rest'] = re.compile(r"#REST")
|
||||||
patterns['end'] = re.compile("^#ENDSONG")
|
patterns['end'] = re.compile(r"#ENDSONG")
|
||||||
|
|
||||||
#SongContents
|
#SongContents
|
||||||
lyric_lines = []
|
lyric_lines = []
|
||||||
|
|
@ -33,6 +33,7 @@ class SongThread(threading.Thread):
|
||||||
playing = False
|
playing = False
|
||||||
|
|
||||||
for line in lyric_lines:
|
for line in lyric_lines:
|
||||||
|
print(line)
|
||||||
if line == "":
|
if line == "":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -72,9 +73,7 @@ class SongThread(threading.Thread):
|
||||||
|
|
||||||
def getAllTitles():
|
def getAllTitles():
|
||||||
titles = []
|
titles = []
|
||||||
print(lyric_lines)
|
|
||||||
for line in lyric_lines:
|
for line in lyric_lines:
|
||||||
print(line)
|
|
||||||
m = patterns['start'].match(line)
|
m = patterns['start'].match(line)
|
||||||
if m:
|
if m:
|
||||||
titles += [m.group(1)]
|
titles += [m.group(1)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue