Limit text length

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-21 16:03:45 +01:00
parent e3ae8f497a
commit a129db3e83

View file

@ -7,7 +7,12 @@ def addLyrics(text, ref = 0, db = dbtools.dbHelper()):
def queryLyrics(ref = 0):
text = input("Text: ")
ref = int(input("Reference [%i]: " % ref) or 0)
if len(text) > 130:
print("Text too long (%i characters)" % len(text))
return queryLyrics(ref)
ref = int(input("Reference [%i]: " % ref) or ref)
row = addLyrics(text, ref)