basic stuff for loading map data
This commit is contained in:
parent
2d639d595a
commit
c4287e110c
4 changed files with 66 additions and 9 deletions
|
@ -1,4 +1,19 @@
|
|||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from django.core.checks import Warning, register
|
||||
|
||||
from . import mapmanager
|
||||
|
||||
|
||||
@register()
|
||||
def has_map_data_check(app_configs, **kwargs):
|
||||
if not settings.MAP_DIRS:
|
||||
return [Warning(
|
||||
'There are no map data directories configured.',
|
||||
hint='Add mapdirs=/path/to/directory to your c3nav.cfg.',
|
||||
id='mapdata.W001',
|
||||
)]
|
||||
return []
|
||||
|
||||
|
||||
class MapdataConfig(AppConfig):
|
||||
|
@ -6,4 +21,5 @@ class MapdataConfig(AppConfig):
|
|||
verbose_name = 'map data manager'
|
||||
|
||||
def ready(self):
|
||||
pass
|
||||
for map_dir in settings.MAP_DIRS:
|
||||
mapmanager.add_map_dir(map_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue