Correzione logica di esecuzione e assegnazione attributi.
This commit is contained in:
parent
b8b80ebdea
commit
7ae5ac182a
2 changed files with 36 additions and 37 deletions
|
@ -48,8 +48,23 @@ class Build(object):
|
|||
self.relative_path = []
|
||||
self.full_path = ''
|
||||
|
||||
def version_strings(self):
|
||||
"""Build version strings based on the information received."""
|
||||
def calculate(self):
|
||||
"""Calculate exclusions and other variables."""
|
||||
# Incompatibilities - if portable and updatable are asked together,
|
||||
# only portable will be built.
|
||||
if self.portable and self.updatable:
|
||||
print("Upgradable and portable options were required together. Building only portable.")
|
||||
self.updatable = False
|
||||
|
||||
if self.updatable and not self.queried_name:
|
||||
# If the queried version was a numbered version, doesn't make sense
|
||||
# to build an updatable version.
|
||||
self.updatable = False
|
||||
|
||||
# Mandate to the private function to calculate the full_path available
|
||||
# for the storage and the checks.
|
||||
self.__calculate_full_path__()
|
||||
|
||||
# Building expected AppImageName
|
||||
self.languagepart = "."
|
||||
if ',' in self.language:
|
||||
|
@ -68,25 +83,8 @@ class Build(object):
|
|||
self.genappimagefilename[arch] = self.appname + '-' + self.genappversion + f'-{arch}.AppImage'
|
||||
|
||||
|
||||
def check(self, storage_path):
|
||||
def check(self):
|
||||
"""Checking if the requested AppImage has been already built."""
|
||||
# Mandate to the private function to calculate the full_path available
|
||||
# for the storage and the checks.
|
||||
self.__calculate_full_path__()
|
||||
|
||||
# Incompatibilities - if portable and updatable are asked together,
|
||||
# only portable will be built.
|
||||
if self.portable and self.updatable:
|
||||
print("Upgradable and portable options were required together. Building only portable.")
|
||||
self.updatable = False
|
||||
|
||||
if self.updatable and not self.queried_name:
|
||||
# If the queried version was a numbered version, doesn't make sense
|
||||
# to build an updatable version.
|
||||
self.updatable = False
|
||||
|
||||
# Call the build for queries
|
||||
self.version_strings()
|
||||
|
||||
for arch in self.arch:
|
||||
# For generalized builds, we need to check if there are .ver file
|
||||
|
@ -138,12 +136,8 @@ class Build(object):
|
|||
fullpath_arr.extend(self.relative_path)
|
||||
self.full_path = re.sub(r"/+", '/', str.join('/', fullpath_arr))
|
||||
|
||||
def download(self, download_path):
|
||||
def download(self):
|
||||
"""Downloads the contents of the URL as it was a folder."""
|
||||
# Let's start with defining which files are to be downloaded.
|
||||
# Let's explore the remote folder.
|
||||
self.download_path = download_path
|
||||
|
||||
for arch in self.arch:
|
||||
# Checking if a valid path has been provided
|
||||
if self.url[arch] == '-':
|
||||
|
|
Reference in a new issue