def __init__(self,
                 file=None,
                 splitters=("=", ":"),
                 namespace_splitter="|",
                 comment_limiters=(";", "#"),
                 comment_marker="#",
                 quotation_markers=("\"", "'", "`"),
                 raw_section_content_identifier="__raw__",
                 defaults_section="_defaults",
                 preserve_order=True):
        """
        Initializes the class.

        Usage::

            >>> content = ["[Section A]\\n", "; Comment.\\n", "Attribute 1 = \\"Value A\\"\\n", "\\n", \
"[Section B]\\n", "Attribute 2 = \\"Value B\\"\\n"]
            >>> sections_file_parser = SectionsFileParser()
            >>> sections_file_parser.content = content
            >>> sections_file_parser.parse(strip_comments=False)
            <foundations.parsers.SectionsFileParser object at 0x293892011>
            >>> sections_file_parser.sections.keys()
            [u'Section A', u'Section B']
            >>> sections_file_parser.comments
            OrderedDict([(u'Section A|#0', {u'content': u'Comment.', u'id': 0})])

        :param file: Current file path.
        :type file: unicode
        :param splitters: Splitter characters.
        :type splitters: tuple or list
        :param namespace_splitter: Namespace splitters character.
        :type namespace_splitter: unicode
        :param comment_limiters: Comment limiters characters.
        :type comment_limiters: tuple or list
        :param comment_marker: Character use to prefix extracted comments idientifiers.
        :type comment_marker: unicode
        :param quotation_markers: Quotation markers characters.
        :type quotation_markers: tuple or list
        :param raw_section_content_identifier: Raw section content identifier.
        :type raw_section_content_identifier: unicode
        :param defaults_section: Default section name.
        :type defaults_section: unicode
        :param preserve_order: Data order is preserved.
        :type preserve_order: bool
        """

        LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))

        foundations.io.File.__init__(self, file)

        # --- Setting class attributes. ---
        self.__splitters = None
        self.splitters = splitters
        self.__namespace_splitter = None
        self.namespace_splitter = namespace_splitter
        self.__comment_limiters = None
        self.comment_limiters = comment_limiters
        self.__comment_marker = None
        self.comment_marker = comment_marker
        self.__quotation_markers = None
        self.quotation_markers = quotation_markers
        self.__raw_section_content_identifier = None
        self.raw_section_content_identifier = raw_section_content_identifier
        self.__defaults_section = None
        self.defaults_section = defaults_section
        self.__preserve_order = None
        self.preserve_order = preserve_order

        if not preserve_order:
            self.__sections = {}
            self.__comments = {}
        else:
            self.__sections = OrderedDict()
            self.__comments = OrderedDict()
        self.__parsing_errors = []
def __init__ ( self , file = None , splitters = ( "=" , ":" ) , namespace_splitter = "|" , comment_limiters = ( ";" , "#" ) , comment_marker = "#" , quotation_markers = ( "\"" , "'" , "`" ) , raw_section_content_identifier = "__raw__" , defaults_section = "_defaults" , preserve_order = True ) : LOGGER . debug ( "> Initializing '{0}()' class." . format ( self . __class__ . __name__ ) ) foundations . io . File . __init__ ( self , file ) self . __splitters = None self . splitters = splitters self . __namespace_splitter = None self . namespace_splitter = namespace_splitter self . __comment_limiters = None self . comment_limiters = comment_limiters self . __comment_marker = None self . comment_marker = comment_marker self . __quotation_markers = None self . quotation_markers = quotation_markers self . __raw_section_content_identifier = None self . raw_section_content_identifier = raw_section_content_identifier self . __defaults_section = None self . defaults_section = defaults_section self . __preserve_order = None self . preserve_order = preserve_order if not preserve_order : self . __sections = { } self . __comments = { } else : self . __sections = OrderedDict ( ) self . __comments = OrderedDict ( ) self . __parsing_errors = [ ]
Initializes the class.

        Usage::

            >>> content = ["[Section A]\\n", "; Comment.\\n", "Attribute 1 = \\"Value A\\"\\n", "\\n", \
"[Section B]\\n", "Attribute 2 = \\"Value B\\"\\n"]
            >>> sections_file_parser = SectionsFileParser()
            >>> sections_file_parser.content = content
            >>> sections_file_parser.parse(strip_comments=False)
            <foundations.parsers.SectionsFileParser object at 0x293892011>
            >>> sections_file_parser.sections.keys()
            [u'Section A', u'Section B']
            >>> sections_file_parser.comments
            OrderedDict([(u'Section A|#0', {u'content': u'Comment.', u'id': 0})])

        :param file: Current file path.
        :type file: unicode
        :param splitters: Splitter characters.
        :type splitters: tuple or list
        :param namespace_splitter: Namespace splitters character.
        :type namespace_splitter: unicode
        :param comment_limiters: Comment limiters characters.
        :type comment_limiters: tuple or list
        :param comment_marker: Character use to prefix extracted comments idientifiers.
        :type comment_marker: unicode
        :param quotation_markers: Quotation markers characters.
        :type quotation_markers: tuple or list
        :param raw_section_content_identifier: Raw section content identifier.
        :type raw_section_content_identifier: unicode
        :param defaults_section: Default section name.
        :type defaults_section: unicode
        :param preserve_order: Data order is preserved.
        :type preserve_order: bool