Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
Django-Redis-Cache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared
Django-Redis-Cache
Commits
f92c0eca
Commit
f92c0eca
authored
Aug 26, 2016
by
Tim Graham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use six rather than redis_cache.compat
parent
918fe0b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
19 deletions
+5
-19
compat.py
redis_cache/compat.py
+0
-12
utils.py
redis_cache/utils.py
+5
-7
No files found.
redis_cache/compat.py
View file @
f92c0eca
import
sys
PY3
=
(
sys
.
version_info
>=
(
3
,))
try
:
try
:
# Django 1.5+
# Django 1.5+
from
django.utils.encoding
import
smart_text
,
smart_bytes
from
django.utils.encoding
import
smart_text
,
smart_bytes
...
@@ -11,10 +6,3 @@ except ImportError:
...
@@ -11,10 +6,3 @@ except ImportError:
from
django.utils.encoding
import
smart_unicode
,
smart_str
from
django.utils.encoding
import
smart_unicode
,
smart_str
smart_text
=
smart_unicode
smart_text
=
smart_unicode
smart_bytes
=
smart_str
smart_bytes
=
smart_str
if
PY3
:
bytes_type
=
bytes
from
urllib.parse
import
parse_qs
,
urlparse
else
:
bytes_type
=
str
from
urlparse
import
parse_qs
,
urlparse
redis_cache/utils.py
View file @
f92c0eca
...
@@ -2,15 +2,13 @@ import importlib
...
@@ -2,15 +2,13 @@ import importlib
import
warnings
import
warnings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.utils
import
six
from
django.utils.encoding
import
python_2_unicode_compatible
from
django.utils.encoding
import
python_2_unicode_compatible
from
redis.connection
import
SSLConnection
from
django.utils.six.moves.urllib.parse
import
parse_qs
,
urlparse
from
redis
_cache.compat
import
smart_text
,
parse_qs
,
urlparse
from
redis
.connection
import
SSLConnection
try
:
from
redis_cache.compat
import
smart_text
basestring
except
NameError
:
basestring
=
str
@
python_2_unicode_compatible
@
python_2_unicode_compatible
...
@@ -38,7 +36,7 @@ def get_servers(location):
...
@@ -38,7 +36,7 @@ def get_servers(location):
"""Returns a list of servers given the server argument passed in from
"""Returns a list of servers given the server argument passed in from
Django.
Django.
"""
"""
if
isinstance
(
location
,
basestring
):
if
isinstance
(
location
,
six
.
string_types
):
servers
=
location
.
split
(
','
)
servers
=
location
.
split
(
','
)
elif
hasattr
(
location
,
'__iter__'
):
elif
hasattr
(
location
,
'__iter__'
):
servers
=
location
servers
=
location
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment