From: Scott Worley Date: Sat, 13 Jun 2020 16:27:41 +0000 (-0700) Subject: Introduce types {Git,Channel}SearchPath X-Git-Tag: 2.0.0~23 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/4a82be40d532c3916b54453b9e238b09721b7994?hp=7d2c278fa53b6c76eff793b1b38d588bb4cb884d Introduce types {Git,Channel}SearchPath --- 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: