Hi , im trying to extend the "Input" class to add a simple folder path validator, but the code seems to be ignoring my accept and valid methods.
What am I doing wrong?
from bullet import Input, keyhandler, styles
from bullet.charDef import NEWLINE_KEY
import os.path
class FolderPathCheck(Input):
@keyhandler.register(NEWLINE_KEY)
def accept(self):
if self.valid():
return super.accept()
def valid(self, ans):
return os.path.isdir(self.ans)
Hi , im trying to extend the "Input" class to add a simple folder path validator, but the code seems to be ignoring my accept and valid methods. What am I doing wrong?
Thanks.