Use /data for region and agency configuration
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good
This commit is contained in:
parent
6af3250bea
commit
66cc746937
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -145,6 +145,7 @@ data/gtfs/
|
||||||
data/grfs
|
data/grfs
|
||||||
data/tmp
|
data/tmp
|
||||||
data/users/**
|
data/users/**
|
||||||
|
data/**
|
||||||
|
|
||||||
#these files are under app/static but they get copied to the outside directory on startup
|
#these files are under app/static but they get copied to the outside directory on startup
|
||||||
logging.conf
|
logging.conf
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ async def save_carpool(carpool, folder: str = 'data/carpool'):
|
||||||
|
|
||||||
|
|
||||||
async def assert_agency_exists(agency_id: str):
|
async def assert_agency_exists(agency_id: str):
|
||||||
agency_exists = os.path.exists(f"conf/agency/{agency_id}.json")
|
agency_exists = os.path.exists(f"data/agency/{agency_id}.json")
|
||||||
if not agency_exists:
|
if not agency_exists:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_404_NOT_FOUND,
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ class AgencyService:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.agencies: Dict[str, Agency] = {}
|
self.agencies: Dict[str, Agency] = {}
|
||||||
|
for agency_file_name in glob('data/agency/*.json'):
|
||||||
for agency_file_name in glob('conf/agency/*.json'):
|
|
||||||
with open(agency_file_name) as agency_file:
|
with open(agency_file_name) as agency_file:
|
||||||
dict = json.load(agency_file)
|
dict = json.load(agency_file)
|
||||||
agency = Agency(**dict)
|
agency = Agency(**dict)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@ class Config(BaseSettings):
|
||||||
ride2go_query_data: str
|
ride2go_query_data: str
|
||||||
env: str = 'DEV'
|
env: str = 'DEV'
|
||||||
graphhopper_base_url: str = 'https://api.mfdz.de/gh'
|
graphhopper_base_url: str = 'https://api.mfdz.de/gh'
|
||||||
stop_sources_file: str = 'conf/stop_sources.json'
|
stop_sources_file: str = 'data/stop_sources.json'
|
||||||
|
|
||||||
config = Config(_env_file='config', _env_file_encoding='utf-8')
|
config = Config(_env_file='config', _env_file_encoding='utf-8')
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ class RegionService:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.regions: Dict[str, Region] = {}
|
self.regions: Dict[str, Region] = {}
|
||||||
|
for region_file_name in glob('data/region/*.json'):
|
||||||
for region_file_name in glob('conf/region/*.json'):
|
|
||||||
with open(region_file_name) as region_file:
|
with open(region_file_name) as region_file:
|
||||||
dict = json.load(region_file)
|
dict = json.load(region_file)
|
||||||
region = Region(**dict)
|
region = Region(**dict)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue