thread buxfix, attempt #1
This commit is contained in:
parent
049efaa26f
commit
c2804d8ac1
|
@ -106,12 +106,13 @@ class FlipdotSender(object):
|
||||||
packet = self._array2packet(imgmaptmp)
|
packet = self._array2packet(imgmaptmp)
|
||||||
self._sock.sendto(bytes(packet), (self._udphost, self._udpport))
|
self._sock.sendto(bytes(packet), (self._udphost, self._udpport))
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
if threadrunning==True: #if animation wasnt cancelled
|
if threadrunning==True: #if animation hasnt been cancelled
|
||||||
self.sendPacket(imgmap) #send packet and save last-imagemap
|
self.sendPacket(imgmap) #send packet and save last-imagemap
|
||||||
threadrunning=False
|
threadrunning=False
|
||||||
else:
|
else:
|
||||||
self.sendPacket(imgmap) #send packet and save last-imagemap
|
self.sendPacket(imgmap) #send packet and save last-imagemap
|
||||||
|
|
||||||
|
|
||||||
def sendPacket(self, imgmap):
|
def sendPacket(self, imgmap):
|
||||||
packet = self._array2packet(imgmap)
|
packet = self._array2packet(imgmap)
|
||||||
self._sock.sendto(bytes(packet), (self._udphost, self._udpport))
|
self._sock.sendto(bytes(packet), (self._udphost, self._udpport))
|
||||||
|
@ -177,7 +178,6 @@ class FlipdotSender(object):
|
||||||
draw.text((0,-1), text[0:splitpoint], font=font, fill=FlipdotSender.C_WHITE)
|
draw.text((0,-1), text[0:splitpoint], font=font, fill=FlipdotSender.C_WHITE)
|
||||||
draw.text((0,-1+currentfontsize), text[splitpoint:], font=font, fill=FlipdotSender.C_WHITE)
|
draw.text((0,-1+currentfontsize), text[splitpoint:], font=font, fill=FlipdotSender.C_WHITE)
|
||||||
|
|
||||||
|
|
||||||
self._send(image,fadespeed)
|
self._send(image,fadespeed)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,14 @@ class Hangman(object):
|
||||||
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nomenliste_de.txt"
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nomenliste_de.txt"
|
||||||
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/crodict_nomen.txt"
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/crodict_nomen.txt"
|
||||||
self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nerdwords.txt"
|
self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nerdwords.txt"
|
||||||
|
#self._wordlist="./hangman/wordlists/nerdwords.txt" #<- use for local testing
|
||||||
self._gamestate=0# 0=start 1=ingame 2=lose 3=win
|
self._gamestate=0# 0=start 1=ingame 2=lose 3=win
|
||||||
self._g_word="test" #word
|
self._g_word="test" #word
|
||||||
self._g_displword="" #display word
|
self._g_displword="" #display word
|
||||||
self._g_chars="" #used characters
|
self._g_chars="" #used characters
|
||||||
|
|
||||||
self._hmdir="/home/pi/mqtt-to-flipdot/hangman/stdhm/"
|
self._hmdir="/home/pi/mqtt-to-flipdot/hangman/stdhm/"
|
||||||
|
#self._hmdir="./hangman/stdhm/" #<- use for local testing
|
||||||
|
|
||||||
self._hmimg=[]
|
self._hmimg=[]
|
||||||
self._maxfails=len( os.listdir(self._hmdir))-1 -1 #maxfails defined by files in directory, -1 -1 because win image
|
self._maxfails=len( os.listdir(self._hmdir))-1 -1 #maxfails defined by files in directory, -1 -1 because win image
|
||||||
|
|
Loading…
Reference in New Issue