Fixed the fact that fucking python3 doesn't allow you assign in a statement. Why tho?
This commit is contained in:
parent
9207c371d7
commit
c886bce075
18
kong.py
18
kong.py
|
|
@ -38,7 +38,8 @@ class SongThread(threading.Thread):
|
|||
|
||||
#Navigate to song start
|
||||
if not playing:
|
||||
if m = patterns['start'].match(line):
|
||||
m = patterns['start'].match(line)
|
||||
if m:
|
||||
if m.group(1) == this.song_name:
|
||||
playing = True
|
||||
continue
|
||||
|
|
@ -46,19 +47,23 @@ class SongThread(threading.Thread):
|
|||
#Play loop
|
||||
else:
|
||||
#Config
|
||||
if m = patterns['time'].match(line):
|
||||
m = patterns['time'].match(line)
|
||||
if m:
|
||||
this.delay = int(m.group(1))
|
||||
continue
|
||||
|
||||
#Rest line
|
||||
elif m = patterns['rest'].match(line):
|
||||
m = patterns['rest'].match(line)
|
||||
if m:
|
||||
sleep(this.delay / 1000)
|
||||
continue
|
||||
|
||||
#End song
|
||||
elif m = patterns['end'].match(line):
|
||||
m = patterns['end'].match(line)
|
||||
if m:
|
||||
return
|
||||
|
||||
#"sing" line
|
||||
else:
|
||||
replycallback(line)
|
||||
sleep(this.delay / 1000)
|
||||
|
||||
|
|
@ -68,7 +73,8 @@ class SongThread(threading.Thread):
|
|||
def getAllTitles():
|
||||
titles = []
|
||||
for line in lyric_lines:
|
||||
if m = patterns['start'].match(line):
|
||||
m = patterns['start'].match(line)
|
||||
if m:
|
||||
titles += [m.group(1)]
|
||||
|
||||
return titles
|
||||
|
|
|
|||
Loading…
Reference in New Issue