# HG changeset patch # User gga # Date 1566378542 14400 # Node ID 6512156f6a172da5bf11a6fdaea1853ade4a87db # Parent e79da6f1f0daa675cde96dfb757db32097b72e94 "planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f" diff -r e79da6f1f0da -r 6512156f6a17 chado.py --- a/chado.py Thu Jul 11 08:36:03 2019 -0400 +++ b/chado.py Wed Aug 21 05:09:02 2019 -0400 @@ -389,7 +389,8 @@ os.environ['GALAXY_CHADO_DBPASS'], os.environ['GALAXY_CHADO_DBSCHEMA'], os.environ['GALAXY_CHADO_DBPORT'], - no_reflect=True + no_reflect=True, + pool_connections=False ) @@ -474,3 +475,43 @@ for an in ci.analysis.get_analyses(): ans_data.append((an['name'], str(an['analysis_id']), False)) return ans_data + + +def list_dbs(*args, **kwargs): + + ci = _get_instance() + + # Key for cached data + cacheKey = 'dbs' + # We don't want to trust "if key in cache" because between asking and fetch + # it might through key error. + if cacheKey not in cache: + # However if it ISN'T there, we know we're safe to fetch + put in + # there. + + data = _list_dbs(ci, *args, **kwargs) + cache[cacheKey] = data + ci.session.close() + return data + try: + # The cache key may or may not be in the cache at this point, it + # /likely/ is. However we take no chances that it wasn't evicted between + # when we checked above and now, so we reference the object from the + # cache in preparation to return. + data = cache[cacheKey] + ci.session.close() + return data + except KeyError: + # If access fails due to eviction, we will fail over and can ensure that + # data is inserted. + data = _list_dbs(ci, *args, **kwargs) + cache[cacheKey] = data + ci.session.close() + return data + + +def _list_dbs(ci, *args, **kwargs): + dbs_data = [] + for db in ci.load._get_dbs(): + dbs_data.append((db['name'], str(db['db_id']), False)) + return dbs_data diff -r e79da6f1f0da -r 6512156f6a17 macros.xml --- a/macros.xml Thu Jul 11 08:36:03 2019 -0400 +++ b/macros.xml Wed Aug 21 05:09:02 2019 -0400 @@ -2,7 +2,7 @@ - python-chado + python-chado jq postgresql pglite @@ -10,6 +10,8 @@ + 2.3.0 + @LIB_VERSION@ 11.2 @@ -20,8 +22,6 @@ - 2.2.6 - diff -r e79da6f1f0da -r 6512156f6a17 organism_add_organism.xml --- a/organism_add_organism.xml Thu Jul 11 08:36:03 2019 -0400 +++ b/organism_add_organism.xml Wed Aug 21 05:09:02 2019 -0400 @@ -1,5 +1,5 @@ - + macros.xml