Remove dead code about zoom_level

Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
stable
Gael UTARD 2012-04-01 01:12:17 +02:00 zatwierdzone przez Thomas Petazzoni
rodzic 8a6b15f924
commit e34791cd55
6 zmienionych plików z 10 dodań i 21 usunięć

Wyświetl plik

@ -178,8 +178,7 @@ def main():
% ', '.join(KNOWN_PAPER_SIZE_NAMES))
# Determine actual paper size
compat_papers = cls_renderer.get_compatible_paper_sizes(bbox,
stylesheet.zoom_level)
compat_papers = cls_renderer.get_compatible_paper_sizes(bbox)
if not compat_papers:
parser.error("No paper size compatible with this rendering.")

Wyświetl plik

@ -137,7 +137,6 @@ class Stylesheet:
self.name = None # str
self.path = None # str
self.description = '' # str
self.zoom_level = Stylesheet.DEFAULT_ZOOM_LEVEL
self.grid_line_color = 'black'
self.grid_line_alpha = 0.5
@ -169,7 +168,6 @@ class Stylesheet:
s.name = parser.get(section_name, 'name')
s.path = parser.get(section_name, 'path')
assign_if_present('description')
assign_if_present('zoom_level', int)
assign_if_present('grid_line_color')
assign_if_present('grid_line_alpha', float)

Wyświetl plik

@ -266,15 +266,13 @@ class Renderer:
return [ "png", "svgz", "pdf", "csv" ]
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
resolution_km_in_mm):
def get_compatible_paper_sizes(bounding_box, resolution_km_in_mm):
"""Returns a list of the compatible paper sizes for the given bounding
box. The list is sorted, smaller papers first, and a "custom" paper
matching the dimensions of the bounding box is added at the end.
Args:
bounding_box (coords.BoundingBox): the map geographic bounding box.
zoom_level (int): the Mapnik zoom level to use, generally 16.
resolution_km_in_mm (int): size of a geographic kilometer in
milimeters on the rendered map.

Wyświetl plik

@ -729,7 +729,7 @@ class MultiPageRenderer(Renderer):
# sizes. The goal is to render booklets, not posters.
# The default paper size is A4 portrait
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
def get_compatible_paper_sizes(bounding_box,
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM,
index_position=None, hsplit=1, vsplit=1):
valid_sizes = []

Wyświetl plik

@ -453,7 +453,7 @@ class SinglePageRenderer(Renderer):
cairo_surface.flush()
@staticmethod
def _generic_get_compatible_paper_sizes(bounding_box, zoom_level,
def _generic_get_compatible_paper_sizes(bounding_box,
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM, index_position = None):
"""Returns a list of the compatible paper sizes for the given bounding
box. The list is sorted, smaller papers first, and a "custom" paper
@ -461,7 +461,6 @@ class SinglePageRenderer(Renderer):
Args:
bounding_box (coords.BoundingBox): the map geographic bounding box.
zoom_level (int): the Mapnik zoom level to use, generally 16.
resolution_km_in_mm (int): size of a geographic kilometer in
milimeters on the rendered map.
index_position (str): None or 'side' (index on side),
@ -533,7 +532,7 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
def get_compatible_paper_sizes(bounding_box,
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
"""Returns a list of the compatible paper sizes for the given bounding
box. The list is sorted, smaller papers first, and a "custom" paper
@ -541,7 +540,6 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
Args:
bounding_box (coords.BoundingBox): the map geographic bounding box.
zoom_level (int): the Mapnik zoom level to use, generally 16.
resolution_km_in_mm (int): size of a geographic kilometer in
milimeters on the rendered map.
@ -550,7 +548,7 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
portrait mode.
"""
return SinglePageRenderer._generic_get_compatible_paper_sizes(
bounding_box, zoom_level, resolution_km_in_mm, None)
bounding_box, resolution_km_in_mm, None)
class SinglePageRendererIndexOnSide(SinglePageRenderer):
@ -569,7 +567,7 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, street_index, 'side')
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
def get_compatible_paper_sizes(bounding_box,
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
"""Returns a list of the compatible paper sizes for the given bounding
box. The list is sorted, smaller papers first, and a "custom" paper
@ -577,7 +575,6 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
Args:
bounding_box (coords.BoundingBox): the map geographic bounding box.
zoom_level (int): the Mapnik zoom level to use, generally 16.
resolution_km_in_mm (int): size of a geographic kilometer in
milimeters on the rendered map.
@ -586,7 +583,7 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
portrait mode.
"""
return SinglePageRenderer._generic_get_compatible_paper_sizes(
bounding_box, zoom_level, resolution_km_in_mm, 'side')
bounding_box, resolution_km_in_mm, 'side')
class SinglePageRendererIndexBottom(SinglePageRenderer):
@ -605,7 +602,7 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, file_prefix, 'bottom')
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
def get_compatible_paper_sizes(bounding_box,
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
"""Returns a list of the compatible paper sizes for the given bounding
box. The list is sorted, smaller papers first, and a "custom" paper
@ -613,7 +610,6 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
Args:
bounding_box (coords.BoundingBox): the map geographic bounding box.
zoom_level (int): the Mapnik zoom level to use, generally 16.
resolution_km_in_mm (int): size of a geographic kilometer in
milimeters on the rendered map.
@ -622,7 +618,7 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
portrait mode.
"""
return SinglePageRenderer._generic_get_compatible_paper_sizes(
bounding_box, zoom_level, resolution_km_in_mm, 'bottom')
bounding_box, resolution_km_in_mm, 'bottom')
if __name__ == '__main__':
@ -656,7 +652,6 @@ if __name__ == '__main__':
self.grid_line_color = 'black'
self.grid_line_alpha = 0.9
self.grid_line_width = 2
self.zoom_level = 16
self.shade_color = 'black'
self.shade_alpha = 0.7

Wyświetl plik

@ -200,7 +200,6 @@ if __name__ == '__main__':
class StylesheetMock:
def __init__(self):
self.path = '/home/sam/src/python/maposmatic/mapnik-osm/osm.xml'
self.zoom_level = 16
bbox = coords.BoundingBox(48.7148, 2.0155, 48.6950, 2.0670)
canvas = MapCanvas(StylesheetMock(), bbox, 297.0/210)