mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
[py3] Fixed access to dict keys/values/items.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
termcolors.py
|
||||
"""
|
||||
|
||||
from django.utils import six
|
||||
|
||||
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
|
||||
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
|
||||
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
|
||||
@@ -41,7 +43,7 @@ def colorize(text='', opts=(), **kwargs):
|
||||
code_list = []
|
||||
if text == '' and len(opts) == 1 and opts[0] == 'reset':
|
||||
return '\x1b[%sm' % RESET
|
||||
for k, v in kwargs.iteritems():
|
||||
for k, v in six.iteritems(kwargs):
|
||||
if k == 'fg':
|
||||
code_list.append(foreground[v])
|
||||
elif k == 'bg':
|
||||
|
||||
Reference in New Issue
Block a user