Skip to content

Add support for Python 3 #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eb0d02d
Add python 3.3 and 3.2 as allow_failures
graingert Apr 8, 2013
eb53791
add <1.6 to tests_require
graingert Apr 8, 2013
005ca0b
use sqlparse from pypi
graingert Apr 8, 2013
c73c77a
remove support for django <1.4.2
graingert Apr 8, 2013
c58094b
use new style exception in __init__.py
graingert Apr 8, 2013
e749ab1
port imports to py3k in middleware.py
graingert Apr 8, 2013
f6aad29
support new style exceptions in loader.py
graingert Apr 8, 2013
f1d5de5
port imports to py3k in utils/__init__.py
graingert Apr 8, 2013
61d1286
support new style exceptions in utils/tracking/__init__.py
graingert Apr 8, 2013
e4e8388
use force_text instead of force_unicode
graingert Apr 8, 2013
e3723e3
remove use of deprecated sqlparse.filters.Filters
graingert Apr 8, 2013
bab0aee
use thread from six.moves in tests/tests.py
graingert Apr 8, 2013
417c852
use assertEqual instead of assertEquals in tests
graingert Apr 8, 2013
3929d60
use iteritems from six, or items in templates
graingert Apr 8, 2013
068a6c1
use string_types from six instead of basestring
graingert Apr 8, 2013
7cb3cb0
use iterkeys and itervalues from six, or .keys and .values in templates
graingert Apr 8, 2013
c2485f5
deprecate functions unusable on Python3
graingert Apr 9, 2013
61bbd7f
use more simpler, more portable monkey_patch_call func in tracking
graingert Apr 9, 2013
cdfa803
use map from six
graingert Apr 9, 2013
494f421
force more things to bytes before hashing
graingert Apr 9, 2013
a30c83f
use text_type instead of unicode
graingert Apr 9, 2013
6e50c9f
add DJANGO_VERSION=1.5 to allow_failures
graingert Apr 9, 2013
47ea676
fix print function
w-diesel Apr 14, 2013
76a8159
Update profiling.py, attr. "func_closure" ( py2.6)
w-diesel Apr 14, 2013
f5d4cde
remove u'' prefix, import __future__ unicode_lit..
w-diesel Apr 14, 2013
0e6983a
use force_bytes to encode before hashing
graingert Apr 14, 2013
a088ed0
list expected
w-diesel Apr 14, 2013
3aa8c4c
Update middleware.py
w-diesel Apr 14, 2013
7a21c54
cache.py, fix python3.2 support
w-diesel Apr 15, 2013
fa40aa1
Masterbranch can pass all original tests on 1.5ver
w-diesel Apr 16, 2013
ee44437
Update .travis.yml
w-diesel Apr 16, 2013
fd2bb66
use unittest.skipIf to skip tests invalid on PY3
graingert Apr 23, 2013
09203c6
bump django version requirements to 1.4.5
graingert Apr 25, 2013
9a924cd
remove spaces from print functions
graingert Apr 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use iterkeys and itervalues from six, or .keys and .values in templates
  • Loading branch information
graingert committed Apr 8, 2013
commit 7cb3cb0c43cee025c96226d7025311d0edf07989
3 changes: 2 additions & 1 deletion debug_toolbar/panels/request_vars.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.core.urlresolvers import resolve
from django.http import Http404
from django.utils.translation import ugettext_lazy as _
from django.utils.six import iterkeys

from debug_toolbar.panels import DebugPanel
from debug_toolbar.utils import get_name_from_obj
Expand Down Expand Up @@ -53,5 +54,5 @@ def process_response(self, request, response):
if hasattr(self.request, 'session'):
self.record_stats({
'session': [(k, self.request.session.get(k))
for k in self.request.session.iterkeys()]
for k in iterkeys(self.request.session)]
})
3 changes: 2 additions & 1 deletion debug_toolbar/panels/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.db.backends import BaseDatabaseWrapper
from django.utils.html import escape
from django.utils.translation import ugettext_lazy as _, ungettext_lazy as __
from django.utils.six import itervalues

from debug_toolbar.utils.compat.db import connections
from debug_toolbar.middleware import DebugToolbarMiddleware
Expand Down Expand Up @@ -135,7 +136,7 @@ def process_response(self, request, response):
if self._queries:
width_ratio_tally = 0
factor = int(256.0 / (len(self._databases) * 2.5))
for n, db in enumerate(self._databases.itervalues()):
for n, db in enumerate(itervalues(self._databases)):
rgb = [0, 0, 0]
color = n % 3
rgb[color] = 256 - n / 3 * factor
Expand Down
4 changes: 2 additions & 2 deletions debug_toolbar/templates/debug_toolbar/panels/cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ <h3>{% trans "Commands" %}</h3>
<table>
<thead>
<tr>
{% for name in counts.iterkeys %}
{% for name in counts.keys %}
<th>{{ name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
<tr>
{% for value in counts.itervalues %}
{% for value in counts.values %}
<td>{{ value }}</td>
{% endfor %}
</tr>
Expand Down