MCPcopy Create free account
hub / github.com/etingof/apacheconfig / parse

Method parse

apacheconfig/wloader.py:174–186  ·  view source on GitHub ↗

Factory for :class:`apacheconfig.ListNode` from a config string. Args: raw_str (str): Config string to parse. parser (:class:`apacheconfig.ApacheConfigParser`): parser object to use. Returns: :class:`apacheconfig.ListNode` containi

(cls, raw_str, parser)

Source from the content-addressed store, hash-verified

172
173 @classmethod
174 def parse(cls, raw_str, parser):
175 """Factory for :class:`apacheconfig.ListNode` from a config string.
176
177 Args:
178 raw_str (str): Config string to parse.
179 parser (:class:`apacheconfig.ApacheConfigParser`): parser object
180 to use.
181 Returns:
182 :class:`apacheconfig.ListNode` containing data parsed from
183 ``raw_str``.
184 """
185 raw = parser.parse(raw_str)
186 return cls(raw, parser)
187
188 def add(self, index, raw_str):
189 """Parses and adds child element at given index.

Callers 15

_test_casesMethod · 0.45
testUnicodeSupportMethod · 0.45
testOptionAndValueMethod · 0.45
testHashCommentsMethod · 0.45
testCStyleCommentsMethod · 0.45
testIncludesMethod · 0.45
testOptionAndValueSetMethod · 0.45
testBlockWithOptionsMethod · 0.45
testNestedBlockMethod · 0.45

Calls

no outgoing calls

Tested by 15

_test_casesMethod · 0.36
testUnicodeSupportMethod · 0.36
testOptionAndValueMethod · 0.36
testHashCommentsMethod · 0.36
testCStyleCommentsMethod · 0.36
testIncludesMethod · 0.36
testOptionAndValueSetMethod · 0.36
testBlockWithOptionsMethod · 0.36
testNestedBlockMethod · 0.36