renderers: add a get_compatible_output_formats() method

The single page renderers can output PNG, SVGZ, PDF and CSV, but by
design, the multi page renderer can only output PDF and CSV. So we
introduce a get_compatible_output_formats() in the renderer class so
that users of OcitySMap2 can find out which formats are possible
depending on the choosen layout.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
stable
Thomas Petazzoni 2012-03-31 19:22:30 +02:00
rodzic 58beafb881
commit 1869b9c5fd
2 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -295,6 +295,10 @@ class Renderer:
"""
raise NotImplementedError
@staticmethod
def get_compatible_output_formats():
return [ "png", "svgz", "pdf", "csv" ]
@staticmethod
def get_compatible_paper_sizes(bounding_box, zoom_level,
resolution_km_in_mm):

Wyświetl plik

@ -664,6 +664,11 @@ class MultiPageRenderer(Renderer):
def _paper_pt_to_geo_m(self, paper_pt):
return self._paper_mm_to_geo_m(commons.convert_pt_to_mm(paper_pt))
# In multi-page mode, we only render pdf and csv formats
@staticmethod
def get_compatible_output_formats():
return [ "pdf", "csv" ]
# In multi-page mode, we only accept A4, A5 and US letter as paper
# sizes. The goal is to render booklets, not posters.
@staticmethod