def page_generator(pkgname, repos, single=False): found = data_generator(pkgname, repos) parameters = found.parameters if not parameters: parameters = { 'pkgname': pkgname, 'other_archs': found.other, } return present.render_template('nopkg.html', **parameters) for field in chain(parameters['fields'], [parameters['short_desc']]): field.presentation.update(_props_presentation(field.name)) parameters['single_pkg'] = single return present.render_template('pkgs.void.html', **parameters)
def newest(): source = datasource.factory() packages = source.newest(70) parameters = { 'title': 'Newest packages', 'subtitle': f'by {_ago(source)}', 'packages': packages, } return present.render_template('list.html', **parameters)
def which_package(): return present.render_template('which.html')