c3nav.mapdata.cache → c3nav.mapdata.utils.cache

This commit is contained in:
Laura Klünder 2017-11-20 00:39:01 +01:00
parent 14330de29e
commit 116590b88f
10 changed files with 9 additions and 9 deletions

View file

@ -20,9 +20,9 @@ from django.utils.translation import ungettext_lazy
from c3nav.editor.models.changedobject import ApplyToInstanceError, ChangedObject from c3nav.editor.models.changedobject import ApplyToInstanceError, ChangedObject
from c3nav.editor.utils import is_created_pk from c3nav.editor.utils import is_created_pk
from c3nav.editor.wrappers import ModelInstanceWrapper, ModelWrapper from c3nav.editor.wrappers import ModelInstanceWrapper, ModelWrapper
from c3nav.mapdata.cache import changed_geometries
from c3nav.mapdata.models import LocationSlug, MapUpdate from c3nav.mapdata.models import LocationSlug, MapUpdate
from c3nav.mapdata.models.locations import LocationRedirect from c3nav.mapdata.models.locations import LocationRedirect
from c3nav.mapdata.utils.cache import changed_geometries
from c3nav.mapdata.utils.models import get_submodels from c3nav.mapdata.utils.models import get_submodels

View file

@ -5,5 +5,5 @@ class MapdataConfig(AppConfig):
name = 'c3nav.mapdata' name = 'c3nav.mapdata'
def ready(self): def ready(self):
from c3nav.mapdata.cache import register_signals from c3nav.mapdata.utils.cache import register_signals
register_signals() register_signals()

View file

@ -15,12 +15,12 @@ from shapely.geometry import JOIN_STYLE, LineString, MultiPolygon
from shapely.geometry.polygon import orient from shapely.geometry.polygon import orient
from shapely.ops import unary_union from shapely.ops import unary_union
from c3nav.mapdata.cache import changed_geometries
from c3nav.mapdata.fields import GeometryField from c3nav.mapdata.fields import GeometryField
from c3nav.mapdata.models import Level from c3nav.mapdata.models import Level
from c3nav.mapdata.models.access import AccessRestrictionMixin from c3nav.mapdata.models.access import AccessRestrictionMixin
from c3nav.mapdata.models.geometry.base import GeometryMixin from c3nav.mapdata.models.geometry.base import GeometryMixin
from c3nav.mapdata.models.locations import SpecificLocation from c3nav.mapdata.models.locations import SpecificLocation
from c3nav.mapdata.utils.cache import changed_geometries
from c3nav.mapdata.utils.geometry import (assert_multilinestring, assert_multipolygon, clean_cut_polygon, from c3nav.mapdata.utils.geometry import (assert_multilinestring, assert_multipolygon, clean_cut_polygon,
cut_polygon_with_line) cut_polygon_with_line)

View file

@ -5,10 +5,10 @@ from django.utils.text import format_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from shapely.geometry import CAP_STYLE, JOIN_STYLE, mapping from shapely.geometry import CAP_STYLE, JOIN_STYLE, mapping
from c3nav.mapdata.cache import changed_geometries
from c3nav.mapdata.fields import GeometryField from c3nav.mapdata.fields import GeometryField
from c3nav.mapdata.models.geometry.base import GeometryMixin from c3nav.mapdata.models.geometry.base import GeometryMixin
from c3nav.mapdata.models.locations import SpecificLocation from c3nav.mapdata.models.locations import SpecificLocation
from c3nav.mapdata.utils.cache import changed_geometries
from c3nav.mapdata.utils.json import format_geojson from c3nav.mapdata.utils.json import format_geojson

View file

@ -92,7 +92,7 @@ class MapUpdate(models.Model):
if not new_updates: if not new_updates:
return () return ()
from c3nav.mapdata.cache import changed_geometries from c3nav.mapdata.utils.cache import changed_geometries
changed_geometries.reset() changed_geometries.reset()
logger.info('Recalculating altitude areas...') logger.info('Recalculating altitude areas...')
@ -142,7 +142,7 @@ class MapUpdate(models.Model):
with suppress(FileExistsError): with suppress(FileExistsError):
os.mkdir(os.path.dirname(self._changed_geometries_filename())) os.mkdir(os.path.dirname(self._changed_geometries_filename()))
from c3nav.mapdata.cache import changed_geometries from c3nav.mapdata.utils.cache import changed_geometries
pickle.dump(changed_geometries, open(self._changed_geometries_filename(), 'wb')) pickle.dump(changed_geometries, open(self._changed_geometries_filename(), 'wb'))
transaction.on_commit( transaction.on_commit(

View file

@ -13,8 +13,8 @@ from shapely import prepared
from shapely.geometry import GeometryCollection, LineString, MultiLineString from shapely.geometry import GeometryCollection, LineString, MultiLineString
from shapely.ops import unary_union from shapely.ops import unary_union
from c3nav.mapdata.cache import MapHistory
from c3nav.mapdata.models import AltitudeArea, Level, MapUpdate from c3nav.mapdata.models import AltitudeArea, Level, MapUpdate
from c3nav.mapdata.utils.cache import MapHistory
from c3nav.mapdata.utils.geometry import assert_multipolygon, get_rings from c3nav.mapdata.utils.geometry import assert_multipolygon, get_rings
from c3nav.mapdata.utils.mesh import triangulate_polygon, triangulate_rings from c3nav.mapdata.utils.mesh import triangulate_polygon, triangulate_rings
from c3nav.mapdata.utils.mpl import shapely_to_mpl from c3nav.mapdata.utils.mpl import shapely_to_mpl

View file

@ -5,10 +5,10 @@ from django.utils.functional import cached_property
from shapely import prepared from shapely import prepared
from shapely.geometry import box from shapely.geometry import box
from c3nav.mapdata.cache import MapHistory
from c3nav.mapdata.models import Level, MapUpdate from c3nav.mapdata.models import Level, MapUpdate
from c3nav.mapdata.render.data import LevelRenderData, hybrid_union from c3nav.mapdata.render.data import LevelRenderData, hybrid_union
from c3nav.mapdata.render.engines.base import FillAttribs, StrokeAttribs from c3nav.mapdata.render.engines.base import FillAttribs, StrokeAttribs
from c3nav.mapdata.utils.cache import MapHistory
class MapRenderer: class MapRenderer:

View file

@ -11,11 +11,11 @@ from django.shortcuts import get_object_or_404
from django.views.decorators.http import etag from django.views.decorators.http import etag
from shapely.geometry import box from shapely.geometry import box
from c3nav.mapdata.cache import MapHistory
from c3nav.mapdata.middleware import no_language from c3nav.mapdata.middleware import no_language
from c3nav.mapdata.models import Level, MapUpdate, Source from c3nav.mapdata.models import Level, MapUpdate, Source
from c3nav.mapdata.render import MapRenderer, get_render_level_ids, get_tile_access_cookie, set_tile_access_cookie from c3nav.mapdata.render import MapRenderer, get_render_level_ids, get_tile_access_cookie, set_tile_access_cookie
from c3nav.mapdata.render.engines import ImageRenderEngine from c3nav.mapdata.render.engines import ImageRenderEngine
from c3nav.mapdata.utils.cache import MapHistory
@no_language() @no_language()

View file