Verified Commit 9427f8b5 authored by Agate's avatar Agate 💬

See #297: removed unused imports

parent 639882bd
from urllib.parse import parse_qs from urllib.parse import parse_qs
import jwt
from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import AnonymousUser
from django.utils.encoding import smart_text
from rest_framework import exceptions from rest_framework import exceptions
from rest_framework_jwt.settings import api_settings
from rest_framework_jwt.authentication import BaseJSONWebTokenAuthentication from rest_framework_jwt.authentication import BaseJSONWebTokenAuthentication
from funkwhale_api.users.models import User from funkwhale_api.users.models import User
......
import operator import operator
from django.conf import settings
from django.http import Http404 from django.http import Http404
from rest_framework.permissions import BasePermission from rest_framework.permissions import BasePermission
......
from . import django_permissions_to_user_permissions
from . import test
from .downloader import download from .downloader import download
__all__ = ["download"]
from django.conf import settings
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
......
from django.conf import settings
from rest_framework import serializers from rest_framework import serializers
......
from django.conf.urls import include, url
from . import views from . import views
from rest_framework import routers from rest_framework import routers
......
from rest_framework import generics, mixins, viewsets from rest_framework import mixins, viewsets
from rest_framework import status from rest_framework import status
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import pagination
from rest_framework.decorators import list_route from rest_framework.decorators import list_route
from funkwhale_api.activity import record from funkwhale_api.activity import record
......
from . import serializers
from . import tasks
ACTIVITY_TYPES = [ ACTIVITY_TYPES = [
"Accept", "Accept",
"Add", "Add",
...@@ -52,9 +49,13 @@ OBJECT_TYPES = [ ...@@ -52,9 +49,13 @@ OBJECT_TYPES = [
def deliver(activity, on_behalf_of, to=[]): def deliver(activity, on_behalf_of, to=[]):
from . import tasks
return tasks.send.delay(activity=activity, actor_id=on_behalf_of.pk, to=to) return tasks.send.delay(activity=activity, actor_id=on_behalf_of.pk, to=to)
def accept_follow(follow): def accept_follow(follow):
from . import serializers
serializer = serializers.AcceptFollowSerializer(follow) serializer = serializers.AcceptFollowSerializer(follow)
return deliver(serializer.data, to=[follow.actor.url], on_behalf_of=follow.target) return deliver(serializer.data, to=[follow.actor.url], on_behalf_of=follow.target)
...@@ -9,7 +9,6 @@ from django.utils import timezone ...@@ -9,7 +9,6 @@ from django.utils import timezone
from rest_framework.exceptions import PermissionDenied from rest_framework.exceptions import PermissionDenied
from dynamic_preferences.registries import global_preferences_registry
from funkwhale_api.common import preferences from funkwhale_api.common import preferences
from funkwhale_api.common import session from funkwhale_api.common import session
......
...@@ -7,8 +7,6 @@ from rest_framework import exceptions ...@@ -7,8 +7,6 @@ from rest_framework import exceptions
from . import actors from . import actors
from . import keys from . import keys
from . import models
from . import serializers
from . import signing from . import signing
from . import utils from . import utils
......
from django.forms import widgets
from dynamic_preferences import types from dynamic_preferences import types
from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.registries import global_preferences_registry
......
...@@ -5,7 +5,6 @@ from cryptography.hazmat.backends import default_backend as crypto_default_backe ...@@ -5,7 +5,6 @@ from cryptography.hazmat.backends import default_backend as crypto_default_backe
import re import re
import urllib.parse import urllib.parse
from . import exceptions
KEY_ID_REGEX = re.compile(r"keyId=\"(?P<id>.*)\"") KEY_ID_REGEX = re.compile(r"keyId=\"(?P<id>.*)\"")
......
from django.conf import settings
from rest_framework.permissions import BasePermission from rest_framework.permissions import BasePermission
......
import logging import logging
import urllib.parse import urllib.parse
from django.urls import reverse
from django.conf import settings
from django.core.paginator import Paginator from django.core.paginator import Paginator
from django.db import transaction from django.db import transaction
from rest_framework import serializers from rest_framework import serializers
from dynamic_preferences.registries import global_preferences_registry
from funkwhale_api.common import utils as funkwhale_utils from funkwhale_api.common import utils as funkwhale_utils
from funkwhale_api.common import serializers as common_serializers from funkwhale_api.common import serializers as common_serializers
......
...@@ -11,7 +11,6 @@ from requests.exceptions import RequestException ...@@ -11,7 +11,6 @@ from requests.exceptions import RequestException
from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.registries import global_preferences_registry
from funkwhale_api.common import session from funkwhale_api.common import session
from funkwhale_api.history.models import Listening
from funkwhale_api.taskapp import celery from funkwhale_api.taskapp import celery
from . import actors from . import actors
......
from django import forms from django import forms
from django.conf import settings
from django.core import paginator from django.core import paginator
from django.db import transaction from django.db import transaction
from django.http import HttpResponse from django.http import HttpResponse
from django.urls import reverse from django.urls import reverse
from rest_framework import mixins from rest_framework import mixins
from rest_framework import permissions as rest_permissions
from rest_framework import response from rest_framework import response
from rest_framework import views
from rest_framework import viewsets from rest_framework import viewsets
from rest_framework.decorators import list_route, detail_route from rest_framework.decorators import list_route, detail_route
from rest_framework.serializers import ValidationError
from funkwhale_api.common import preferences from funkwhale_api.common import preferences
from funkwhale_api.common import utils as funkwhale_utils
from funkwhale_api.music import models as music_models from funkwhale_api.music import models as music_models
from funkwhale_api.users.permissions import HasUserPermission from funkwhale_api.users.permissions import HasUserPermission
from . import activity
from . import actors from . import actors
from . import authentication from . import authentication
from . import filters from . import filters
......
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.urls import reverse
from funkwhale_api.common import session from funkwhale_api.common import session
from . import actors from . import actors
from . import utils
from . import serializers from . import serializers
VALID_RESOURCE_TYPES = ["acct"] VALID_RESOURCE_TYPES = ["acct"]
......
from django.utils import timezone from django.utils import timezone
from django.db import models from django.db import models
from django.core.exceptions import ValidationError
from funkwhale_api.music.models import Track from funkwhale_api.music.models import Track
......
from django.conf.urls import include, url
from . import views from . import views
from rest_framework import routers from rest_framework import routers
......
from rest_framework import generics, mixins, viewsets from rest_framework import mixins, viewsets
from rest_framework import permissions from rest_framework import permissions
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import detail_route
from funkwhale_api.activity import record from funkwhale_api.activity import record
from funkwhale_api.common.permissions import ConditionalAuthentication
from . import models from . import models
from . import serializers from . import serializers
......
...@@ -9,7 +9,6 @@ from funkwhale_api.common import preferences ...@@ -9,7 +9,6 @@ from funkwhale_api.common import preferences
from funkwhale_api.users.permissions import HasUserPermission from funkwhale_api.users.permissions import HasUserPermission
from . import nodeinfo from . import nodeinfo
from . import stats
NODEINFO_2_CONTENT_TYPE = "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8" # noqa NODEINFO_2_CONTENT_TYPE = "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8" # noqa
......
from django.db.models import Count
from django_filters import rest_framework as filters from django_filters import rest_framework as filters
......
...@@ -3,7 +3,6 @@ Populates the database with fake data ...@@ -3,7 +3,6 @@ Populates the database with fake data
""" """
import random import random
from funkwhale_api.music import models
from funkwhale_api.music import factories from funkwhale_api.music import factories
......
...@@ -2,8 +2,7 @@ import cacheops ...@@ -2,8 +2,7 @@ import cacheops
from django.db import transaction from django.db import transaction
from django.db.models import Q from django.db.models import Q
from django.conf import settings from django.core.management.base import BaseCommand
from django.core.management.base import BaseCommand, CommandError
from funkwhale_api.music import models, utils from funkwhale_api.music import models, utils
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations
import taggit.managers import taggit.managers
......
...@@ -3,7 +3,6 @@ from __future__ import unicode_literals ...@@ -3,7 +3,6 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
import versatileimagefield.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import versatileimagefield.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from funkwhale_api.common.utils import rename_file
def rename_files(apps, schema_editor): def rename_files(apps, schema_editor):
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations
import versatileimagefield.fields import versatileimagefield.fields
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations
from funkwhale_api.common.utils import rename_file
def bind_jobs(apps, schema_editor): def bind_jobs(apps, schema_editor):
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations
from funkwhale_api.music.utils import guess_mimetype from funkwhale_api.music.utils import guess_mimetype
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations
def populate_status(apps, schema_editor): def populate_status(apps, schema_editor):
......
from django.conf import settings
from rest_framework.permissions import BasePermission from rest_framework.permissions import BasePermission
......
from django.db import transaction
from django.db.models import Q from django.db.models import Q
from rest_framework import serializers from rest_framework import serializers
from taggit.models import Tag from taggit.models import Tag
from funkwhale_api.activity import serializers as activity_serializers from funkwhale_api.activity import serializers as activity_serializers
from funkwhale_api.federation import utils as federation_utils
from funkwhale_api.federation.models import LibraryTrack
from funkwhale_api.federation.serializers import AP_CONTEXT
from funkwhale_api.users.serializers import UserBasicSerializer from funkwhale_api.users.serializers import UserBasicSerializer
from . import models from . import models
......
...@@ -8,7 +8,6 @@ from musicbrainzngs import ResponseError ...@@ -8,7 +8,6 @@ from musicbrainzngs import ResponseError
from funkwhale_api.common import preferences from funkwhale_api.common import preferences
from funkwhale_api.federation import activity from funkwhale_api.federation import activity
from funkwhale_api.federation import actors from funkwhale_api.federation import actors
from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import serializers as federation_serializers from funkwhale_api.federation import serializers as federation_serializers
from funkwhale_api.taskapp import celery from funkwhale_api.taskapp import celery
from funkwhale_api.providers.acoustid import get_acoustid_client from funkwhale_api.providers.acoustid import get_acoustid_client
......
import ffmpeg
import json import json
import logging import logging
import unicodedata
import urllib import urllib
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings from django.conf import settings
from django.db import models, transaction from django.db import models, transaction
from django.db.models.functions import Length from django.db.models.functions import Length
from django.db.models import Count from django.db.models import Count
from django.http import StreamingHttpResponse
from django.urls import reverse
from django.utils import timezone from django.utils import timezone
from django.utils.decorators import method_decorator
from rest_framework import viewsets, views, mixins from rest_framework import viewsets, views, mixins
from rest_framework.decorators import detail_route, list_route from rest_framework.decorators import detail_route, list_route
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import settings as rest_settings from rest_framework import settings as rest_settings
from rest_framework import permissions
from musicbrainzngs import ResponseError from musicbrainzngs import ResponseError
from funkwhale_api.common import utils as funkwhale_utils from funkwhale_api.common import utils as funkwhale_utils
from funkwhale_api.common.permissions import ConditionalAuthentication from funkwhale_api.common.permissions import ConditionalAuthentication
from funkwhale_api.users.permissions import HasUserPermission from funkwhale_api.users.permissions import HasUserPermission
from taggit.models import Tag from taggit.models import Tag
from funkwhale_api.federation import actors
from funkwhale_api.federation.authentication import SignatureAuthentication from funkwhale_api.federation.authentication import SignatureAuthentication
from funkwhale_api.federation.models import LibraryTrack from funkwhale_api.federation.models import LibraryTrack
from funkwhale_api.musicbrainz import api from funkwhale_api.musicbrainz import api
......
from .client import api from .client import api
__all__ = ["api"]
from django.conf.urls import include, url from django.conf.urls import url
from rest_framework import routers from rest_framework import routers
from . import views from . import views
......
...@@ -2,7 +2,6 @@ from rest_framework import viewsets ...@@ -2,7 +2,6 @@ from rest_framework import viewsets
from rest_framework.views import APIView from rest_framework.views import APIView
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.decorators import list_route from rest_framework.decorators import list_route
import musicbrainzngs
from funkwhale_api.common.permissions import ConditionalAuthentication from funkwhale_api.common.permissions import ConditionalAuthentication
......
from django.conf import settings
from django.db import models from django.db import models
from django.db import transaction from django.db import transaction
from django.utils import timezone from django.utils import timezone
......
from django.conf import settings
from django.db import transaction from django.db import transaction
from rest_framework import serializers from rest_framework import serializers
from taggit.models import Tag
from funkwhale_api.common import preferences from funkwhale_api.common import preferences
from funkwhale_api.music.models import Track from funkwhale_api.music.models import Track
......
...@@ -2,15 +2,13 @@ from django.db.models import Count ...@@ -2,15 +2,13 @@ from django.db.models import Count
from django.db import transaction from django.db import transaction
from rest_framework import exceptions from rest_framework import exceptions
from rest_framework import generics, mixins, viewsets from rest_framework import mixins, viewsets
from rest_framework import status
from rest_framework.decorators import detail_route from rest_framework.decorators import detail_route
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.permissions import IsAuthenticatedOrReadOnly
from funkwhale_api.common import permissions from funkwhale_api.common import permissions
from funkwhale_api.common import fields from funkwhale_api.common import fields
from funkwhale_api.music.models import Track
from . import filters from . import filters
from . import models from . import models
......
from django.conf.urls import include, url from django.conf.urls import include, url
from funkwhale_api.music import views
urlpatterns = [ urlpatterns = [
url( url(
......
import threading import threading
from apiclient.discovery import build from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
from dynamic_preferences.registries import global_preferences_registry as registry from dynamic_preferences.registries import global_preferences_registry as registry
......
from django.conf.urls import include, url from django.conf.urls import url
from .views import APISearch, APISearchs from .views import APISearch, APISearchs
......
...@@ -7,7 +7,6 @@ from django.urls import reverse_lazy ...@@ -7,7 +7,6 @@ from django.urls import reverse_lazy
import persisting_theory import persisting_theory
from funkwhale_api.music import models from funkwhale_api.music import models
from funkwhale_api.taskapp.celery import require_instance
class RadioFilterRegistry(persisting_theory.Registry): class RadioFilterRegistry(persisting_theory.Registry):
......