Skip to content

Commit

Permalink
Merge pull request #16 from synkd/add_manifest_name_attribute
Browse files Browse the repository at this point in the history
Add manifest filename as attribute
  • Loading branch information
synkd authored Nov 3, 2022
2 parents 9d4cfda + ac82e3b commit 3b14c56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, manifest_category, allocation_name=None, **kwargs):
self.allocation_name = allocation_name or "".join(
random.sample(string.ascii_letters, 10)
)
self.manifest_name = Path(f'{self.allocation_name}_manifest.zip')
self.offline_token = kwargs.get("offline_token", self.manifest_data.offline_token)
self.subscription_data = self.manifest_data.subscription_data
self.token_request_data = {
Expand Down Expand Up @@ -306,7 +307,7 @@ def trigger_manifest_export(self):
"proxies": self.manifest_data.get("proxies", settings.proxies),
}
# Should this use the XDG Base Directory Specification?
local_file = Path(f"manifests/{self.allocation_name}_manifest.zip")
local_file = Path(f"manifests/{self.manifest_name}")
local_file.parent.mkdir(parents=True, exist_ok=True)
logger.info(
f"Triggering manifest export job for subscription allocation {self.allocation_name}"
Expand Down Expand Up @@ -362,6 +363,7 @@ def trigger_manifest_export(self):
)
local_file.write_bytes(manifest.content)
manifest.path = local_file
manifest.name = self.manifest_name
return manifest

def get_manifest(self):
Expand Down

0 comments on commit 3b14c56

Please sign in to comment.