def _bz_notify_cache( name=None, version=None, eol=False, out_format='text', acls=None): '''List of usernames that should be notified of changes to a package. For the collections specified we want to retrieve all of the owners, watchbugzilla, and watchcommits accounts. :kwarg name: Set to a collection name to filter the results for that :kwarg version: Set to a collection version to further filter results for a single version :kwarg eol: Set to True if you want to include end of life distributions :kwarg out_format: Specify if the output if text or json. ''' packages = pkgdblib.notify( session=SESSION, eol=eol, name=name, version=version, acls=acls) output = [] if out_format == 'json': output = {'packages': {}, 'eol': eol, 'name': name, 'version': version, 'title': 'Fedora Package Database -- Notification List'} for package in sorted(packages): if out_format == 'json': output['packages'][package] = packages[package].split(',') else: output.append('%s|%s\n' % (package, packages[package])) return output
def _bz_notify_cache(name=None, version=None, eol=False, out_format='text'): '''List of usernames that should be notified of changes to a package. For the collections specified we want to retrieve all of the owners, watchbugzilla, and watchcommits accounts. :kwarg name: Set to a collection name to filter the results for that :kwarg version: Set to a collection version to further filter results for a single version :kwarg eol: Set to True if you want to include end of life distributions :kwarg out_format: Specify if the output if text or json. ''' packages = pkgdblib.notify(session=SESSION, eol=eol, name=name, version=version) output = [] if out_format == 'json': output = { 'packages': [], 'eol': eol, 'name': name, 'version': version, 'title': 'Fedora Package Database -- Notification List' } for package in sorted(packages): if out_format == 'json': output['packages'].append({package: packages[package].split(',')}) else: output.append('%s|%s\n' % (package, packages[package])) return output