From e2a518bfe76a3f54586d9832b938c3bf2980a474 Mon Sep 17 00:00:00 2001 From: Raphael Das Gupta Date: Fri, 12 May 2017 14:44:41 +0200 Subject: [PATCH] refactoring: #845 add and use convenience import for module "status" --- osmaxx/conversion/__init__.py | 4 ++-- osmaxx/conversion/management/commands/result_harvester.py | 2 +- osmaxx/conversion/models.py | 2 +- osmaxx/excerptexport/models/export.py | 2 +- osmaxx/excerptexport/views.py | 2 +- osmaxx/job_progress/middleware.py | 2 +- tests/conversion/conftest.py | 2 +- tests/conversion/management/commands/result_harvester_test.py | 2 +- tests/conversion/model_test.py | 2 +- tests/conversion/view_test.py | 2 +- .../middleware/test_update_exports_of_request_user.py | 2 +- tests/excerptexport/models/test_export_model.py | 2 +- tests/excerptexport/test_conversion_api_client.py | 2 +- tests/excerptexport/test_models.py | 2 +- tests/job_progress/test_job_progress.py | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osmaxx/conversion/__init__.py b/osmaxx/conversion/__init__.py index df64b7849..baf8706f2 100644 --- a/osmaxx/conversion/__init__.py +++ b/osmaxx/conversion/__init__.py @@ -1,5 +1,5 @@ -from .constants import output_format +from .constants import output_format, status default_app_config = 'osmaxx.conversion.apps.ConversionConfig' -__all__ = ['default_app_config', 'output_format'] +__all__ = ['default_app_config', 'output_format', 'status'] diff --git a/osmaxx/conversion/management/commands/result_harvester.py b/osmaxx/conversion/management/commands/result_harvester.py index 0f410173d..68567b19a 100644 --- a/osmaxx/conversion/management/commands/result_harvester.py +++ b/osmaxx/conversion/management/commands/result_harvester.py @@ -12,7 +12,7 @@ from osmaxx.conversion import models as conversion_models from osmaxx.conversion._settings import CONVERSION_SETTINGS -from osmaxx.conversion.constants import status +from osmaxx.conversion import status logging.basicConfig() logger = logging.getLogger(__name__) diff --git a/osmaxx/conversion/models.py b/osmaxx/conversion/models.py index 8e899d723..b6c27a27e 100644 --- a/osmaxx/conversion/models.py +++ b/osmaxx/conversion/models.py @@ -12,7 +12,7 @@ from osmaxx.conversion.converters.converter import convert from osmaxx.conversion.converters.converter_gis.detail_levels import DETAIL_LEVEL_CHOICES, DETAIL_LEVEL_ALL from osmaxx.conversion.constants.coordinate_reference_systems import CRS_CHOICES -from osmaxx.conversion.constants import status +from osmaxx.conversion import status def job_directory_path(instance, filename): diff --git a/osmaxx/excerptexport/models/export.py b/osmaxx/excerptexport/models/export.py index c71eb7254..2fc34f197 100644 --- a/osmaxx/excerptexport/models/export.py +++ b/osmaxx/excerptexport/models/export.py @@ -9,7 +9,7 @@ from rest_framework.reverse import reverse from osmaxx.conversion import output_format -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport._settings import RESULT_FILE_AVAILABILITY_DURATION, EXTRACTION_PROCESSING_TIMEOUT_TIMEDELTA logger = logging.getLogger(__name__) diff --git a/osmaxx/excerptexport/views.py b/osmaxx/excerptexport/views.py index b93dd092f..a5b484391 100644 --- a/osmaxx/excerptexport/views.py +++ b/osmaxx/excerptexport/views.py @@ -14,7 +14,7 @@ from django.views.generic.list import ListView from osmaxx.contrib.auth.frontend_permissions import EmailRequiredMixin -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport.forms import ExcerptForm, ExistingForm from osmaxx.excerptexport.models import Excerpt from osmaxx.excerptexport.models import ExtractionOrder diff --git a/osmaxx/job_progress/middleware.py b/osmaxx/job_progress/middleware.py index e1f698f28..caa8915cd 100644 --- a/osmaxx/job_progress/middleware.py +++ b/osmaxx/job_progress/middleware.py @@ -5,7 +5,7 @@ from requests import HTTPError from osmaxx.api_client import ConversionApiClient -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport.models import Export from osmaxx.utils.shortcuts import get_cached_or_set diff --git a/tests/conversion/conftest.py b/tests/conversion/conftest.py index e49bce352..86617a94d 100644 --- a/tests/conversion/conftest.py +++ b/tests/conversion/conftest.py @@ -8,7 +8,7 @@ from osmaxx.conversion import output_format from osmaxx.conversion.converters.converter_gis import detail_levels from osmaxx.conversion.constants import coordinate_reference_systems as crs -from osmaxx.conversion.constants import status +from osmaxx.conversion import status format_list = output_format.DEFINITIONS.keys() diff --git a/tests/conversion/management/commands/result_harvester_test.py b/tests/conversion/management/commands/result_harvester_test.py index b79363401..6f0d26667 100644 --- a/tests/conversion/management/commands/result_harvester_test.py +++ b/tests/conversion/management/commands/result_harvester_test.py @@ -3,7 +3,7 @@ import pytest -from osmaxx.conversion.constants import status +from osmaxx.conversion import status @pytest.fixture diff --git a/tests/conversion/model_test.py b/tests/conversion/model_test.py index b098762bb..9dab96fda 100644 --- a/tests/conversion/model_test.py +++ b/tests/conversion/model_test.py @@ -2,7 +2,7 @@ import pytest -from osmaxx.conversion.constants import status +from osmaxx.conversion import status @pytest.mark.django_db() diff --git a/tests/conversion/view_test.py b/tests/conversion/view_test.py index 8ebfb1585..0c1982a77 100644 --- a/tests/conversion/view_test.py +++ b/tests/conversion/view_test.py @@ -1,7 +1,7 @@ import pytest from rest_framework.reverse import reverse -from osmaxx.conversion.constants import status +from osmaxx.conversion import status authenticated_access_urls = [ reverse('clipping_area-list'), diff --git a/tests/excerptexport/middleware/test_update_exports_of_request_user.py b/tests/excerptexport/middleware/test_update_exports_of_request_user.py index dae88cd1d..054fa9896 100644 --- a/tests/excerptexport/middleware/test_update_exports_of_request_user.py +++ b/tests/excerptexport/middleware/test_update_exports_of_request_user.py @@ -2,7 +2,7 @@ import requests from osmaxx.api_client import ConversionApiClient -from osmaxx.conversion.constants import status +from osmaxx.conversion import status @pytest.fixture diff --git a/tests/excerptexport/models/test_export_model.py b/tests/excerptexport/models/test_export_model.py index 5b0ec0ac9..c8404778f 100644 --- a/tests/excerptexport/models/test_export_model.py +++ b/tests/excerptexport/models/test_export_model.py @@ -4,7 +4,7 @@ from django.utils import timezone -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport.models.export import TimeStampModelMixin from osmaxx.excerptexport._settings import EXTRACTION_PROCESSING_TIMEOUT_TIMEDELTA diff --git a/tests/excerptexport/test_conversion_api_client.py b/tests/excerptexport/test_conversion_api_client.py index cd0736123..b6bbebf17 100644 --- a/tests/excerptexport/test_conversion_api_client.py +++ b/tests/excerptexport/test_conversion_api_client.py @@ -10,7 +10,7 @@ from osmaxx.conversion import output_format from osmaxx.api_client import ConversionApiClient, API_client -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport.models import Excerpt, ExtractionOrder from osmaxx.job_progress.views import tracker from tests.test_helpers import vcr_explicit_path as vcr diff --git a/tests/excerptexport/test_models.py b/tests/excerptexport/test_models.py index a66a2caac..3e175a5ee 100644 --- a/tests/excerptexport/test_models.py +++ b/tests/excerptexport/test_models.py @@ -4,7 +4,7 @@ from hamcrest import assert_that, contains_inanyorder as contains_in_any_order from osmaxx.conversion import output_format -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport import models diff --git a/tests/job_progress/test_job_progress.py b/tests/job_progress/test_job_progress.py index 8e4948ca3..3836c0830 100644 --- a/tests/job_progress/test_job_progress.py +++ b/tests/job_progress/test_job_progress.py @@ -13,7 +13,7 @@ from osmaxx import excerptexport from osmaxx.api_client.conversion_api_client import ConversionApiClient -from osmaxx.conversion.constants import status +from osmaxx.conversion import status from osmaxx.excerptexport.models.excerpt import Excerpt from osmaxx.excerptexport.models.export import Export from osmaxx.excerptexport.models.extraction_order import ExtractionOrder