From 51e4977f2049fc938d494fd180c167ff03db83d4 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 7 Jan 2021 10:51:12 +0100 Subject: [PATCH] Changing output of list of object classes --- lib/ldap_migration/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ldap_migration/__init__.py b/lib/ldap_migration/__init__.py index 4c7c7ad..c1fb5e6 100644 --- a/lib/ldap_migration/__init__.py +++ b/lib/ldap_migration/__init__.py @@ -45,7 +45,7 @@ from fb_tools.collections import CIStringSet, CIDict from .config import LDAPMigrationConfiguration -__version__ = '0.9.8' +__version__ = '0.9.9' LOG = logging.getLogger(__name__) CFG_BASENAME = 'ldap-migration.ini' @@ -870,9 +870,14 @@ class LDAPMigrationApplication(BaseApplication): if self.verbose > 3: LOG.debug("Discovered ObjectClasses:\n" + pp(self.object_classes.as_dict())) else: + max_len = 1 + for oc in self.object_classes.keys(): + if len(oc) > max_len: + max_len = len(oc) + tpl = "{{n:<{m}}} - {{k}}".format(m=max_len) oclist = [] for oc in self.object_classes.keys(): - oclist.append("{n} ({k})".format(n=oc, k=self.object_classes[oc]['kind'])) + oclist.append(tpl.format(n=oc, k=self.object_classes[oc]['kind'])) LOG.debug("Discovered ObjectClasses:\n" + pp(oclist)) # ------------------------------------------------------------------------- -- 2.39.5