X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;ds=inline;f=page_builder.py;h=235f51192debddc5ca851bdc1ea39334b3c37693;hb=05b56fa9d94c3dac31c08b28b8e6adfe7d8d2a4a;hp=fa800d8cf4fb3f6c0f1d5bd1ea3958b6c8dab1c9;hpb=5e241dc47e497c547463cecc07946ea6882835a7;p=kiosk.git diff --git a/page_builder.py b/page_builder.py index fa800d8..235f511 100644 --- a/page_builder.py +++ b/page_builder.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys @@ -17,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: @@ -45,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("