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/tmp
|
||||
data/users/**
|
||||
data/**
|
||||
|
||||
#these files are under app/static but they get copied to the outside directory on startup
|
||||
logging.conf
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ async def save_carpool(carpool, folder: str = 'data/carpool'):
|
|||
|
||||
|
||||
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:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ class AgencyService:
|
|||
|
||||
def __init__(self):
|
||||
self.agencies: Dict[str, Agency] = {}
|
||||
|
||||
for agency_file_name in glob('conf/agency/*.json'):
|
||||
for agency_file_name in glob('data/agency/*.json'):
|
||||
with open(agency_file_name) as agency_file:
|
||||
dict = json.load(agency_file)
|
||||
agency = Agency(**dict)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ class Config(BaseSettings):
|
|||
ride2go_query_data: str
|
||||
env: str = 'DEV'
|
||||
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')
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ class RegionService:
|
|||
|
||||
def __init__(self):
|
||||
self.regions: Dict[str, Region] = {}
|
||||
|
||||
for region_file_name in glob('conf/region/*.json'):
|
||||
for region_file_name in glob('data/region/*.json'):
|
||||
with open(region_file_name) as region_file:
|
||||
dict = json.load(region_file)
|
||||
region = Region(**dict)
|
||||
|
|
|
|||
Loading…
Reference in a new issue