Browse Source

Merged #3 "Table large text not truncated"

Deben Oldert 6 years ago
parent
commit
ac1172fa4b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      console.py

+ 4 - 3
console.py

@@ -51,7 +51,7 @@ def option_picker(question, options, objects=None, selected=None, quit=False, ta
             _space = '[{:' + str(column[1]) + '}]'
             header.append(_space.format(column[0]))
 
-        _header = ' '.join(header)
+        _header = ''.join(header)
         width = len(_header)
         output(color.Style.BRIGHT + _header)
         output(color.Style.BRIGHT + ('=' * width))
@@ -65,9 +65,10 @@ def option_picker(question, options, objects=None, selected=None, quit=False, ta
 
         if objects is not None and table is not None and len(objects) == len(table):
             for j in range(0, len(objects)):
-                _row += '[{' + str(objects[j]) + ':' + str(table[j][1]) + '}] '
+                _row += '[{{{name}:{size}.{size}}}]'.format(name=str(objects[j]), size=str(table[j][1]))
+                # _row += '[{' + str(objects[j]) + ':' + str(table[j][1]) + '.' + str(table[j][1]) + '}] '
 
-            output(_row.format(__id__=i, x=option).strip())
+            output(_row.format(__id__=str(i), x=option).strip())
 
         else:
             if i == selected: