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

Method load

apacheconfig/wloader.py:35–49  ·  view source on GitHub ↗

Loads config file into a raw modifiable AST. Args: filepath (Text): path of config file to load. Expects UTF-8 encoding. Returns: :class:`apacheconfig.ListNode` AST containing parsed config file. Raises: IOError: If there

(self, filepath)

Source from the content-addressed store, hash-verified

33 self._reader = LocalHostReader()
34
35 def load(self, filepath):
36 """Loads config file into a raw modifiable AST.
37
38 Args:
39 filepath (Text): path of config file to load. Expects UTF-8
40 encoding.
41
42 Returns:
43 :class:`apacheconfig.ListNode` AST containing parsed config file.
44
45 Raises:
46 IOError: If there is a problem opening the file specified.
47 """
48 with self._reader.open(filepath) as f:
49 return self.loads(f.read())
50
51 def loads(self, text):
52 """Loads config text into a raw modifiable AST.

Callers

nothing calls this directly

Calls 2

loadsMethod · 0.95
openMethod · 0.80

Tested by

no test coverage detected