source: src/mapservice/server_impl/tasks/tileconfig.py@ 8818b65

debian/bullseye
Last change on this file since 8818b65 was 7be94aa, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago
  • Added yapf style config (src/python-style.yapf)
    • Updated all files to the yapf formatted version
  • Property mode set to 100644
File size: 1.7 KB
Line 
1# -*- coding: utf-8 -*-
2'''
3 Copyright (C) 2020 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17'''
18
19try:
20 from dataclasses import dataclass
21
22 @dataclass
23 class TileConfig:
24 cache_path: str
25 sizes: Array[int]
26 densities: Array[int]
27 densitiy_base: int
28 points_age_max: int
29 zoom_range: Array[int]
30 raster_file_size_max: [int]
31 skip_empty: bool
32
33except ImportError:
34
35 class TileConfig:
36 """
37 Workaround for @dataclass, until python 3.7 is available in main distros
38 """
39 def __init__(
40 self, cache_path, sizes, densities, densitiy_base, points_age_max,
41 zoom_range, raster_file_size_max, skip_empty
42 ):
43 self.cache_path = cache_path
44 self.sizes = sizes
45 self.densities = densities
46 self.densitiy_base = densitiy_base
47 self.points_age_max = points_age_max
48 self.zoom_range = zoom_range
49 self.raster_file_size_max = raster_file_size_max
50 self.skip_empty = skip_empty
Note: See TracBrowser for help on using the repository browser.