Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Dict Expr Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Raise Call NameLoad Str orelse Assign TupleStore NameStore NameStore NameLoad If BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Raise Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore ListLoad Assign NameStore NameLoad While CompareGt NameLoad Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Break Expr Call AttributeLoad NameLoad attr NameLoad AugAssignSub NameStore Num While NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Raise Call NameLoad Str orelse Assign TupleStore NameStore NameStore NameLoad If CompareNotEq NameLoad NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign TupleStore NameStore NameStore NameLoad Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Dict While CompareNotEq Call AttributeLoad NameLoad attr Str body If CompareEq Call AttributeLoad NameLoad attr keyword Num Str body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num If CompareIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If NameLoad body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Return ListLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Return ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Call AttributeLoad NameLoad attr While CompareEq Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad While CompareNotEq Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Return ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise ExceptHandler type NameLoad name NameStore body Raise Call NameLoad Call AttributeLoad Str attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr TryExcept body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr TryExcept body With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Str attr GeneratorExp Call AttributeLoad Str attr NameLoad comprehension NameStore GeneratorExp Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Str Str attr Str Str comprehension NameStore NameLoad decorator_list If UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore BoolOpOr NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num If UnaryOpNot NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad AttributeLoad NameLoad attr For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Num NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults vararg body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str orelse Assign NameStore Call NameLoad NameLoad If NameLoad body If UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index NameLoad Index Num attr ListLoad NameLoad NameLoad orelse Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If NameLoad body If BoolOpOr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad For TupleStore NameStore NameStore Call NameLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index NameLoad Index Num body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore NameLoad Break orelse Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index NameLoad Index Num Expr Call AttributeLoad NameLoad attr NameLoad orelse If UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore NameLoad Break orelse Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore ListLoad Assign NameStore ListLoad NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Return NameLoad orelse Return SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body For NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num body Expr Yield NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body For NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num body Expr Yield NameLoad decorator_list NameLoad decorator_list
N/A N/A  This module provides a parser component for the `parser` package.
     N/A os N/A re focus common focus.parser.lexer SettingLexer ParseError N/A Exception N/A N/A  Represents an error during parsing.
         N/A N/A SettingParser N/A object N/A N/A  Simple parser that parses the tokens returned from the ``SettingLexer``
        class, which scans against configuration data.

        The following grammar describes the configuration file format::

            input     : container EOF
            container : NAME '{' (option | block)* '}'
            option    : NAME value ';'
            value     : TERM (',' TERM)*
            block     : NAME '{' option* '}'
            NAME      : ^[a-zA-Z_][a-zA-Z0-9_]*$
            TERM      : ^.+$

        where TERM has some additional constraints:
            a) Spaces, quotes, and token characters (i.e. {};,) must be escaped
               with the "" char, unless they exist within a string.

               For example:
                    name John\ "W"\ Smith\,\ III;

               In the case of quotes, within strings they still have to be
               escaped if they match the surrounding quote char.

               For example, this:
                    name "John "W" Smith, III";

               versus, this:
                    name 'John "W" Smith, III';

            b) Strings can be either double or single-quoted; they just have to
               match. Within the string, the quote character can be escaped
               with the "" char (i.e. " for double quotes, ' for single).

               For example:
                    name "John "W" Smith, III";

               The escape char '' may be used by itself or in double to
               represent one ''.

               Example:
                    php_fug_namespace "$var = new A\B\FooBar();";

               Note, sometimes double escaping must be used to indicate a
               single escape char if adjacent to quote characters.

        Single-line comments are supported, starting with the '#' char. The
        comment continues until the end of the line.

        Also note, option names may be repeated, but blocks with the same name
        will be replaced with the last block taking precedence over the other
        blocks with the same name. Options within a single block may be
        repeated.

        The following is the layout of a supported configuration file::

            type_name {
                option_name value; # single-line comment
                option_name2 value, "other val", next\ val;
                option_name2 "value";
                option_name3 "value", "value 2";

                block_name {
                    option_name value;
                    option_name value, value2;
                    option_name2 value, value2;
                }

                block_name2 {
                    option_name value;
                    #...
                }

                option_name4 value;

                #...
            }

        Example Usage::

            >>> parser = SettingParser("task.cfg")
            >>> parser.header
            'task_config'
            >>> list(parser.options)
            [['duration', ['30']]]
            >>> list(parser.blocks)
            [['apps', [['block', ['spam-bin']]]]]

            >>> parser = SettingParser()
            >>> parser.read("task.cfg")
            True
            >>> parser.header
            'task_config'
            >>> list(parser.options)
            [['duration', ['30']]]
            >>> list(parser.blocks)
            [['apps', [['block', ['spam-bin']]]]]

            >>> parser = SettingParser()
            >>> with open("task.cfg", "r") as f:
            ...     parser.readstream(f)
            True
            >>> parser.header
            'task_config'
            >>> list(parser.options)
            [['duration', ['30']]]
            >>> list(parser.blocks)
            [['apps', [['block', ['spam-bin']]]]]

        The class also supports saving as a configuration file.

        Example Usage::

            >>> parser = SettingParser()
            >>> parser.add_option(None, "serv_days", "Mon", "Tues", "Wed",
            ...                   "Thurs", "Fri")
            >>> parser.add_block("servers")
            >>> parser.add_option("servers", "name", "John Smith")
            >>> parser.add_option("servers", "name", "Sally Sue")
            >>> parser.add_option("servers", "name", "Susie Q")
            >>> parser.add_option(None, "capacity", "75")
            >>> parser.write("lunch.cfg", "lunch")
            >>> open("lunch.cfg", "r").read()
            lunch {
                serv_days "Mon","Tues","Wed","Thurs","Fri";
                capacity "75";
                servers {
                    name "John Smith";
                    name "Sally Sue";
                    name "Susie Q";
                }
            }

         N/A RE_NAME N/A N/A re compile [a-zA-Z_][a-zA-Z0-9_]*$ __init__ N/A N/A self filename N/A None N/A N/A N/A self _filename None N/A N/A self _lexer None N/A N/A self _ast N/A N/A N/A self _block_map N/A N/A N/A N/A self _reset N/A filename N/A N/A N/A N/A self read filename N/A _reset N/A N/A self N/A N/A N/A  Rebuilds structure for AST and resets internal data.
             N/A N/A self _filename None N/A N/A self _block_map N/A N/A N/A self _ast N/A N/A N/A N/A N/A self _ast append None N/A N/A N/A N/A self _ast append N/A N/A N/A N/A N/A self _ast append N/A N/A _get_token N/A N/A self regex N/A None N/A N/A  Consumes the next token in the token stream.

            `regex`
                Validate against the specified `re.compile()` regex instance.

            Returns token string.

            * Raises a ``ParseError`` exception if stream is empty or regex
              match fails.
             N/A item N/A N/A N/A self _lexer get_token N/A N/A item N/A N/A N/A ParseError Unexpected end of file N/A N/A N/A line_no token item N/A N/A regex N/A N/A N/A regex match token N/A N/A pattern Unexpected format in token '{0}' on line {1} N/A token_val N/A N/A common from_utf8 N/A N/A token strip N/A N/A ParseError N/A N/A pattern format token_val line_no N/A token N/A _lookahead_token N/A N/A self count N/A 1 N/A N/A  Peeks into the token stream up to the specified number of tokens
            without consuming any tokens from the stream.

            ``count``
                Look ahead in stream up to a maximum number of tokens.

            Returns string token or ``None``.
             N/A stack N/A N/A next_token None N/A N/A count 0 N/A N/A item N/A N/A N/A self _lexer get_token N/A N/A item N/A N/A N/A N/A N/A stack append item N/A count 1 N/A stack N/A N/A N/A line_no token N/A N/A stack pop N/A N/A next_token N/A N/A next_token token N/A N/A N/A N/A self _lexer push_token line_no token N/A next_token N/A _expect_token N/A N/A self expected N/A N/A N/A  Compares the next token in the stream to the specified token.

            `expected`
                Expected token string to match.

            * Raises a ``ParseError`` exception if token doesn't match
              `expected`.
             N/A item N/A N/A N/A self _lexer get_token N/A N/A item N/A N/A N/A ParseError Unexpected end of file N/A N/A N/A line_no token item N/A N/A token expected N/A N/A N/A ParseError N/A N/A Unexpected token '{0}', expecting '{1}' on line {2} format N/A N/A common from_utf8 N/A N/A token strip expected line_no N/A _expect_empty N/A N/A self N/A N/A N/A  Checks if the token stream is empty.

            * Raises a ``ParseError` exception if a token is found.
             N/A item N/A N/A N/A self _lexer get_token N/A item N/A N/A N/A line_no token item N/A N/A ParseError N/A N/A Unexpected token '{0}' on line {1} format N/A N/A common from_utf8 N/A N/A token strip line_no N/A _rule_container N/A N/A self N/A N/A N/A  Parses the production rule::
                container : NAME '{' (option | block)* '}' EOF

            Returns tuple (type_name, options_list, blocks_list).
             N/A type_name N/A N/A self _get_token N/A self RE_NAME N/A N/A N/A self _expect_token { N/A options N/A N/A blocks N/A N/A dupe_blocks N/A N/A N/A N/A N/A self _lookahead_token } N/A N/A N/A N/A N/A self _lookahead_token count 2 { N/A N/A block N/A N/A self _rule_block N/A name N/A block N/A 0 N/A N/A name N/A self _block_map N/A N/A N/A dupe_blocks N/A name block N/A N/A N/A N/A self _block_map N/A name N/A len blocks N/A N/A N/A blocks append block N/A N/A N/A N/A options append N/A N/A self _rule_option N/A dupe_blocks N/A N/A N/A name block N/A N/A dupe_blocks iteritems N/A N/A block_idx N/A N/A self _block_map N/A name N/A N/A blocks N/A block_idx block N/A N/A N/A self _expect_token } N/A N/A N/A self _expect_empty N/A N/A type_name options blocks N/A _rule_option N/A N/A self N/A N/A N/A  Parses the production rule::
                option : NAME value ';'

            Returns list (name, value_list).
             N/A name N/A N/A self _get_token N/A self RE_NAME N/A value N/A N/A self _rule_value N/A N/A N/A self _expect_token ; N/A N/A name value N/A _rule_value N/A N/A self N/A N/A N/A  Parses the production rule::
                value : TERM (',' TERM)*

            Returns list of string terms.
             N/A terms N/A N/A N/A self _get_token N/A N/A N/A N/A self _lookahead_token , N/A N/A N/A N/A self _get_token N/A N/A N/A terms append N/A N/A self _get_token N/A terms N/A _rule_block N/A N/A self N/A N/A N/A  Parses the production rule::
                block : NAME '{' option* '}'

            Returns tuple (name, options_list).
             N/A name N/A N/A self _get_token N/A self RE_NAME N/A N/A N/A self _expect_token { N/A options N/A N/A N/A N/A N/A self _lookahead_token } N/A N/A N/A N/A options append N/A N/A self _rule_option N/A N/A N/A self _expect_token } N/A N/A name options N/A _parse N/A N/A self N/A N/A N/A  Performs parsing process against token stream to generate the
            internal abstract syntax tree (AST) for general purpose use.

            * Raises a ``ParseError`` exception upon failure.
             N/A N/A N/A N/A self _ast N/A N/A self _rule_container N/A N/A N/A ParseError N/A N/A N/A N/A Exception N/A exc N/A N/A N/A ParseError N/A N/A Unexpected error: {0} format N/A unicode exc N/A read N/A N/A self filename N/A N/A N/A  Reads the file specified and parses the token elements generated
            from tokenizing the input data.

            `filename`
                Filename to read.

            Returns boolean.
             N/A N/A N/A N/A open filename r _file N/A N/A N/A N/A self readstream _file N/A N/A self _filename filename N/A True N/A N/A N/A IOError N/A N/A N/A N/A self _reset N/A False N/A readstream N/A N/A self stream N/A N/A N/A  Reads the specified stream and parses the token elements generated
            from tokenizing the input data.

            `stream`
                ``File``-like object.

            Returns boolean.
             N/A N/A N/A self _reset N/A N/A N/A N/A self _lexer N/A SettingLexer N/A N/A N/A N/A self _lexer readstream stream N/A N/A N/A self _parse N/A True N/A N/A N/A IOError N/A N/A N/A N/A self _reset N/A False N/A write N/A N/A self filename header N/A None N/A N/A  Writes the AST as a configuration file.

            `filename`
                Filename to save configuration file to.
            `header`
                Header string to use for the file.

            Returns boolean.
             N/A origfile N/A self _filename N/A N/A N/A N/A open filename w _file N/A N/A N/A N/A self writestream _file header N/A N/A self _filename filename N/A True N/A N/A N/A IOError N/A N/A N/A self _filename origfile N/A False N/A writestream N/A N/A self stream header N/A None N/A N/A  Writes the AST as a configuration file to the File-like stream.

            `stream`
                ``File``-like object.
            `header`
                Header string to use for the stream.

            Returns boolean.

            * Raises a ``ValueError`` exception if `header` is invalid and
              a regular exception if no data is available to write to stream.
             serialize_values N/A N/A values N/A N/A N/A  Serializes list of values into the following format::
                    "value","value2","value3"
                 N/A N/A N/A , join N/A N/A N/A "{0}" format v N/A v N/A N/A N/A N/A N/A N/A N/A common to_utf8 v replace \ \\ replace " \" N/A v values N/A N/A N/A N/A self _ast N/A N/A N/A Exception No available data to write to stream N/A header N/A header N/A N/A self _ast N/A 0 N/A N/A header N/A N/A N/A ValueError Must provide a header N/A N/A N/A N/A N/A self RE_NAME match header N/A N/A N/A ValueError Invalid header N/A N/A N/A N/A N/A stream write N/A N/A {0} {{{1} format header N/A os linesep N/A N/A option value_list N/A self options N/A N/A vals N/A serialize_values value_list N/A N/A N/A stream write N/A N/A     {0} {1};{2} format option vals N/A os linesep N/A N/A block option_list N/A self blocks N/A N/A N/A N/A stream write N/A N/A     {0} {{{1} format block N/A os linesep N/A N/A option value_list option_list N/A N/A vals N/A serialize_values value_list N/A N/A N/A stream write N/A N/A         {0} {1};{2} format option vals N/A os linesep N/A N/A N/A stream write N/A N/A     }}{0} format N/A os linesep N/A N/A N/A stream write N/A N/A }}{0} format N/A os linesep N/A N/A N/A self _ast N/A 0 header N/A N/A N/A stream flush N/A True N/A N/A N/A IOError N/A N/A False N/A add_option N/A N/A self block name N/A values N/A N/A  Adds an option to the AST, either as a non-block option or for an
            existing block.

            `block`
                Block name. Set to ``None`` for non-block option.
            `name`
                Option name.
            `*values`
                String values for the option.

            * Raises a ``ValueError`` exception if `values` is empty, `name`
              is invalid, or `block` doesn't exist.
             N/A N/A N/A N/A N/A self RE_NAME match name N/A N/A N/A ValueError N/A N/A Invalid option name '{0}' format N/A N/A common from_utf8 name N/A N/A values N/A N/A N/A ValueError Must provide a value N/A N/A values N/A list values N/A block N/A N/A N/A N/A block N/A self _block_map N/A N/A N/A ValueError N/A N/A Block '{0}' does not exist format N/A N/A common from_utf8 block N/A block_idx N/A N/A self _block_map N/A block N/A N/A N/A N/A N/A N/A N/A self _ast N/A 2 N/A block_idx N/A 1 append N/A name values N/A N/A N/A N/A N/A N/A self _ast N/A 1 append N/A name values N/A remove_option N/A N/A self block name N/A N/A N/A  Removes first matching option that exists from the AST.

            `block`
                Block name. Set to ``None`` for non-block option.
            `name`
                Option name to remove.

            * Raises a ``ValueError`` exception if `name` and/or `block`
              haven't been added.
             N/A block N/A N/A N/A N/A N/A self _ast N/A N/A block N/A self _block_map N/A N/A N/A ValueError N/A N/A Block '{0}' does not exist format N/A N/A common from_utf8 block N/A block_idx N/A N/A self _block_map N/A block N/A N/A i opt N/A enumerate N/A N/A N/A N/A self _ast N/A 2 N/A block_idx N/A 1 N/A N/A N/A N/A opt N/A 0 name N/A N/A item_idx i N/A N/A N/A N/A ValueError N/A N/A Option '{0}' does not exist format N/A N/A common from_utf8 name N/A options N/A N/A N/A N/A self _ast N/A 2 N/A block_idx N/A 1 N/A N/A N/A options pop item_idx N/A N/A N/A N/A self _ast N/A N/A N/A ValueError N/A N/A Option '{0}' does not exist format N/A N/A common from_utf8 name N/A N/A i opt N/A enumerate N/A N/A self _ast N/A 1 N/A N/A N/A N/A opt N/A 0 name N/A N/A item_idx i N/A N/A N/A N/A ValueError N/A N/A Option '{0}' does not exist format N/A N/A common from_utf8 name N/A N/A N/A N/A N/A self _ast N/A 1 pop item_idx N/A add_block N/A N/A self name N/A N/A N/A  Adds a new block to the AST.

            `name`
                Block name.

            * Raises a ``ValueError`` exception if `name` is invalid or
              an existing block name matches value provided for `name`.
             N/A N/A N/A N/A N/A self RE_NAME match name N/A N/A N/A ValueError N/A N/A Invalid block name '{0}' format N/A N/A common from_utf8 name N/A N/A name N/A self _block_map N/A N/A N/A ValueError N/A N/A Block '{0}' already exists format N/A N/A common from_utf8 name N/A N/A N/A self _block_map N/A name N/A len N/A N/A self _ast N/A 2 N/A option_list N/A N/A block N/A name option_list N/A N/A N/A N/A N/A self _ast N/A 2 append block N/A remove_block N/A N/A self name N/A N/A N/A  Removes an existing block from the AST.

            `name`
                Block name.

            * Raises a ``ValueError`` exception if `name` hasn't been added.
             N/A N/A N/A N/A self _ast N/A N/A name N/A self _block_map N/A N/A N/A ValueError N/A N/A Block '{0}' does not exist format N/A N/A common from_utf8 name N/A block_idx N/A N/A self _block_map N/A name N/A N/A N/A N/A N/A self _ast N/A 2 pop block_idx N/A N/A N/A self _block_map N/A name N/A filename N/A N/A self N/A N/A N/A  Returns filename for parsed file.
             N/A N/A self _filename N/A property header N/A N/A self N/A N/A N/A  Returns header available in parsed AST.
             N/A N/A N/A self _ast N/A N/A None N/A N/A N/A N/A self _ast N/A 0 N/A property options N/A N/A self N/A N/A N/A  Returns generator of options available in parsed AST.
             N/A N/A self _ast N/A N/A option N/A N/A self _ast N/A 1 N/A N/A N/A option N/A property blocks N/A N/A self N/A N/A N/A  Returns generator of blocks available in parsed AST.
             N/A N/A self _ast N/A N/A block N/A N/A self _ast N/A 2 N/A N/A N/A block N/A property N/A