File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1- try :
2- import urlparse
3- except ImportError :
4- import urllib .parse as urlparse
1+ from __future__ import absolute_import
2+ from __future__ import division
3+ from __future__ import print_function
4+ from __future__ import unicode_literals
5+ from builtins import int
6+ from future import standard_library
7+ standard_library .install_aliases ()
8+
9+ import urllib .parse
510
611def parse (url ):
712 """Parses a Redis URL."""
813
9- url = urlparse .urlparse (url )
14+ url = urllib . parse .urlparse (url )
1015
1116 config = {
1217 'host' : url .hostname or 'localhost' ,
@@ -15,15 +20,15 @@ def parse(url):
1520 }
1621
1722 # parse options from url
18- options = urlparse .parse_qs (url .query )
23+ options = urllib . parse .parse_qs (url .query )
1924
2025 # if cluster mode is enabled, do not add db to config (unsupported)
2126 cluster_enabled = options .pop ('cluster' , ['false' ])[0 ]
2227
2328 if cluster_enabled == 'false' :
2429 config ['db' ] = int (url .path [1 :] or 0 )
2530
26- for key , val in options .iteritems ():
31+ for key , val in options .items ():
2732 config [key ] = val [0 ] if len (val ) == 1 else val
2833
2934 if key == 'skip_full_coverage_check' :
Original file line number Diff line number Diff line change 99
1010setup (
1111 name = 'redis-url-py' ,
12- version = '0.0.3 ' ,
12+ version = '0.0.4 ' ,
1313 url = 'https://github.com/Xopherus/redis-url-py' ,
1414 license = LICENSE ,
1515 author = 'Chris Raborg' ,
1616 author_email = 'craborg1@umbc.edu' ,
1717 description = 'Use Redis URLs in your Python applications' ,
1818 long_description = DESCRIPTION ,
1919 py_modules = ['redis_url' ],
20+ install_requires = ["future" ],
2021 zip_safe = False ,
2122)
You can’t perform that action at this time.
0 commit comments