Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/galaxy/tool_util/locations/__init__.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 import tempfile | |
2 from abc import ( | |
3 ABCMeta, | |
4 abstractmethod, | |
5 abstractproperty, | |
6 ) | |
7 | |
8 | |
9 class ToolLocationResolver(metaclass=ABCMeta): | |
10 """Parse a URI-like string and return a ToolSource object.""" | |
11 | |
12 @abstractproperty | |
13 def scheme(self): | |
14 """Short label for the type of location resolver and URI scheme.""" | |
15 | |
16 @abstractmethod | |
17 def get_tool_source_path(self, uri_like): | |
18 """Return a local path for the uri_like string.""" | |
19 | |
20 def _temp_path(self, uri_like): | |
21 """Create an abstraction for this so we can configure and cache later.""" | |
22 with tempfile.NamedTemporaryFile(suffix=uri_like.split("/")[-1], delete=False) as temp: | |
23 return temp.name |