mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-19 23:20:57 +01:00
Fixed bug #941579.
This commit is contained in:
parent
2c2e21e765
commit
1638a1c796
@ -104,10 +104,13 @@ class HangmanGame:
|
|||||||
|
|
||||||
def getWord(self, dbHandler):
|
def getWord(self, dbHandler):
|
||||||
db = dbHandler.getDb()
|
db = dbHandler.getDb()
|
||||||
cur = db.cursor()
|
cursor = db.cursor()
|
||||||
cur.execute("""SELECT word FROM words ORDER BY random() LIMIT 1""")
|
cursor.execute("""SELECT word FROM words ORDER BY random() LIMIT 1""")
|
||||||
word = cur.fetchone()[0]
|
if cursor.rowcount != 0:
|
||||||
return word.lower()
|
word = cursor.fetchone()[0]
|
||||||
|
return word.lower()
|
||||||
|
else:
|
||||||
|
raise callbacks.Error, 'My words database is currently empty.'
|
||||||
|
|
||||||
def letterPositions(self, letter, word):
|
def letterPositions(self, letter, word):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user