Mercurial > repos > gga > chado_load_interpro
annotate chado.py @ 0:0805e7b3254d draft
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
| author | gga | 
|---|---|
| date | Wed, 21 Aug 2019 05:07:40 -0400 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 
0
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
1 import collections | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
2 import os | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
3 import time | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
4 from abc import abstractmethod | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
5 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
6 import chado | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
7 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
8 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
9 ############################################# | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
10 # BEGIN IMPORT OF CACHING LIBRARY # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
11 ############################################# | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
12 # This code is licensed under the MIT # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
13 # License and is a copy of code publicly # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
14 # available in rev. # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
15 # e27332bc82f4e327aedaec17c9b656ae719322ed # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
16 # of https://github.com/tkem/cachetools/ # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
17 ############################################# | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
18 class DefaultMapping(collections.MutableMapping): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
19 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
20 __slots__ = () | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
21 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
22 @abstractmethod | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
23 def __contains__(self, key): # pragma: nocover | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
24 return False | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
25 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
26 @abstractmethod | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
27 def __getitem__(self, key): # pragma: nocover | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
28 if hasattr(self.__class__, '__missing__'): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
29 return self.__class__.__missing__(self, key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
30 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
31 raise KeyError(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
32 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
33 def get(self, key, default=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
34 if key in self: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
35 return self[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
36 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
37 return default | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
38 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
39 __marker = object() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
40 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
41 def pop(self, key, default=__marker): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
42 if key in self: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
43 value = self[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
44 del self[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
45 elif default is self.__marker: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
46 raise KeyError(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
47 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
48 value = default | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
49 return value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
50 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
51 def setdefault(self, key, default=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
52 if key in self: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
53 value = self[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
54 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
55 self[key] = value = default | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
56 return value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
57 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
58 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
59 DefaultMapping.register(dict) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
60 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
61 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
62 class _DefaultSize(object): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
63 def __getitem__(self, _): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
64 return 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
65 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
66 def __setitem__(self, _, value): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
67 assert value == 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
68 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
69 def pop(self, _): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
70 return 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
71 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
72 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
73 class Cache(DefaultMapping): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
74 """Mutable mapping to serve as a simple cache or cache base class.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
75 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
76 __size = _DefaultSize() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
77 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
78 def __init__(self, maxsize, missing=None, getsizeof=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
79 if missing: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
80 self.__missing = missing | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
81 if getsizeof: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
82 self.__getsizeof = getsizeof | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
83 self.__size = dict() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
84 self.__data = dict() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
85 self.__currsize = 0 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
86 self.__maxsize = maxsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
87 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
88 def __repr__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
89 return '%s(%r, maxsize=%r, currsize=%r)' % ( | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
90 self.__class__.__name__, | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
91 list(self.__data.items()), | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
92 self.__maxsize, | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
93 self.__currsize, | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
94 ) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
95 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
96 def __getitem__(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
97 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
98 return self.__data[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
99 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
100 return self.__missing__(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
101 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
102 def __setitem__(self, key, value): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
103 maxsize = self.__maxsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
104 size = self.getsizeof(value) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
105 if size > maxsize: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
106 raise ValueError('value too large') | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
107 if key not in self.__data or self.__size[key] < size: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
108 while self.__currsize + size > maxsize: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
109 self.popitem() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
110 if key in self.__data: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
111 diffsize = size - self.__size[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
112 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
113 diffsize = size | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
114 self.__data[key] = value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
115 self.__size[key] = size | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
116 self.__currsize += diffsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
117 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
118 def __delitem__(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
119 size = self.__size.pop(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
120 del self.__data[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
121 self.__currsize -= size | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
122 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
123 def __contains__(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
124 return key in self.__data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
125 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
126 def __missing__(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
127 value = self.__missing(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
128 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
129 self.__setitem__(key, value) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
130 except ValueError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
131 pass # value too large | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
132 return value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
133 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
134 def __iter__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
135 return iter(self.__data) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
136 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
137 def __len__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
138 return len(self.__data) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
139 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
140 @staticmethod | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
141 def __getsizeof(value): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
142 return 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
143 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
144 @staticmethod | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
145 def __missing(key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
146 raise KeyError(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
147 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
148 @property | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
149 def maxsize(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
150 """The maximum size of the cache.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
151 return self.__maxsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
152 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
153 @property | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
154 def currsize(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
155 """The current size of the cache.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
156 return self.__currsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
157 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
158 def getsizeof(self, value): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
159 """Return the size of a cache element's value.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
160 return self.__getsizeof(value) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
161 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
162 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
163 class _Link(object): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
164 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
165 __slots__ = ('key', 'expire', 'next', 'prev') | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
166 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
167 def __init__(self, key=None, expire=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
168 self.key = key | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
169 self.expire = expire | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
170 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
171 def __reduce__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
172 return _Link, (self.key, self.expire) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
173 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
174 def unlink(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
175 next = self.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
176 prev = self.prev | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
177 prev.next = next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
178 next.prev = prev | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
179 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
180 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
181 class _Timer(object): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
182 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
183 def __init__(self, timer): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
184 self.__timer = timer | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
185 self.__nesting = 0 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
186 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
187 def __call__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
188 if self.__nesting == 0: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
189 return self.__timer() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
190 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
191 return self.__time | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
192 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
193 def __enter__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
194 if self.__nesting == 0: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
195 self.__time = time = self.__timer() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
196 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
197 time = self.__time | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
198 self.__nesting += 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
199 return time | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
200 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
201 def __exit__(self, *exc): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
202 self.__nesting -= 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
203 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
204 def __reduce__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
205 return _Timer, (self.__timer,) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
206 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
207 def __getattr__(self, name): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
208 return getattr(self.__timer, name) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
209 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
210 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
211 class TTLCache(Cache): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
212 """LRU Cache implementation with per-item time-to-live (TTL) value.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
213 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
214 def __init__(self, maxsize, ttl, timer=time.time, missing=None, | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
215 getsizeof=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
216 Cache.__init__(self, maxsize, missing, getsizeof) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
217 self.__root = root = _Link() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
218 root.prev = root.next = root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
219 self.__links = collections.OrderedDict() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
220 self.__timer = _Timer(timer) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
221 self.__ttl = ttl | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
222 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
223 def __contains__(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
224 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
225 link = self.__links[key] # no reordering | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
226 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
227 return False | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
228 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
229 return not (link.expire < self.__timer()) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
230 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
231 def __getitem__(self, key, cache_getitem=Cache.__getitem__): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
232 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
233 link = self.__getlink(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
234 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
235 expired = False | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
236 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
237 expired = link.expire < self.__timer() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
238 if expired: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
239 return self.__missing__(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
240 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
241 return cache_getitem(self, key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
242 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
243 def __setitem__(self, key, value, cache_setitem=Cache.__setitem__): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
244 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
245 self.expire(time) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
246 cache_setitem(self, key, value) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
247 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
248 link = self.__getlink(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
249 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
250 self.__links[key] = link = _Link(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
251 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
252 link.unlink() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
253 link.expire = time + self.__ttl | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
254 link.next = root = self.__root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
255 link.prev = prev = root.prev | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
256 prev.next = root.prev = link | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
257 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
258 def __delitem__(self, key, cache_delitem=Cache.__delitem__): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
259 cache_delitem(self, key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
260 link = self.__links.pop(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
261 link.unlink() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
262 if link.expire < self.__timer(): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
263 raise KeyError(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
264 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
265 def __iter__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
266 root = self.__root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
267 curr = root.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
268 while curr is not root: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
269 # "freeze" time for iterator access | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
270 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
271 if not (curr.expire < time): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
272 yield curr.key | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
273 curr = curr.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
274 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
275 def __len__(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
276 root = self.__root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
277 curr = root.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
278 time = self.__timer() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
279 count = len(self.__links) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
280 while curr is not root and curr.expire < time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
281 count -= 1 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
282 curr = curr.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
283 return count | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
284 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
285 def __setstate__(self, state): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
286 self.__dict__.update(state) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
287 root = self.__root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
288 root.prev = root.next = root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
289 for link in sorted(self.__links.values(), key=lambda obj: obj.expire): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
290 link.next = root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
291 link.prev = prev = root.prev | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
292 prev.next = root.prev = link | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
293 self.expire(self.__timer()) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
294 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
295 def __repr__(self, cache_repr=Cache.__repr__): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
296 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
297 self.expire(time) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
298 return cache_repr(self) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
299 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
300 @property | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
301 def currsize(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
302 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
303 self.expire(time) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
304 return super(TTLCache, self).currsize | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
305 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
306 @property | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
307 def timer(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
308 """The timer function used by the cache.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
309 return self.__timer | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
310 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
311 @property | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
312 def ttl(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
313 """The time-to-live value of the cache's items.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
314 return self.__ttl | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
315 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
316 def expire(self, time=None): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
317 """Remove expired items from the cache.""" | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
318 if time is None: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
319 time = self.__timer() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
320 root = self.__root | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
321 curr = root.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
322 links = self.__links | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
323 cache_delitem = Cache.__delitem__ | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
324 while curr is not root and curr.expire < time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
325 cache_delitem(self, curr.key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
326 del links[curr.key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
327 next = curr.next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
328 curr.unlink() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
329 curr = next | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
330 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
331 def clear(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
332 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
333 self.expire(time) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
334 Cache.clear(self) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
335 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
336 def get(self, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
337 with self.__timer: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
338 return Cache.get(self, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
339 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
340 def pop(self, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
341 with self.__timer: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
342 return Cache.pop(self, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
343 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
344 def setdefault(self, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
345 with self.__timer: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
346 return Cache.setdefault(self, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
347 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
348 def popitem(self): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
349 """Remove and return the `(key, value)` pair least recently used that | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
350 has not already expired. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
351 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
352 """ | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
353 with self.__timer as time: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
354 self.expire(time) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
355 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
356 key = next(iter(self.__links)) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
357 except StopIteration: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
358 raise KeyError('%s is empty' % self.__class__.__name__) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
359 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
360 return (key, self.pop(key)) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
361 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
362 if hasattr(collections.OrderedDict, 'move_to_end'): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
363 def __getlink(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
364 value = self.__links[key] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
365 self.__links.move_to_end(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
366 return value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
367 else: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
368 def __getlink(self, key): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
369 value = self.__links.pop(key) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
370 self.__links[key] = value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
371 return value | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
372 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
373 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
374 ############################################# | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
375 # END IMPORT OF CACHING LIBRARY # | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
376 ############################################# | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
377 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
378 cache = TTLCache( | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
379 100, # Up to 100 items | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
380 1 * 60 # 5 minute cache life | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
381 ) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
382 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
383 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
384 def _get_instance(): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
385 return chado.ChadoInstance( | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
386 os.environ['GALAXY_CHADO_DBHOST'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
387 os.environ['GALAXY_CHADO_DBNAME'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
388 os.environ['GALAXY_CHADO_DBUSER'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
389 os.environ['GALAXY_CHADO_DBPASS'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
390 os.environ['GALAXY_CHADO_DBSCHEMA'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
391 os.environ['GALAXY_CHADO_DBPORT'], | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
392 no_reflect=True, | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
393 pool_connections=False | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
394 ) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
395 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
396 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
397 def list_organisms(*args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
398 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
399 ci = _get_instance() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
400 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
401 # Key for cached data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
402 cacheKey = 'orgs' | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
403 # We don't want to trust "if key in cache" because between asking and fetch | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
404 # it might through key error. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
405 if cacheKey not in cache: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
406 # However if it ISN'T there, we know we're safe to fetch + put in | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
407 # there. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
408 data = _list_organisms(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
409 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
410 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
411 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
412 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
413 # The cache key may or may not be in the cache at this point, it | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
414 # /likely/ is. However we take no chances that it wasn't evicted between | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
415 # when we checked above and now, so we reference the object from the | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
416 # cache in preparation to return. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
417 data = cache[cacheKey] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
418 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
419 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
420 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
421 # If access fails due to eviction, we will fail over and can ensure that | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
422 # data is inserted. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
423 data = _list_organisms(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
424 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
425 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
426 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
427 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
428 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
429 def _list_organisms(ci, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
430 # Fetch the orgs. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
431 orgs_data = [] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
432 for org in ci.organism.get_organisms(): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
433 clean_name = '%s %s' % (org['genus'], org['species']) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
434 if 'infraspecific_name' in org and org['infraspecific_name']: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
435 clean_name += ' (%s)' % (org['infraspecific_name']) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
436 orgs_data.append((clean_name, str(org['organism_id']), False)) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
437 return orgs_data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
438 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
439 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
440 def list_analyses(*args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
441 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
442 ci = _get_instance() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
443 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
444 # Key for cached data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
445 cacheKey = 'analyses' | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
446 # We don't want to trust "if key in cache" because between asking and fetch | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
447 # it might through key error. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
448 if cacheKey not in cache: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
449 # However if it ISN'T there, we know we're safe to fetch + put in | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
450 # there.<?xml version="1.0"?> | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
451 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
452 data = _list_analyses(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
453 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
454 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
455 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
456 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
457 # The cache key may or may not be in the cache at this point, it | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
458 # /likely/ is. However we take no chances that it wasn't evicted between | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
459 # when we checked above and now, so we reference the object from the | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
460 # cache in preparation to return. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
461 data = cache[cacheKey] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
462 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
463 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
464 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
465 # If access fails due to eviction, we will fail over and can ensure that | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
466 # data is inserted. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
467 data = _list_analyses(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
468 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
469 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
470 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
471 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
472 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
473 def _list_analyses(ci, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
474 ans_data = [] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
475 for an in ci.analysis.get_analyses(): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
476 ans_data.append((an['name'], str(an['analysis_id']), False)) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
477 return ans_data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
478 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
479 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
480 def list_dbs(*args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
481 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
482 ci = _get_instance() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
483 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
484 # Key for cached data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
485 cacheKey = 'dbs' | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
486 # We don't want to trust "if key in cache" because between asking and fetch | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
487 # it might through key error. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
488 if cacheKey not in cache: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
489 # However if it ISN'T there, we know we're safe to fetch + put in | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
490 # there.<?xml version="1.0"?> | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
491 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
492 data = _list_dbs(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
493 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
494 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
495 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
496 try: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
497 # The cache key may or may not be in the cache at this point, it | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
498 # /likely/ is. However we take no chances that it wasn't evicted between | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
499 # when we checked above and now, so we reference the object from the | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
500 # cache in preparation to return. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
501 data = cache[cacheKey] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
502 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
503 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
504 except KeyError: | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
505 # If access fails due to eviction, we will fail over and can ensure that | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
506 # data is inserted. | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
507 data = _list_dbs(ci, *args, **kwargs) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
508 cache[cacheKey] = data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
509 ci.session.close() | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
510 return data | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
511 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
512 | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
513 def _list_dbs(ci, *args, **kwargs): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
514 dbs_data = [] | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
515 for db in ci.load._get_dbs(): | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
516 dbs_data.append((db['name'], str(db['db_id']), False)) | 
| 
 
0805e7b3254d
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/chado commit 1640878827bdc3870b6f34eded3a3f7571a1849f"
 
gga 
parents:  
diff
changeset
 | 
517 return dbs_data | 
