1
0
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:
Aymeric Augustin
2012-07-20 21:14:27 +02:00
parent fa3f0aa021
commit ee191715ea
64 changed files with 187 additions and 155 deletions

View File

@@ -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':