From 04da18d5f63b9c4f22ec22c8cea8dbeb3a56d084 Mon Sep 17 00:00:00 2001 From: Raphael Das Gupta Date: Tue, 9 May 2017 15:06:44 +0200 Subject: [PATCH] refactoring: #845 rename module "statuses" to "status" --- osmaxx/conversion/constants/{statuses.py => status.py} | 0 osmaxx/conversion/management/commands/result_harvester.py | 2 +- osmaxx/conversion/models.py | 2 +- osmaxx/excerptexport/models/export.py | 2 +- osmaxx/excerptexport/views.py | 4 ++-- 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 +- tests/excerptexport/test_conversion_api_client.py | 2 +- tests/excerptexport/test_models.py | 2 +- tests/job_progress/test_job_progress.py | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) rename osmaxx/conversion/constants/{statuses.py => status.py} (100%) diff --git a/osmaxx/conversion/constants/statuses.py b/osmaxx/conversion/constants/status.py similarity index 100% rename from osmaxx/conversion/constants/statuses.py rename to osmaxx/conversion/constants/status.py diff --git a/osmaxx/conversion/management/commands/result_harvester.py b/osmaxx/conversion/management/commands/result_harvester.py index 59997ab06..aac86ba54 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.statuses import FINAL_STATUSES, FINISHED, FAILED +from osmaxx.conversion.constants.status import FINAL_STATUSES, FINISHED, FAILED logging.basicConfig() logger = logging.getLogger(__name__) diff --git a/osmaxx/conversion/models.py b/osmaxx/conversion/models.py index bd3165559..ed5a4ca32 100644 --- a/osmaxx/conversion/models.py +++ b/osmaxx/conversion/models.py @@ -12,7 +12,7 @@ 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.formats import FORMAT_CHOICES -from osmaxx.conversion.constants.statuses import STATUS_CHOICES, RECEIVED +from osmaxx.conversion.constants.status import STATUS_CHOICES, RECEIVED def job_directory_path(instance, filename): diff --git a/osmaxx/excerptexport/models/export.py b/osmaxx/excerptexport/models/export.py index 18aca9415..8c09e2db9 100644 --- a/osmaxx/excerptexport/models/export.py +++ b/osmaxx/excerptexport/models/export.py @@ -41,7 +41,7 @@ class Export(TimeStampModelMixin, models.Model): - the transformation of the data from the data sources' schemata (e.g. ``osm2pgsql`` schema) to the OSMaxx schema - the actual export to one specific GIS or navigation file format with one specific set of parameters """ - from osmaxx.conversion.constants.statuses import RECEIVED, QUEUED, FINISHED, FAILED, STARTED, DEFERRED, FINAL_STATUSES, STATUS_CHOICES # noqa + from osmaxx.conversion.constants.status import RECEIVED, QUEUED, FINISHED, FAILED, STARTED, DEFERRED, FINAL_STATUSES, STATUS_CHOICES # noqa INITIAL = 'initial' INITIAL_CHOICE = (INITIAL, _('initial')) STATUS_CHOICES = (INITIAL_CHOICE,) + STATUS_CHOICES diff --git a/osmaxx/excerptexport/views.py b/osmaxx/excerptexport/views.py index e9e219d47..eec0f3579 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 statuses +from osmaxx.conversion.constants import status from osmaxx.excerptexport.forms import ExcerptForm, ExistingForm from osmaxx.excerptexport.models import Excerpt from osmaxx.excerptexport.models import ExtractionOrder @@ -70,7 +70,7 @@ def get_object(self, queryset=None): class ExportsListMixin: - _filterable_statuses = frozenset({statuses.FINISHED, statuses.FAILED}) + _filterable_statuses = frozenset({status.FINISHED, status.FAILED}) @property def excerpt_ids(self): diff --git a/osmaxx/job_progress/middleware.py b/osmaxx/job_progress/middleware.py index b527ba3bb..86419a8c4 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.statuses import FINAL_STATUSES, FAILED +from osmaxx.conversion.constants.status import FINAL_STATUSES, FAILED 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 e5146e18a..787a5167a 100644 --- a/tests/conversion/conftest.py +++ b/tests/conversion/conftest.py @@ -8,7 +8,7 @@ import osmaxx.conversion.constants.formats from osmaxx.conversion.converters.converter_gis import detail_levels from osmaxx.conversion.constants import coordinate_reference_systems as crs -from osmaxx.conversion.constants.statuses import STARTED, FAILED, FINISHED +from osmaxx.conversion.constants.status import STARTED, FAILED, FINISHED format_list = osmaxx.conversion.constants.formats.FORMAT_DEFINITIONS.keys() diff --git a/tests/conversion/management/commands/result_harvester_test.py b/tests/conversion/management/commands/result_harvester_test.py index 342babc78..b2b1cc9e7 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.statuses import STARTED +from osmaxx.conversion.constants.status import STARTED @pytest.fixture diff --git a/tests/conversion/model_test.py b/tests/conversion/model_test.py index 9be5de96f..ea3a1835d 100644 --- a/tests/conversion/model_test.py +++ b/tests/conversion/model_test.py @@ -2,7 +2,7 @@ import pytest -from osmaxx.conversion.constants.statuses import STARTED, FAILED, FINISHED +from osmaxx.conversion.constants.status import STARTED, FAILED, FINISHED @pytest.mark.django_db() diff --git a/tests/conversion/view_test.py b/tests/conversion/view_test.py index 73548e999..117408d47 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.statuses import RECEIVED +from osmaxx.conversion.constants.status import RECEIVED authenticated_access_urls = [ reverse('clipping_area-list'), diff --git a/tests/excerptexport/test_conversion_api_client.py b/tests/excerptexport/test_conversion_api_client.py index 14838715a..0c8ade1e2 100644 --- a/tests/excerptexport/test_conversion_api_client.py +++ b/tests/excerptexport/test_conversion_api_client.py @@ -10,7 +10,7 @@ from osmaxx.api_client import ConversionApiClient, API_client from osmaxx.conversion.constants.formats import FGDB, SPATIALITE -from osmaxx.conversion.constants.statuses import RECEIVED +from osmaxx.conversion.constants.status import RECEIVED 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 74b8a223d..73cf4e531 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.constants.formats import GARMIN -from osmaxx.conversion.constants.statuses import FINISHED +from osmaxx.conversion.constants.status import FINISHED from osmaxx.excerptexport import models diff --git a/tests/job_progress/test_job_progress.py b/tests/job_progress/test_job_progress.py index 387ac50de..1c9251624 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.statuses import STARTED, QUEUED, FINISHED, FAILED +from osmaxx.conversion.constants.status import STARTED, QUEUED, FINISHED, FAILED from osmaxx.excerptexport.models.excerpt import Excerpt from osmaxx.excerptexport.models.export import Export from osmaxx.excerptexport.models.extraction_order import ExtractionOrder