def _list_checks(): """ List all the checks and flags available. """ def list_data_by_file(files, checks_list): ''' print filename + flags and checks defined in it. ''' for f in sorted(files): print 'File: ' + f flags_by_src = filter(lambda c: c.defined_in == f, checks_lister.flags.itervalues()) for flag in flags_by_src: print 'Flag: ' + flag.name files_per_src = filter(lambda c: c.defined_in == f, checks_list) groups = list(set([c.group for c in files_per_src])) for group in sorted(groups): def check_match(c): ''' check in correct group and file? ''' return c.group == group and c.defined_in == f checks = filter(check_match, checks_list) if checks == []: continue print 'Group: ' + group for c in sorted(checks): print ' %s: %s' % (c.name, c.text) print checks_lister = ChecksLister() checks_list = list(checks_lister.get_checks().itervalues()) files = list(set([c.defined_in for c in checks_list])) list_data_by_file(files, checks_list) deps_list = filter(lambda c: c.needs != [] and c.needs != ['CheckBuildCompleted'], checks_list) for dep in deps_list: print'Dependencies: ' + dep.name + ': ' + \ os.path.basename(dep.defined_in) for needed in dep.needs: print ' ' + needed deprecators = filter(lambda c: c.deprecates != [], checks_list) for dep in deprecators: print 'Deprecations: ' + dep.name + ': ' + \ os.path.basename(dep.defined_in) for victim in dep.deprecates: print ' ' + victim
def _list_checks(): """ List all the checks and flags available. """ def list_data_by_file(files, checks_list): ''' print filename + flags and checks defined in it. ''' for f in sorted(files): print 'File: ' + f flags_by_src = filter(lambda c: c.defined_in == f, checks_lister.flags.itervalues()) for flag in flags_by_src: print 'Flag: ' + flag.name files_per_src = filter(lambda c: c.defined_in == f, checks_list) groups = list(set([c.group for c in files_per_src])) for group in sorted(groups): def check_match(c): ''' check in correct group and file? ''' return c.group == group and c.defined_in == f checks = filter(check_match, checks_list) if checks == []: continue print 'Group: ' + group for c in sorted(checks): print ' %s: %s' % (c.name, c.text) print checks_lister = ChecksLister() checks_list = list(checks_lister.get_checks().itervalues()) files = list(set([c.defined_in for c in checks_list])) list_data_by_file(files, checks_list) deps_list = filter( lambda c: c.needs != [] and c.needs != ['CheckBuildCompleted'], checks_list) for dep in deps_list: print'Dependencies: ' + dep.name + ': ' + \ os.path.basename(dep.defined_in) for needed in dep.needs: print ' ' + needed deprecators = filter(lambda c: c.deprecates != [], checks_list) for dep in deprecators: print 'Deprecations: ' + dep.name + ': ' + \ os.path.basename(dep.defined_in) for victim in dep.deprecates: print ' ' + victim
def _print_version(): ''' Handle --version option. ''' # pylint: disable=superfluous-parens print('fedora-review version ' + __version__ + ' ' + BUILD_FULL) print('external plugins:') checks_lister = ChecksLister() for registry in checks_lister.groups.itervalues(): if registry.external_plugin: print "{r.group} version {r.version} {r.build_id}".format( r=registry)
def _list_plugins(): ''' --display-plugins implementation. ''' checks_lister = ChecksLister() plugins = checks_lister.get_plugins() print ', '.join(plugins)
def _list_flags(): ''' List all flags in simple, user-friendly format. ''' checks_lister = ChecksLister() for flag in checks_lister.flags.itervalues(): print flag.name + ': ' + flag.doc