diff --git a/bob/bio/base/script/resources.py b/bob/bio/base/script/resources.py index 8d4ea581374e160430c9f90f2f2906a15550ccd2..3ede22ed6eeae2676f453573c09db45a52db1964 100644 --- a/bob/bio/base/script/resources.py +++ b/bob/bio/base/script/resources.py @@ -13,27 +13,34 @@ def resources(): default = ('d', 'p', 'e', 'a', 'g'), help = "Select the resource types that should be listed.") + parser.add_argument("--no-strip-dummy", '-s', action = 'store_true', + help = "If given, the dummy elements (usually used for testing purposes only) are **not** removed from the list.") + args = parser.parse_args() + kwargs = {} + if args.no_strip_dummy: + kwargs['strip'] = [] + if 'd' in args.details or 'database' in args.details: print ("\nList of registered databases:") - print (bob.bio.base.list_resources('database')) + print (bob.bio.base.list_resources('database', **kwargs)) if 'p' in args.details or 'preprocessor' in args.details: print ("\nList of registered preprocessors:") - print (bob.bio.base.list_resources('preprocessor')) + print (bob.bio.base.list_resources('preprocessor', **kwargs)) if 'e' in args.details or 'extractor' in args.details: print ("\nList of registered extractors:") - print (bob.bio.base.list_resources('extractor')) + print (bob.bio.base.list_resources('extractor', **kwargs)) if 'a' in args.details or 'algorithm' in args.details: print ("\nList of registered algorithms:") - print (bob.bio.base.list_resources('algorithm')) + print (bob.bio.base.list_resources('algorithm', **kwargs)) if 'g' in args.details or 'grid' in args.details: print ("\nList of registered grid configurations:") - print (bob.bio.base.list_resources('grid')) + print (bob.bio.base.list_resources('grid', **kwargs)) print() diff --git a/bob/bio/base/utils/resources.py b/bob/bio/base/utils/resources.py index 46f8039021b9fdb72a3000ff579c0a76aec46127..693fdd5980cf5ce970af7efed9a97ec191a69a58 100644 --- a/bob/bio/base/utils/resources.py +++ b/bob/bio/base/utils/resources.py @@ -190,7 +190,7 @@ def list_resources(keyword, strip=['dummy']): retval = "" length = max(len(entry_point.name) for entry_point in entry_points) if entry_points else 1 - for entry_point in sorted(entry_points): + for entry_point in sorted(entry_points, key=lambda p: p.dist.project_name): if last_dist != str(entry_point.dist): retval += "\n- %s: \n" % str(entry_point.dist) last_dist = str(entry_point.dist)