]> git.scottworley.com Git - pinch/commitdiff
Introduce types {Git,Channel}SearchPath
authorScott Worley <scottworley@scottworley.com>
Sat, 13 Jun 2020 16:27:41 +0000 (09:27 -0700)
committerScott Worley <scottworley@scottworley.com>
Thu, 18 Jun 2020 06:11:59 +0000 (23:11 -0700)
pinch.py

index 662b425286b87a8c1ac25ac7ee318e26ca2ee466..b76c8da36db18e4b608fad64c5e4bbd422b8c948 100644 (file)
--- 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: