Merge branch 'master' into deploy

This commit is contained in:
interfisch 2017-10-26 23:51:28 +02:00
commit 83ca29d94e
6 changed files with 61245 additions and 10 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
hangman/wordlists/*
__pycache__/

View File

@ -23,7 +23,7 @@ class FlipdotSender(object):
def __init__(self, udphost, udpport, img_size=(80,16), font_size=9, font_size_scroll=12, def __init__(self, udphost, udpport, img_size=(80,16), font_size=9, font_size_scroll=12,
font_offset1=(0,0), font_offset2=(0,8), font_offset1=(0,0), font_offset2=(0,8),
#font_family='/usr/share/fonts/gnu-free/FreeMono.ttf', #font_family='/usr/share/fonts/gnu-free/FreeMono.ttf',
font_family='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf', font_family='/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf',
#font_family='/usr/share/fonts/truetype/freefont/FreeMono.ttf', #font_family='/usr/share/fonts/truetype/freefont/FreeMono.ttf',
chars_per_line=11): chars_per_line=11):

View File

@ -47,16 +47,18 @@ class Hangman(object):
self._fo_word= (15, -1) #(15, -1) self._fo_word= (15, -1) #(15, -1)
self._fo_word2= (15, 7) #(15,7) self._fo_word2= (15, 7) #(15,7)
#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/wordsonly.txt"
self._wordlist="/root/mqtt-to-flipdot/hangman/wordlists/wordsonly.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._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="/root/mqtt-to-flipdot/hangman/stdhm/"
#self._hmdir="./hangman/stdhm/" #<- use for local testing #self._hmdir="./hangman/stdhm/" #<- use for local testing
self._hmimg=[] self._hmimg=[]
@ -236,7 +238,7 @@ class Hangman(object):
#font = ImageFont.truetype("/usr/share/fonts/truetype/fonts-japanese-gothic.ttf", FONT_SIZE_word) #font = ImageFont.truetype("/usr/share/fonts/truetype/fonts-japanese-gothic.ttf", FONT_SIZE_word)
#font = ImageFont.truetype("hangman/alterebro-pixel-font.ttf", FONT_SIZE_word) #font = ImageFont.truetype("hangman/alterebro-pixel-font.ttf", FONT_SIZE_word)
font = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf", FONT_SIZE_word) font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf", FONT_SIZE_word)
if (self._g_gamestate!=3): if (self._g_gamestate!=3):
@ -260,9 +262,10 @@ class Hangman(object):
#for i in range(0,len(s2)): #for i in range(0,len(s2)):
# draw.text((fo_word2[0]+i*5, fo_word2[1]), s2[i], font=font, fill=C_TEXT) # draw.text((fo_word2[0]+i*5, fo_word2[1]), s2[i], font=font, fill=C_TEXT)
if (len(s1)>0):
draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT) draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT)
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT) if (len(s2)>0):
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT)
def _drawLoseScreen(self,draw): def _drawLoseScreen(self,draw):
self._drawGameScreen(draw) self._drawGameScreen(draw)

View File

@ -844,3 +844,4 @@ Arduino
Nodalpunktadapter Nodalpunktadapter
Informationslebenszyklusmanagement Informationslebenszyklusmanagement
desoxyribonukleinsaeure desoxyribonukleinsaeure
Henne

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
cd /home/pi/mqtt-to-flipdot #cd /home/pi/mqtt-to-flipdot
cd /root/mqtt-to-flipdot
#/usr/bin/python3 mqtt-to-flipdot.py #/usr/bin/python3 mqtt-to-flipdot.py
su pi -c "screen -dmS ausflippen python3 mqtt-to-flipdot.py" # su pi -c "screen -dmS ausflippen python3 mqtt-to-flipdot.py"
screen -dmS ausflippen python3 mqtt-to-flipdot.py