From c42fdf61f8f6831a4f3fe0b068c011259f699230 Mon Sep 17 00:00:00 2001
From: Manuel Guenther <manuel.guenther@idiap.ch>
Date: Wed, 17 Jun 2015 19:13:11 +0200
Subject: [PATCH] Improved video extension compatibility; made bin/resources.py
 more beautiful

---
 bob/bio/base/tools/grid.py         | 3 +++
 bob/bio/base/tools/preprocessor.py | 2 +-
 bob/bio/base/utils/resources.py    | 6 ++++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bob/bio/base/tools/grid.py b/bob/bio/base/tools/grid.py
index 5306f93c..7c79716b 100644
--- a/bob/bio/base/tools/grid.py
+++ b/bob/bio/base/tools/grid.py
@@ -37,6 +37,9 @@ class GridSubmission:
     # find, where the executable is installed
     import bob.extension
 
+    if command_line_parameters is None:
+      command_line_parameters = sys.argv[1:]
+
     executables = bob.extension.find_executable(executable, prefixes = ['bin'])
     if not len(executables):
       raise IOError("Could not find the '%s' executable." % executable)
diff --git a/bob/bio/base/tools/preprocessor.py b/bob/bio/base/tools/preprocessor.py
index 015a1860..3652b1d5 100644
--- a/bob/bio/base/tools/preprocessor.py
+++ b/bob/bio/base/tools/preprocessor.py
@@ -34,7 +34,7 @@ def preprocess(preprocessor, groups=None, indices=None, force=False):
 
     # check for existence
     if not utils.check_file(preprocessed_data_file, force, 1000):
-      file_name = str(data_files[i])
+      file_name = data_files[i]
       data = preprocessor.read_original_data(file_name)
 
       # get the annotations; might be None
diff --git a/bob/bio/base/utils/resources.py b/bob/bio/base/utils/resources.py
index 64164599..deecd562 100644
--- a/bob/bio/base/utils/resources.py
+++ b/bob/bio/base/utils/resources.py
@@ -174,13 +174,15 @@ def list_resources(keyword, strip=['dummy']):
   entry_points = _get_entry_points(keyword, strip)
   last_dist = None
   retval = ""
+  length = max(len(entry_point.name) for entry_point in entry_points)
+
   for entry_point in sorted(entry_points):
     if last_dist != str(entry_point.dist):
       retval += "\n- %s: \n" % str(entry_point.dist)
       last_dist = str(entry_point.dist)
 
     if len(entry_point.attrs):
-      retval += "  + %s  --> %s: %s\n" % (entry_point.name, entry_point.module_name, entry_point.attrs[0])
+      retval += "  + %s --> %s: %s\n" % (entry_point.name + " "*(length - len(entry_point.name)), entry_point.module_name, entry_point.attrs[0])
     else:
-      retval += "  + %s  --> %s\n" % (entry_point.name, entry_point.module_name)
+      retval += "  + %s --> %s\n" % (entry_point.name + " "*(length - len(entry_point.name)), entry_point.module_name)
   return retval
-- 
GitLab