mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 19:36:20 -05:00
Allowing maintainer to change special directories.
This commit is contained in:
parent
00fe799b8f
commit
b05b2e7a6d
17 changed files with 499 additions and 195 deletions
|
|
@ -9,7 +9,7 @@ from sqlalchemy.orm import Session
|
|||
from modules.map.models import MapFile
|
||||
from wrolpi import flags
|
||||
from wrolpi.cmd import SUDO_BIN
|
||||
from wrolpi.common import get_media_directory, walk, logger
|
||||
from wrolpi.common import get_media_directory, walk, logger, get_wrolpi_config
|
||||
from wrolpi.dates import now, timedelta_to_timestamp, seconds_to_timestamp
|
||||
from wrolpi.db import optional_session, get_db_session
|
||||
from wrolpi.events import Events
|
||||
|
|
@ -23,14 +23,14 @@ IMPORTING = Manager().dict(dict(
|
|||
|
||||
|
||||
def get_map_directory() -> Path:
|
||||
map_directory = get_media_directory() / 'map'
|
||||
map_directory = get_media_directory() / get_wrolpi_config().map_directory
|
||||
if not map_directory.is_dir():
|
||||
map_directory.mkdir()
|
||||
map_directory.mkdir(parents=True)
|
||||
return map_directory
|
||||
|
||||
|
||||
def is_pbf_file(pbf: Path) -> bool:
|
||||
"""Uses file command to check type of a file. Returns True if a file is an OpenStreetMap PBF file."""
|
||||
"""Uses file command to check type of file. Returns True if a file is an OpenStreetMap PBF file."""
|
||||
cmd = ('/usr/bin/file', pbf)
|
||||
try:
|
||||
output = subprocess.check_output(cmd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue