X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=page_builder.py;h=235f51192debddc5ca851bdc1ea39334b3c37693;hb=8662cd30375579ae858104e8d1a11e1c9b6ce17b;hp=4aa72fe85f9851f9d221ce6be4fb73971834f952;hpb=78b904e30bc0f9a05a96da1b597ad11795afbd46;p=kiosk.git diff --git a/page_builder.py b/page_builder.py index 4aa72fe..235f511 100644 --- a/page_builder.py +++ b/page_builder.py @@ -1,5 +1,8 @@ +#!/usr/bin/env python3 + import sys + class page_builder(object): LAYOUT_AUTO = 0 LAYOUT_ONE_ITEM = 1 @@ -16,27 +19,27 @@ class page_builder(object): self.debug_info = None self.custom_html = None - def set_layout(self, layout): + def set_layout(self, layout: int): self.layout = layout return self - def set_title(self, title): + def set_title(self, title: str): self.title = title return self - def set_style(self, style): + def set_style(self, style: str): self.style = style return self - def add_item(self, item): + def add_item(self, item: str): self.items.append(item) return self - def set_debug_info(self, debug_info): + def set_debug_info(self, debug_info: bool): self.debug_info = debug_info return self - def __pick_layout(self): + def __pick_layout(self) -> None: if len(self.items) == 1: self.layout = page_builder.LAYOUT_ONE_ITEM elif len(self.items) <= 4: @@ -44,21 +47,21 @@ class page_builder(object): else: self.layout = page_builder.LAYOUT_MANY_ITEMS - def __render_custom_html(self, f): + def __render_custom_html(self, f) -> None: if self.custom_html is not None: f.write(self.custom_html) - def __render_header(self, f): + def __render_header(self, f) -> None: if self.title is not None: f.write("