Switch to full app paths
Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This solves name clashes with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
default_app_config = 'django_gpg.apps.DjangoGPGApp'
|
||||
default_app_config = 'mayan.apps.django_gpg.apps.DjangoGPGApp'
|
||||
|
||||
@@ -2,8 +2,8 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from rest_framework import generics
|
||||
|
||||
from rest_api.filters import MayanObjectPermissionsFilter
|
||||
from rest_api.permissions import MayanPermission
|
||||
from mayan.apps.rest_api.filters import MayanObjectPermissionsFilter
|
||||
from mayan.apps.rest_api.permissions import MayanPermission
|
||||
|
||||
from .models import Key
|
||||
from .permissions import (
|
||||
|
||||
@@ -2,13 +2,13 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from acls import ModelPermission
|
||||
from acls.links import link_acl_list
|
||||
from acls.permissions import permission_acl_edit, permission_acl_view
|
||||
from common import (
|
||||
from mayan.apps.acls import ModelPermission
|
||||
from mayan.apps.acls.links import link_acl_list
|
||||
from mayan.apps.acls.permissions import permission_acl_edit, permission_acl_view
|
||||
from mayan.apps.common import (
|
||||
MayanAppConfig, menu_facet, menu_object, menu_setup, menu_sidebar
|
||||
)
|
||||
from navigation import SourceColumn
|
||||
from mayan.apps.navigation import SourceColumn
|
||||
|
||||
from .classes import KeyStub
|
||||
from .links import (
|
||||
@@ -24,10 +24,11 @@ from .permissions import (
|
||||
|
||||
|
||||
class DjangoGPGApp(MayanAppConfig):
|
||||
app_url = 'gpg'
|
||||
app_namespace = 'django_gpg'
|
||||
app_url = 'keys'
|
||||
has_rest_api = True
|
||||
has_tests = True
|
||||
name = 'django_gpg'
|
||||
name = 'mayan.apps.django_gpg'
|
||||
verbose_name = _('Django GPG')
|
||||
|
||||
def ready(self):
|
||||
|
||||
@@ -6,7 +6,7 @@ import shutil
|
||||
|
||||
import gnupg
|
||||
|
||||
from common.utils import mkdtemp
|
||||
from mayan.apps.common.utils import mkdtemp
|
||||
|
||||
|
||||
class GPGBackend(object):
|
||||
|
||||
@@ -4,7 +4,7 @@ from django import forms
|
||||
from django.utils.html import escape
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.forms import DetailForm
|
||||
from mayan.apps.common.forms import DetailForm
|
||||
|
||||
from .models import Key
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from appearance.classes import Icon
|
||||
from mayan.apps.appearance.classes import Icon
|
||||
|
||||
icon_key_setup = Icon(driver_name='fontawesome', symbol='key')
|
||||
icon_key_upload = Icon(driver_name='fontawesome', symbol='upload')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from common.classes import Package
|
||||
from mayan.apps.common.classes import Package
|
||||
|
||||
Package(label='python-gnupg', license_text='''
|
||||
Copyright (c) 2008-2014 by Vinay Sajip.
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation import Link
|
||||
from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import icon_key_setup, icon_key_upload, icon_keyserver_search
|
||||
from .permissions import (
|
||||
|
||||
@@ -6,7 +6,7 @@ import os
|
||||
|
||||
from django.db import models
|
||||
|
||||
from common.utils import mkstemp
|
||||
from mayan.apps.common.utils import mkstemp
|
||||
|
||||
from .classes import KeyStub, SignatureVerification
|
||||
from .exceptions import (
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from permissions import PermissionNamespace
|
||||
from mayan.apps.permissions import PermissionNamespace
|
||||
|
||||
namespace = PermissionNamespace('django_gpg', _('Key management'))
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from django.utils.module_loading import import_string
|
||||
from .settings import setting_gpg_path
|
||||
|
||||
# TODO: This will become an setting option in 2.2
|
||||
SETTING_GPG_BACKEND = 'django_gpg.classes.PythonGNUPGBackend'
|
||||
SETTING_GPG_BACKEND = 'mayan.apps.django_gpg.classes.PythonGNUPGBackend'
|
||||
|
||||
gpg_backend = import_string(SETTING_GPG_BACKEND)(
|
||||
binary_path=setting_gpg_path.value
|
||||
|
||||
@@ -5,7 +5,7 @@ import os
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings import Namespace
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
|
||||
namespace = Namespace(name='django_gpg', label=_('Signatures'))
|
||||
setting_gpg_home = namespace.add_setting(
|
||||
|
||||
@@ -4,7 +4,7 @@ from django.test import override_settings
|
||||
|
||||
from rest_framework import status
|
||||
|
||||
from rest_api.tests import BaseAPITestCase
|
||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||
|
||||
from ..models import Key
|
||||
from ..permissions import (
|
||||
|
||||
@@ -7,8 +7,8 @@ import mock
|
||||
|
||||
from django.utils.encoding import force_bytes
|
||||
|
||||
from common.tests import BaseTestCase
|
||||
from common.utils import TemporaryFile
|
||||
from mayan.apps.common.tests import BaseTestCase
|
||||
from mayan.apps.common.utils import TemporaryFile
|
||||
|
||||
from ..exceptions import (
|
||||
DecryptionError, KeyDoesNotExist, NeedPassphrase, PassphraseError,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django_downloadview.test import assert_download_response
|
||||
|
||||
from common.tests import GenericViewTestCase
|
||||
from mayan.apps.common.tests import GenericViewTestCase
|
||||
|
||||
from ..models import Key
|
||||
from ..permissions import permission_key_download, permission_key_upload
|
||||
|
||||
@@ -8,7 +8,7 @@ from django.template import RequestContext
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.generics import (
|
||||
from mayan.apps.common.generics import (
|
||||
ConfirmView, SingleObjectCreateView, SingleObjectDeleteView,
|
||||
SingleObjectDetailView, SingleObjectDownloadView, SingleObjectListView,
|
||||
SimpleView
|
||||
|
||||
Reference in New Issue
Block a user