From 4a82be40d532c3916b54453b9e238b09721b7994 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 13 Jun 2020 09:27:41 -0700 Subject: [PATCH] Introduce types {Git,Channel}SearchPath --- pinch.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pinch.py b/pinch.py index 662b425..b76c8da 100644 --- a/pinch.py +++ b/pinch.py @@ -142,6 +142,14 @@ class TarrableSearchPath(SearchPath): return git_get_tarball(v, self) +class GitSearchPath(TarrableSearchPath): + pass + + +class ChannelSearchPath(TarrableSearchPath): + pass + + def compare(a: str, b: str) -> Tuple[List[str], List[str], List[str]]: def throw(error: OSError) -> None: @@ -547,7 +555,9 @@ def git_revision_name(v: Verification, channel: TarrableSearchPath) -> str: def read_search_path(conf: configparser.SectionProxy) -> SearchPath: if 'alias_of' in conf: return AliasSearchPath(**dict(conf.items())) - return TarrableSearchPath(**dict(conf.items())) + if 'channel_url' in conf: + return ChannelSearchPath(**dict(conf.items())) + return GitSearchPath(**dict(conf.items())) def read_config(filename: str) -> configparser.ConfigParser: -- 2.44.1