# HG changeset patch # User Sylvain Thénault # Date 1450426220 -3600 # Node ID 780939fc06da7616bd54565eba5a482f460973b1 # Parent c1fdd22232d11f13f8f2d2eb24e7128465369b00 [server] fix name and add docstring to connection initialization functions diff -r c1fdd22232d1 -r 780939fc06da server/sqlutils.py --- a/server/sqlutils.py Fri Dec 18 09:07:33 2015 +0100 +++ b/server/sqlutils.py Fri Dec 18 09:10:20 2015 +0100 @@ -522,7 +522,8 @@ QuerierHelper._sqlite_patched = True -def init_sqlite_connexion(cnx): +def _init_sqlite_connection(cnx): + """Internal function that will be called to init a sqlite connection""" _install_sqlite_querier_patch() class group_concat(object): @@ -570,14 +571,15 @@ yams.constraints.patch_sqlite_decimal() sqlite_hooks = SQL_CONNECT_HOOKS.setdefault('sqlite', []) -sqlite_hooks.append(init_sqlite_connexion) +sqlite_hooks.append(_init_sqlite_connection) -def init_postgres_connexion(cnx): +def _init_postgres_connection(cnx): + """Internal function that will be called to init a postgresql connection""" cnx.cursor().execute('SET TIME ZONE UTC') # commit is needed, else setting are lost if the connection is first # rolled back cnx.commit() postgres_hooks = SQL_CONNECT_HOOKS.setdefault('postgres', []) -postgres_hooks.append(init_postgres_connexion) +postgres_hooks.append(_init_postgres_connection)