#NEWLINE# def getOpenIDStore( filestore_path , table_prefix ) : #NEWLINE# #INDENT# '\n    Returns an OpenID association store object based on the database\n    engine chosen for this Django application.\n\n    * If no database engine is chosen, a filesystem-based store will\n      be used whose path is filestore_path.\n\n    * If a database engine is chosen, a store object for that database\n      type will be returned.\n\n    * If the chosen engine is not supported by the OpenID library,\n      raise ImproperlyConfigured.\n\n    * If a database store is used, this will create the tables\n      necessary to use it.  The table names will be prefixed with\n      table_prefix.  DO NOT use the same table prefix for both an\n      OpenID consumer and an OpenID server in the same database.\n\n    The result of this function should be passed to the Consumer\n    constructor as the store parameter.\n    ' #NEWLINE# db_engine = settings . DATABASES [ 'default' ] [ 'ENGINE' ] #NEWLINE# if ( not db_engine ) : #NEWLINE# #INDENT# return FileOpenIDStore ( filestore_path ) #NEWLINE# #UNINDENT# connection . cursor ( ) #NEWLINE# tablenames = { #NEWLINE# #INDENT# 'associations_table' : ( table_prefix + 'openid_associations' ) , #NEWLINE# 'nonces_table' : ( table_prefix + 'openid_nonces' ) , #NEWLINE# #UNINDENT# } #NEWLINE# types = { #NEWLINE# #INDENT# 'django.db.backends.postgresql_psycopg2' : sqlstore . PostgreSQLStore , #NEWLINE# 'django.db.backends.mysql' : sqlstore . MySQLStore , #NEWLINE# 'django.db.backends.sqlite3' : sqlstore . SQLiteStore , #NEWLINE# #UNINDENT# } #NEWLINE# if ( db_engine not in types ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ( 'Database engine %s not supported by OpenID library' % db_engine ) ) #NEWLINE# #UNINDENT# s = types [ db_engine ] ( connection . connection , ** filestore_path ) #NEWLINE# try : #NEWLINE# #INDENT# s . createTables ( ) #NEWLINE# #UNINDENT# except ( SystemExit , KeyboardInterrupt , MemoryError ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return s