Ignore:
Timestamp:
Apr 26, 2020, 5:02:25 PM (7 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
62569d9
Parents:
691c4ca
Message:
  • Adapted code_generator to
    • handle several packages
    • to configure the port from yaml specification
    • to use the VERSION used by setup.py
  • Added deviceservice.yaml with first version of webservice
  • Moved Config loader and HttpErrors to gnuboat.common
  • Moved rrd archive schema to gnuboat.common.device
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnuboat/mapservice_impl/controllers/TilesController.py

    r691c4ca rf9321aa  
    2020import os
    2121
    22 from gnuboat.mapservice_impl.HttpErrors import (
    23     MapserviceInternalServerError, MapserviceBadRequest, MapserviceNotFound
     22from gnuboat.common.webservice.HttpErrors import (
     23    GnuboatInternalServerError, GnuboatBadRequest, GnuboatNotFound
    2424)
    2525
    … …  
    2929        flask.current_app.config['TILES_CACHE_PATH'], os.R_OK
    3030    ):
    31         raise MapserviceInternalServerError(
     31        raise GnuboatInternalServerError(
    3232            detail='TILES_CACHE_PATH not configured or not accessible'
    3333        )
    … …  
    3535
    3636    if 'TILES_DENSITIES' not in flask.current_app.config:
    37         raise MapserviceInternalServerError(
    38             details='TILES_DENSITIES not configured'
     37        raise GnuboatInternalServerError(
     38            detail='TILES_DENSITIES not configured'
    3939        )
    4040    tiles_densities = flask.current_app.config['TILES_DENSITIES']
    4141
    4242    if 'TILES_DENSITY_BASEE' not in flask.current_app.config:
    43         raise MapserviceInternalServerError(
    44             details='TILES_DENSITY_BASEE not configured'
     43        raise GnuboatInternalServerError(
     44            detail='TILES_DENSITY_BASEE not configured'
    4545        )
    4646    tiles_densitiy_base = flask.current_app.config['TILES_DENSITY_BASEE']
    4747
    4848    if 'TILES_SKIP_EMPTY' not in flask.current_app.config:
    49         raise MapserviceInternalServerError(
    50             details='TILES_SKIP_EMPTY not configured'
     49        raise GnuboatInternalServerError(
     50            detail='TILES_SKIP_EMPTY not configured'
    5151        )
    5252    tiles_skip_empty = flask.current_app.config['TILES_SKIP_EMPTY']
    … …  
    5757        accuracy = '{}_{}'.format(min(tiles_densities), tiles_densitiy_base)
    5858    else:
    59         raise MapserviceBadRequest(
    60             details=('No valid accuracy requested. '
     59        raise GnuboatBadRequest(
     60            detail=('No valid accuracy requested. '
    6161                     'Valid are high, low. Requested was: {}')
    6262            .format(accuracy)
    … …  
    7373    if not os.path.isfile(tile_path):
    7474        if not tiles_skip_empty or not os.path.isfile(tile__empty_path):
    75             raise MapserviceNotFound(
     75            raise GnuboatNotFound(
    7676                detail=('Tile ({}, {}) for accuracy {} with resolution {} '
    7777                        'at zoomlevel {} not found')
Note: See TracChangeset for help on using the changeset viewer.