+from abc import ABC, abstractmethod
import argparse
import configparser
import filecmp
url: str
-class SearchPath(types.SimpleNamespace):
+class SearchPath(types.SimpleNamespace, ABC):
release_name: str
+ @abstractmethod
+ def pin(self, v: Verification, conf: configparser.SectionProxy) -> None:
+ pass
-class Channel(SearchPath):
+
+class AliasSearchPath(SearchPath):
alias_of: str
+
+ def pin(self, v: Verification, conf: configparser.SectionProxy) -> None:
+ assert not hasattr(self, 'git_repo')
+
+
+class Channel(SearchPath):
channel_html: bytes
channel_url: str
forwarded_url: str
table: Dict[str, ChannelTableEntry]
def pin(self, v: Verification, conf: configparser.SectionProxy) -> None:
- if hasattr(self, 'alias_of'):
- assert not hasattr(self, 'git_repo')
- return
-
if hasattr(self, 'git_revision'):
self.old_git_revision = self.git_revision
del self.git_revision
def read_search_path(conf: configparser.SectionProxy) -> SearchPath:
+ if 'alias_of' in conf:
+ return AliasSearchPath(**dict(conf.items()))
return Channel(**dict(conf.items()))