Make all package fields optional
This commit is contained in:
parent
3887959adf
commit
e2008e8700
1 changed files with 22 additions and 11 deletions
33
arch.py
33
arch.py
|
@ -44,17 +44,28 @@ class ArchDatabase:
|
|||
s = df.read().decode('utf-8')
|
||||
|
||||
d = dict(item.split("\n")[:2] for item in s.split("\n\n")[:-1])
|
||||
archPackage = ArchPackage(d["%NAME%"])
|
||||
archPackage.set_filename(d["%FILENAME%"])
|
||||
archPackage.set_version(d["%VERSION%"])
|
||||
archPackage.set_desc(d["%DESC%"])
|
||||
archPackage.set_csize(d["%CSIZE%"])
|
||||
archPackage.set_isize(d["%ISIZE%"])
|
||||
archPackage.set_url(d["%URL%"])
|
||||
archPackage.set_license(d["%LICENSE%"])
|
||||
archPackage.set_arch(d["%ARCH%"])
|
||||
archPackage.set_builddate(d["%BUILDDATE%"])
|
||||
archPackage.set_packager(d["%PACKAGER%"])
|
||||
if "%NAME%" in d:
|
||||
archPackage = ArchPackage(d["%NAME%"])
|
||||
if "%FILENAME%" in d:
|
||||
archPackage.set_filename(d["%FILENAME%"])
|
||||
if "%VERSION%" in d:
|
||||
archPackage.set_version(d["%VERSION%"])
|
||||
if "%DESC%" in d:
|
||||
archPackage.set_desc(d["%DESC%"])
|
||||
if "%CSIZE%" in d:
|
||||
archPackage.set_csize(d["%CSIZE%"])
|
||||
if "%ISIZE%" in d:
|
||||
archPackage.set_isize(d["%ISIZE%"])
|
||||
if "%URL%" in d:
|
||||
archPackage.set_url(d["%URL%"])
|
||||
if "%LICENSE%" in d:
|
||||
archPackage.set_license(d["%LICENSE%"])
|
||||
if "%ARCH%" in d:
|
||||
archPackage.set_arch(d["%ARCH%"])
|
||||
if "%BUILDDATE%" in d:
|
||||
archPackage.set_builddate(d["%BUILDDATE%"])
|
||||
if "%PACKAGER%" in d:
|
||||
archPackage.set_packager(d["%PACKAGER%"])
|
||||
self.packages.append(archPackage)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue