<s> """<STR_LIT>""" <EOL> import sys <EOL> from zope . interface import implements <EOL> from twisted import plugin <EOL> from twisted . cred . checkers import FilePasswordDB <EOL> from twisted . cred . strcred import ICheckerFactory <EOL> from twisted . cred . credentials import IUsernamePassword , IUsernameHashedPassword <EOL> fileCheckerFactoryHelp = """<STR_LIT>""" <EOL> invalidFileWarning = '<STR_LIT>' <EOL> class FileCheckerFactory ( object ) : <EOL> """<STR_LIT>""" <EOL> implements ( ICheckerFactory , plugin . IPlugin ) <EOL> authType = '<STR_LIT:file>' <EOL> authHelp = fileCheckerFactoryHelp <EOL> argStringFormat = '<STR_LIT>' <EOL> credentialInterfaces = ( IUsernamePassword , IUsernameHashedPassword ) <EOL> errorOutput = sys . stderr <EOL> def generateChecker ( self , argstring ) : <EOL> """<STR_LIT>""" <EOL> from twisted . python . filepath import FilePath <EOL> if not argstring . strip ( ) : <EOL> raise ValueError , '<STR_LIT>' % self . authType <EOL> elif not FilePath ( argstring ) . isfile ( ) : <EOL> self . errorOutput . write ( '<STR_LIT>' % ( invalidFileWarning , argstring ) ) <EOL> return FilePasswordDB ( argstring ) <EOL> theFileCheckerFactory = FileCheckerFactory ( ) </s>
