So basically I have this python kodi which I'm running on Kodi since it's a Kodi addon.
import time
def checkPassword(path, lock=None):
expdate = "10/07/15"
datenow = time.strftime("%x")
if datenow == expdate:
return 'ERROR'
if not lock:
folderConfig = os.path.join(path, FOLDERCFG)
lock = getParam('LOCK', folderConfig)
title = GETTEXT(30069) % path.rsplit(os.sep, 1)[-1]
unlock = getText(title, hidden=True)
if not unlock:
return ''
md5 = utils.generateMD5(unlock)
match = md5 == lock
if not match:
return 'ERROR'
return md5
Basically I have a favourites folder which is locked with password, I want to show an error if the account is expired. I can preset the date from the addon myself like I did in the example, but somehow my addon is giving me an error with this code. Can you tell me what I have wrong? The problem is somewhere in the first 6 lines, since when I remove it, it works, but obviously without the date check.