mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Rework app into a class
This simplifies usage, goes from app['Foo'] to app.Foo Also makes static analyzers able to detect invalid attributes as the set is now limited in the class definition. As a bonus, setting of the default field values is now done in the constructor, not separately and manually.
This commit is contained in:
parent
de12cfdbe1
commit
ab614ab442
18 changed files with 515 additions and 433 deletions
|
|
@ -274,10 +274,10 @@ def main():
|
|||
|
||||
for appid, app in apps.iteritems():
|
||||
|
||||
if app['Disabled']:
|
||||
if app.Disabled:
|
||||
logging.info("Skipping %s: disabled" % appid)
|
||||
continue
|
||||
if not app['builds']:
|
||||
if not app.builds:
|
||||
logging.info("Skipping %s: no builds specified" % appid)
|
||||
continue
|
||||
|
||||
|
|
@ -285,15 +285,15 @@ def main():
|
|||
|
||||
try:
|
||||
|
||||
if app['Repo Type'] == 'srclib':
|
||||
build_dir = os.path.join('build', 'srclib', app['Repo'])
|
||||
if app.RepoType == 'srclib':
|
||||
build_dir = os.path.join('build', 'srclib', app.Repo)
|
||||
else:
|
||||
build_dir = os.path.join('build', appid)
|
||||
|
||||
# Set up vcs interface and make sure we have the latest code...
|
||||
vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir)
|
||||
vcs = common.getvcs(app.RepoType, app.Repo, build_dir)
|
||||
|
||||
for thisbuild in app['builds']:
|
||||
for thisbuild in app.builds:
|
||||
|
||||
if thisbuild['disable']:
|
||||
logging.info("...skipping version %s - %s" % (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue