def __init__(self, expirationMinutes): self.expirationMinutes = expirationMinutes self.cache = {} self.validUntil = datetime.now( timezone('UTC')) + timedelta(minutes=self.expirationMinutes) self.logger = logging.getLogger(__class__.__name__) self.db = Database(variables['db']) self.cryptor = Fernet(Fernet.generate_key())
def __init__(self, **kwargs): super(JsonFileStorageAdapter, self).__init__(**kwargs) warnings.warn( 'The JsonFileStorageAdapter is not recommended for production application environments.', self.UnsuitableForProductionWarning) database_path = self.kwargs.get("database", "database.db") self.database = Database(database_path)
def __init__(self, **kwargs): super(JsonFileStorageAdapter, self).__init__(**kwargs) if not kwargs.get('silence_performance_warning', False): warnings.warn( 'The JsonFileStorageAdapter is not recommended for production application environments.', self.UnsuitableForProductionWarning) database_path = self.kwargs.get('database', 'database.db') self.database = Database(database_path)
def __init__(self, **kwargs): super(JsonFileStorageAdapter, self).__init__(**kwargs) from jsondb import Database # if not kwargs.get('silence_performance_warning', False): # warnings.warn( # 'The JsonFileStorageAdapter is not recommended for production environments.', # self.UnsuitableForProductionWarning # ) database_path = self.kwargs.get('database', 'database.db') self.database = Database(database_path) self.adapter_supports_queries = False
def __init__(self, **kwargs): super(JsonFileStorageAdapter, self).__init__(**kwargs) from jsondb import Database if not kwargs.get('silence_performance_warning', False): warnings.warn( 'The JsonFileStorageAdapter is not recommended for production environments.', self.UnsuitableForProductionWarning) warnings.warn( 'The JsonFileStorageAdapter is deprecated and ' 'will be removed in ChatterBot version 0.8.', DeprecationWarning) database_path = self.kwargs.get('database', 'database.db') self.database = Database(database_path) self.adapter_supports_queries = False
def __init__(self, **kwargs): super(JsonFileStorageAdapter, self).__init__(**kwargs) database_path = self.kwargs.get('database', 'database.db') self.database = Database(database_path)
def __init__(self): self.db = Database(variables['db'])
def __init__(self, **kwargs): super(JsonDatabaseAdapter, self).__init__(**kwargs) database_path = self.kwargs.get("database", "database.db") self.database = Database(database_path)
import json from jsondb import Database from ldap3 import Tls, NTLM, Connection, Server, SUBTREE, MODIFY_REPLACE from slackclient import SlackClient # =============== file = open("src/config.json") variables = json.loads(file.read()) # =============== SLACK_BOT_TOKEN = variables['SLACK_BOT_TOKEN'] # slack_db = "src/" + variables['slack_db'] # slack db users db = Database(slack_db) sc = SlackClient(SLACK_BOT_TOKEN) # =============== def disconnect(): """ Force to disconnect the ldap connection with the server. """ pass def conx(domain, user, passwd): """