Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123133
D7196.id26082.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D7196.id26082.diff
View Options
diff --git a/swh/lister/launchpad/lister.py b/swh/lister/launchpad/lister.py
--- a/swh/lister/launchpad/lister.py
+++ b/swh/lister/launchpad/lister.py
@@ -25,6 +25,9 @@
LaunchpadPageType = Tuple[VcsType, Collection]
+SUPPORTED_VCS_TYPES = ("git", "bzr")
+
+
@dataclass
class LaunchpadListerState:
"""State of Launchpad lister"""
@@ -76,7 +79,7 @@
}
def state_from_dict(self, d: Dict[str, Any]) -> LaunchpadListerState:
- for vcs_type in ["git", "bzr"]:
+ for vcs_type in SUPPORTED_VCS_TYPES:
key = f"{vcs_type}_date_last_modified"
date_last_modified = d.get(key)
if date_last_modified is not None:
@@ -86,7 +89,7 @@
def state_to_dict(self, state: LaunchpadListerState) -> Dict[str, Any]:
d: Dict[str, Optional[str]] = {}
- for vcs_type in ["git", "bzr"]:
+ for vcs_type in SUPPORTED_VCS_TYPES:
attribute_name = f"{vcs_type}_date_last_modified"
d[attribute_name] = None
@@ -126,7 +129,7 @@
"git": self.state.git_date_last_modified,
"bzr": self.state.bzr_date_last_modified,
}
- for vcs_type in ["git", "bzr"]:
+ for vcs_type in SUPPORTED_VCS_TYPES:
try:
result = self._page_request(
launchpad, vcs_type, self.date_last_modified[vcs_type]
@@ -145,12 +148,10 @@
"""
assert self.lister_obj.id is not None
- vcs_type, repos = page
-
- assert vcs_type in {"git", "bzr"}
-
prev_origin_url: Dict[str, Optional[str]] = {"git": None, "bzr": None}
+ vcs_type, repos = page
+
for repo in repos:
origin_url = origin(vcs_type, repo)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 11:09 PM (1 w, 6 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3233163
Attached To
D7196: lauchpad: review adaptations
Event Timeline
Log In to Comment