Allow overridding dest_file

This commit is contained in:
Mathieu Comandon 2020-10-30 23:53:40 -07:00
parent 9b47c086cc
commit 9c09513935

View file

@ -15,6 +15,7 @@ class InstallerFile:
self.game_slug = game_slug
self.id = file_id.replace("-", "_") # pylint: disable=invalid-name
self._file_meta = file_meta
self._dest_file = None # Used to override the destination
@property
def url(self):
@ -55,8 +56,14 @@ class InstallerFile:
@property
def dest_file(self):
if self._dest_file:
return self._dest_file
return os.path.join(self.cache_path, self.filename)
@dest_file.setter
def dest_file(self, value):
self._dest_file = value
def __str__(self):
return "%s/%s" % (self.game_slug, self.id)