def __init__( self, *, url=None, headers=None, json_path=None, regexp_path=None, default_bg=0xFFFFFF, status_neopixel=None, json_transform=None, debug=False, ): self._debug = debug self.graphics = Graphics( default_bg=default_bg, auto_refresh=False, debug=debug, ) self.display = self.graphics.display self.network = Network( status_neopixel=status_neopixel, extract_values=False, debug=debug, ) self._url = None self.url = url self._headers = headers self._json_path = None self.json_path = json_path self._regexp_path = regexp_path self.splash = self.graphics.splash self.peripherals = Peripherals() # Add any JSON translators if json_transform: self.network.add_json_transform(json_transform) self._text = [] self._text_color = [] self._text_position = [] self._text_wrap = [] self._text_maxlen = [] self._text_transform = [] self._text_scale = [] self._text_font = [] self._text_line_spacing = [] self._text_anchor_point = [] gc.collect()
def __init__( self, *, url: Optional[str] = None, headers: Optional[Dict[str, str]] = None, json_path: Optional[Sequence[Any]] = None, regexp_path: Optional[Sequence[str]] = None, default_bg: Union[str, int] = 0xFFFFFF, status_neopixel: Optional[Union[microcontroller.Pin, neopixel.NeoPixel]] = None, json_transform: Union[Sequence[Callable], Callable] = None, rotation: int = 270, debug: bool = False, ) -> None: self.peripherals = Peripherals() if status_neopixel == board.NEOPIXEL: status_neopixel = self.peripherals.neopixels network = Network( status_neopixel=status_neopixel, extract_values=False, debug=debug, ) graphics = Graphics( default_bg=default_bg, auto_refresh=False, rotation=rotation, debug=debug, ) super().__init__( network, graphics, url=url, headers=headers, json_path=json_path, regexp_path=regexp_path, json_transform=json_transform, debug=debug, ) gc.collect()
def __init__( self, *, url=None, headers=None, json_path=None, regexp_path=None, default_bg=0xFFFFFF, status_neopixel=None, json_transform=None, rotation=270, debug=False, ): network = Network( status_neopixel=status_neopixel, extract_values=False, debug=debug, ) graphics = Graphics( default_bg=default_bg, auto_refresh=False, rotation=rotation, debug=debug, ) super().__init__( network, graphics, url=url, headers=headers, json_path=json_path, regexp_path=regexp_path, json_transform=json_transform, debug=debug, ) self.peripherals = Peripherals() gc.collect()
def __init__( self, *, url=None, headers=None, json_path=None, regexp_path=None, default_bg=0xFFFFFF, status_neopixel=None, json_transform=None, rotation=270, debug=False, ): self._debug = debug self.graphics = Graphics( default_bg=default_bg, auto_refresh=False, rotation=rotation, debug=debug, ) self.display = self.graphics.display self.network = Network( status_neopixel=status_neopixel, extract_values=False, debug=debug, ) self._url = None self.url = url self._headers = headers self._json_path = None self.json_path = json_path # Font Cache self._fonts = {} try: import alarm # pylint: disable=import-outside-toplevel self._alarm = alarm except ImportError: self._alarm = None self._regexp_path = regexp_path self.splash = self.graphics.splash self.peripherals = Peripherals() # Add any JSON translators if json_transform: self.network.add_json_transform(json_transform) self._text = [] self._text_color = [] self._text_position = [] self._text_wrap = [] self._text_maxlen = [] self._text_transform = [] self._text_scale = [] self._text_font = [] self._text_line_spacing = [] self._text_anchor_point = [] self._text_is_data = [] gc.collect()