def dataSources():
 dsn = create_buffer(1024)
 desc = create_buffer(1024)
 dsn_len = c_short()
 desc_len = c_short()
 dsn_list = {}
 try:
  lock.acquire()
  if (shared_env_h is None):
   AllocateEnv()
 finally:
  lock.release()
 while 1:
  ret = ODBC_API.SQLDataSources(shared_env_h, SQL_FETCH_NEXT, dsn, len(dsn), ADDR(dsn_len), desc, len(desc), ADDR(desc_len))
  if (ret == SQL_NO_DATA_FOUND):
   break
  elif (not (ret in (SQL_SUCCESS, SQL_SUCCESS_WITH_INFO))):
   ctrl_err(SQL_HANDLE_ENV, shared_env_h, ret)
  else:
   dsn_list[dsn.value] = desc.value
 return dsn_list

def dataSources ( ) : dsn = create_buffer ( 1024 ) desc = create_buffer ( 1024 ) dsn_len = c_short ( ) desc_len = c_short ( ) dsn_list = { } try : lock . acquire ( ) if ( shared_env_h is None ) : AllocateEnv ( ) finally : lock . release ( ) while 1 : ret = ODBC_API . SQLDataSources ( shared_env_h , SQL_FETCH_NEXT , dsn , len ( dsn ) , ADDR ( dsn_len ) , desc , len ( desc ) , ADDR ( desc_len ) ) if ( ret == SQL_NO_DATA_FOUND ) : break elif ( not ( ret in ( SQL_SUCCESS , SQL_SUCCESS_WITH_INFO ) ) ) : ctrl_err ( SQL_HANDLE_ENV , shared_env_h , ret ) else : dsn_list [ dsn . value ] = desc . value return dsn_list
return a list with [name .