python3 only: remove six.moves imports
This commit is contained in:
parent
844382b1e8
commit
548a73f121
33 changed files with 75 additions and 121 deletions
|
|
@ -12,7 +12,6 @@ import shutil
|
|||
from distutils.spawn import find_executable
|
||||
from glob import glob
|
||||
|
||||
from six import string_types
|
||||
import numpy as np
|
||||
import ox
|
||||
import ox.image
|
||||
|
|
@ -463,7 +462,7 @@ def timeline(video, prefix, modes=None, size=None):
|
|||
modes = ['antialias', 'slitscan', 'keyframes', 'audio', 'data']
|
||||
if size is None:
|
||||
size = [64, 16]
|
||||
if isinstance(video, string_types):
|
||||
if isinstance(video, str):
|
||||
video = [video]
|
||||
cmd = ['../bin/oxtimelines',
|
||||
'-s', ','.join(map(str, reversed(sorted(size)))),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import shutil
|
|||
import tempfile
|
||||
import time
|
||||
|
||||
from six import string_types, PY2
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db import models
|
||||
|
|
@ -28,9 +27,6 @@ from . import managers
|
|||
|
||||
User = get_user_model()
|
||||
|
||||
if not PY2:
|
||||
unicode = str
|
||||
|
||||
def data_path(f, x):
|
||||
return f.get_path('data.bin')
|
||||
|
||||
|
|
@ -165,7 +161,7 @@ class File(models.Model):
|
|||
if self.item:
|
||||
for key in self.ITEM_INFO:
|
||||
data[key] = self.item.get(key)
|
||||
if isinstance(data[key], string_types):
|
||||
if isinstance(data[key], str):
|
||||
data[key] = ox.decode_html(data[key])
|
||||
elif isinstance(data[key], list):
|
||||
data[key] = [ox.decode_html(e) for e in data[key]]
|
||||
|
|
@ -259,8 +255,8 @@ class File(models.Model):
|
|||
data = self.get_path_info()
|
||||
self.extension = data.get('extension')
|
||||
self.language = data.get('language')
|
||||
self.part = ox.sort_string(unicode(data.get('part') or ''))
|
||||
self.part_title = ox.sort_string(unicode(data.get('partTitle')) or '')
|
||||
self.part = ox.sort_string(str(data.get('part') or ''))
|
||||
self.part_title = ox.sort_string(str(data.get('partTitle')) or '')
|
||||
self.type = data.get('type') or 'unknown'
|
||||
self.version = data.get('version')
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
from glob import glob
|
||||
|
||||
from six import string_types
|
||||
from celery.task import task
|
||||
from django.conf import settings
|
||||
from django.db.models import Q
|
||||
|
|
@ -219,7 +218,7 @@ def move_media(data, user):
|
|||
data['public_id'] = data.pop('item').strip()
|
||||
if not is_imdb_id(data['public_id']):
|
||||
del data['public_id']
|
||||
if 'director' in data and isinstance(data['director'], string_types):
|
||||
if 'director' in data and isinstance(data['director'], str):
|
||||
if data['director'] == '':
|
||||
data['director'] = []
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ from django.shortcuts import get_object_or_404, redirect, render
|
|||
from django.conf import settings
|
||||
from django.db.models import Count, Q
|
||||
|
||||
from six import string_types
|
||||
from celery.utils import get_full_cls_name
|
||||
from celery._state import current_app
|
||||
import ox
|
||||
|
|
@ -555,7 +554,7 @@ def getPath(request, data):
|
|||
'''
|
||||
response = json_response()
|
||||
ids = data['id']
|
||||
if isinstance(ids, string_types):
|
||||
if isinstance(ids, str):
|
||||
ids = [ids]
|
||||
for f in models.File.objects.filter(oshash__in=ids).values('path', 'oshash').order_by('sort_path'):
|
||||
response['data'][f['oshash']] = f['path']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue