def __init__(
        self,
        text,
        font_settings,
        entry_widget,
        cursor_color=BLACK,
    ):
        """Store variables and perform setups.

        Parameters
        ==========

        text (string)
            text being edited.
        font_settings (dict)
            settings passed to the line instance to render
            the characters.
        entry_widget (entry widget instance)
            entry object whose text the cursor will manage.
        cursor_color (color)
            color of the cursor.
        """
        ### store reference to entry widget
        self.entry_widget = entry_widget

        ### retrieve the font height from the font settings
        ### to use as the height of this cursor
        height = font_settings["font_height"]

        ### create a rect for the cursor

        ## define an arbitrary width for the rect (we use a
        ## third of the height since it looks good, but this
        ## is arbitrary and is really just an initial value;
        ## the cursor assumes the width of characters under
        ## it anyway, so it's width should change multiple
        ## times over the widget editing session)
        arbitrary_width = height // 3

        ## instantiate and store a rect for the cursor
        self.rect = Rect((0, 0), (arbitrary_width, height))

        ### instantiate an empty line

        self.line = EntryLine("", self.entry_widget.rect.topleft, font_settings)

        ### set text on line and perform additional setups;
        ### from now on, the line will be holding the text
        self.set(text)

        ### store the cursor color
        self.cursor_color = cursor_color
Store variables and perform setups.

        Parameters
        ==========

        text (string)
            text being edited.
        font_settings (dict)
            settings passed to the line instance to render
            the characters.
        entry_widget (entry widget instance)
            entry object whose text the cursor will manage.
        cursor_color (color)
            color of the cursor.
        
nodezator/textman/entryedition/cursor.py