diff options
Diffstat (limited to 'accounts/utils/console.py')
-rw-r--r-- | accounts/utils/console.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/accounts/utils/console.py b/accounts/utils/console.py index 8ee717f..841a78a 100644 --- a/accounts/utils/console.py +++ b/accounts/utils/console.py @@ -45,7 +45,7 @@ class TablePrinter(object): self.widths = [_column_width(column, width) for column, width - in zip(zip(*rows), self.widths)] + in zip(list(zip(*rows)), self.widths)] self._update_format_string() @@ -68,13 +68,13 @@ class TablePrinter(object): self._print_row(row) def _print_headline(self): - print('%s%s%s' % ( + print(('%s%s%s' % ( self.separator, self.separator.join(['-' * (width + 2) for width in self.widths]), - self.separator)) + self.separator))) def _print_row(self, row): - print(self.format_string % tuple(row)) + print((self.format_string % tuple(row))) class ConsoleForm(object): @@ -86,19 +86,19 @@ class ConsoleForm(object): self._ready = True def _fill(self, data): - for key, value in data.items(): + for key, value in list(data.items()): field = getattr(self.form, key, None) if field is not None: field.data = value def print_errors(self): - for field, errors in self.form.errors.items(): + for field, errors in list(self.form.errors.items()): if len(errors) > 1: - print('%s:' % field) + print(('%s:' % field)) for error in errors: - print(' %s' % error) + print((' %s' % error)) else: - print('%s: %s' % (field, errors[0])) + print(('%s: %s' % (field, errors[0]))) def __getattr__(self, name): return getattr(self.form, name) |