pyfax ===== .. py:module:: pyfax .. autoapi-nested-parse:: pyfax: a Python library for generating teletext tti files. Subpackages ----------- .. toctree:: :maxdepth: 1 /docs/pyfax/pages/index /docs/pyfax/tools/index Submodules ---------- .. toctree:: :maxdepth: 1 /docs/pyfax/_config/index /docs/pyfax/page/index /docs/pyfax/version/index Attributes ---------- .. autoapisummary:: pyfax.config pyfax.__version__ Classes ------- .. autoapisummary:: pyfax.Color pyfax.Line pyfax.Page Package Contents ---------------- .. py:data:: config .. py:class:: Color(*args, **kwds) Bases: :py:obj:`enum.Enum` Enum to store colors. .. py:attribute:: DEFAULT :value: 0 .. py:attribute:: WHITE :value: 1 .. py:attribute:: RED :value: 2 .. py:attribute:: GREEN :value: 3 .. py:attribute:: BLUE :value: 4 .. py:attribute:: CYAN :value: 5 .. py:attribute:: MAGENTA :value: 6 .. py:attribute:: YELLOW :value: 7 .. py:attribute:: BLACK :value: 8 .. py:class:: Line A line of a teletext page. .. py:method:: __str__() -> str Convert the line to a string. .. py:method:: __len__() -> int Get the length of the line. .. py:method:: start_double_size() Start a double sized block of text. .. py:method:: end_double_size() End a double sized block of text. .. py:method:: start_flashing() Start a flashing block of text. .. py:method:: end_flashing() End a flashing block of text. .. py:method:: start_fg(color: Color, block: bool = False) Start a foreground color. :param color: The color. :param block: Is this a blocked drawing? .. py:method:: add_text(text: str) Add text to the line. :param text: The text. .. py:method:: add_block(block: str, color: Color, color_after: Color = Color.WHITE) Add a blocked drawing to the line. :param block: The blocked drawing. This should have three lines separated by newline characters. xs should be used for filled squares and .s for non-filled squares. :param color: The color. :param color_after: The color to use after the blocked drawing .. py:method:: start_bg(color: Color) Start a background color. :param color: The color. .. py:class:: Page(page_number: int) A teletext page. .. py:method:: write(overwrite: bool = False) Write the page to file in the build directory. :param overwrite: Overwrite existing pages? .. py:method:: write_direct(overwrite: bool = False) Write the page directly to the output directory. :param overwrite: Overwrite existing pages? .. py:method:: to_tti() -> str Convert the page to a tti string. .. py:method:: set_line(number: int, line: Line) Set a line of the page. :param number: The line number. :param line: The line. .. py:method:: set_tagline(tagline: str) Set the tagline of the page. :param tagline: The tagline. .. py:method:: add_wrapped_text(number: int, text: str, double: bool = False, color: Color = Color.DEFAULT) -> int Add wrapped text to the page. :param number: The line number to start the text. :param text: The text. :param double: Should the text be double sized? :param color: The text color. :returns: The line number after the text finishes. .. py:method:: add_block(number: int, block: str, color: Color, bg: Union[Color, None] = None, indent: int = 0, color_after: Color = Color.WHITE) -> int Add a block drawing to the page. :param number: The line number to start the block drawing. :param block: The blocked drawing. This should have a number of lines that is a mutliple of three separated by newline characters. xs should be used for filled squares and .s for non-filled squares. :param color: The text color. :param bg: The background color. :param index: The number of characters to indent the drawing. :param color_after: The color to use afer the block drawing. :returns: The line number after the block drawing finishes. .. py:data:: __version__ :value: '2024.2.8'