def __init__(self, root, filename, type_to_path):
        """
        Initializes the writer to the specified output file,
        creating the parent directories when used if required.
        """
        self.root = root
        self.filename = filename
        self._parent = str(self.filename.parent)
        self.handle = None
        self.title = ''

        # Should be set before calling adding items to the menu
        self.menu_separator_tag = None

        # Utility functions
        self.type_to_path = lambda t: self._rel(type_to_path(t))

        # Control signals
        self.menu_began = False
        self.table_columns = 0
        self.table_columns_left = None
        self.write_copy_script = False
        self._script = ''
def __init__ ( self , root , filename , type_to_path ) : self . root = root self . filename = filename self . _parent = str ( self . filename . parent ) self . handle = None self . title = '' self . menu_separator_tag = None self . type_to_path = lambda t : self . _rel ( type_to_path ( t ) ) self . menu_began = False self . table_columns = 0 self . table_columns_left = None self . write_copy_script = False self . _script = ''
Initializes the writer to the specified output file,
        creating the parent directories when used if required.