[cwctl] improve dialog messages stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Fri, 25 Sep 2009 20:49:41 +0200
branchstable
changeset 3486 ea6bf6f9ba0c
parent 3470 c9c8b231db7b
child 3487 2e705d9fdaf1
[cwctl] improve dialog messages
cwctl.py
devtools/dataimport.py
--- a/cwctl.py	Fri Sep 25 11:01:23 2009 +0200
+++ b/cwctl.py	Fri Sep 25 20:49:41 2009 +0200
@@ -171,8 +171,7 @@
         """run the command with its specific arguments"""
         if args:
             raise BadCommandUsage('Too much arguments')
-        print 'CubicWeb version:', cwcfg.cubicweb_version()
-        print 'Detected mode:', cwcfg.mode
+        print 'CubicWeb %s (%s mode)' % (cwcfg.cubicweb_version(), cwcfg.mode)
         print
         print 'Available configurations:'
         for config in CONFIGURATIONS:
--- a/devtools/dataimport.py	Fri Sep 25 11:01:23 2009 +0200
+++ b/devtools/dataimport.py	Fri Sep 25 20:49:41 2009 +0200
@@ -151,7 +151,7 @@
         return len(self.items) - 1
 
     def add(self, type, item):
-        assert isinstance(item, dict), item
+        assert isinstance(item, dict), 'item is not a dict but a %s' % type(item)
         eid = item['eid'] = self._put(type, item)
         self.eids[eid] = item
         self.types.setdefault(type, []).append(eid)
@@ -172,7 +172,7 @@
 
     def get_one(self, name, key):
         eids = self.indexes[name].get(key, [])
-        assert len(eids) == 1
+        assert len(eids) == 1, 'expected a single one got %i' % len(eids)
         return eids[0]
 
     def find(self, type, key, value):