Skip to content

Commit

Permalink
mink: few more refactoring and doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mokko committed Jun 8, 2024
1 parent df90ea9 commit a3e30ec
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/mpapi/mink.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ def getPack(
"""
Download object and related information (attachment, media, people), join data
together and clean it.
mink's dsl
getPack group 123 MyLabel [since]
"""
if label is None:
label = ""
Expand Down Expand Up @@ -276,17 +273,18 @@ def _getPart(
else:
# print (f"GH TYPE {Type}")
self.info(f" {module} from remote, saving to {fn}")
if Type == "approval":
m = self.sar.getByApprovalGrp(Id=Id, module=module, since=since)
elif Type == "exhibit":
# print ("***GH Exhibit")
m = self.sar.getByExhibit(Id=Id, module=module, since=since)
elif Type == "group":
m = self.sar.getByGroup(Id=Id, module=module, since=since)
elif Type == "loc":
m = self.sar.getByLocation(Id=Id, module=module, since=since)
else:
raise TypeError("UNKNOWN type")
match Type:
case "approval":
m = self.sar.getByApprovalGrp(Id=Id, module=module, since=since)
case "exhibit":
# print ("***GH Exhibit")
m = self.sar.getByExhibit(Id=Id, module=module, since=since)
case "group":
m = self.sar.getByGroup(Id=Id, module=module, since=since)
case "loc":
m = self.sar.getByLocation(Id=Id, module=module, since=since)
case _:
raise TypeError("UNKNOWN type")
m.toFile(path=fn)
return m

Expand Down

0 comments on commit a3e30ec

Please sign in to comment.