basestring->six.string_types

This commit is contained in:
j 2015-12-25 20:38:55 +05:30
commit 1db297169b
4 changed files with 11 additions and 5 deletions

View file

@ -3,6 +3,8 @@
from .. import cache
from ..utils import json
from six import string_types
def get_id(url):
return url.split("/")[-1]
@ -19,7 +21,7 @@ def get_data(id):
data[key] = details['metadata'][key]
if isinstance(data[key], list):
data[key] = data[key][0]
if isinstance(data[key], basestring):
if isinstance(data[key], string_types):
data[key] = data[key].strip()
if data[key][0] == '[' and data[key][-1] == ']':
data[key] = data[key][1:-1]