Allow definition of index max age in repo config

This commit is contained in:
Ciaran Gultnieks 2013-11-26 22:07:47 +00:00
parent dad763a86c
commit 7cc21fe89a
3 changed files with 13 additions and 1 deletions

View file

@ -61,7 +61,8 @@ def read_config(opts, config_file='config.py'):
'update_stats': False,
'archive_older': 0,
'max_icon_size': 72,
'stats_to_carbon': False
'stats_to_carbon': False,
'repo_maxage': 0
}
if options.verbose:
print "Reading %s..." % config_file

View file

@ -467,11 +467,15 @@ def make_index(apps, apks, repodir, archive, categories):
repoel = doc.createElement("repo")
if archive:
repoel.setAttribute("name", config['archive_name'])
if config['repo_maxage'] != 0:
repoel.setAttribute("maxage", str(config['repo_maxage']))
repoel.setAttribute("icon", os.path.basename(config['archive_icon']))
repoel.setAttribute("url", config['archive_url'])
addElement('description', config['archive_description'], doc, repoel)
else:
repoel.setAttribute("name", config['repo_name'])
if config['repo_maxage'] != 0:
repoel.setAttribute("maxage", str(config['repo_maxage']))
repoel.setAttribute("icon", os.path.basename(config['repo_icon']))
repoel.setAttribute("url", config['repo_url'])
addElement('description', config['repo_description'], doc, repoel)