diff --git a/console/application/function.py b/console/application/function.py index dbcbe5f..22b14d6 100644 --- a/console/application/function.py +++ b/console/application/function.py @@ -96,8 +96,9 @@ def get_ip_mac_type(client_type = None): return results def print_brief_group(Fields, group_name): - if group_name: - _print ('\b'+group_name) + print_group_flag = False +# if group_name: +# _print ('\b'+group_name) uncompatible_count = 0 for field in Fields: if field.uncompatible: @@ -105,6 +106,9 @@ def print_brief_group(Fields, group_name): continue if field.element in ['input', 'openfile']: value = field.value if field.value else '' + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint._printSUCCESS('%s: %s' %(field.label, value)) elif field.element in ['combo', 'comboEdit', 'radio', 'file']: @@ -118,6 +122,9 @@ def print_brief_group(Fields, group_name): value = ', '.join(value) else: value = field.value if field.value else '' + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint._printSUCCESS('%s: %s' %(field.label, value)) elif field.element in ['multichoice', 'multichoice_add',\ @@ -134,12 +141,18 @@ def print_brief_group(Fields, group_name): value = ', '.join(field.listvalue.string) else: value = field.value if field.value else '' + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint._printSUCCESS('%s: %s' %(field.label, value)) # elif field.element == 'label': # print field.label elif field.element == 'error': + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint.printERROR(field.label) elif field.element in ['check', 'check_tristate']: @@ -151,6 +164,9 @@ def print_brief_group(Fields, group_name): value = _('auto') else: value = field.value + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint._printSUCCESS('%s: %s' %(field.label, value)) elif field.element == 'table' and field.type != 'steps': @@ -192,6 +208,9 @@ def print_brief_group(Fields, group_name): for body_row in body: data.append(map(lambda x: x if x else '', body_row)) + if not print_group_flag: + _print ('\b'+group_name) + print_group_flag = True colorPrint._printSUCCESS('%s: ' %(field.label)) res = printTable(data, head) sys.stdout.flush() @@ -200,8 +219,8 @@ def print_brief_group(Fields, group_name): else: uncompatible_count += 1 - if uncompatible_count == len (Fields) and group_name: - colorPrint._printSUCCESS(_('Not used')) +# if uncompatible_count == len (Fields) and group_name: +# colorPrint._printSUCCESS(_('Not used')) def print_brief(view, brief_label): for Group in view.groups.GroupField: