certbot_nginx.nginxparser¶
Very low-level nginx config parser based on pyparsing.
-
class
certbot_nginx.nginxparser.RawNginxParser(source)[source]¶ Bases:
objectA class that parses nginx configuration with pyparsing.
-
class
certbot_nginx.nginxparser.RawNginxDumper(blocks)[source]¶ Bases:
objectA class that dumps nginx configuration from the provided tree.
-
certbot_nginx.nginxparser.loads(source)[source]¶ Parses from a string.
Parameters: source (str) – The string to parse Returns: The parsed tree Return type: list
-
certbot_nginx.nginxparser.load(_file)[source]¶ Parses from a file.
Parameters: _file (file) – The file to parse Returns: The parsed tree Return type: list
-
certbot_nginx.nginxparser.dumps(blocks)[source]¶ Dump to a string.
Parameters: - block (UnspacedList) – The parsed tree
- indentation (int) – The number of spaces to indent
Return type: str
-
certbot_nginx.nginxparser.dump(blocks, _file)[source]¶ Dump to a file.
Parameters: - block (UnspacedList) – The parsed tree
- _file (file) – The file to dump to
- indentation (int) – The number of spaces to indent
Return type: NoneType
-
class
certbot_nginx.nginxparser.UnspacedList(list_source)[source]¶ Bases:
listWrap a list [of lists], making any whitespace entries magically invisible
-
_coerce(inbound)[source]¶ Coerce some inbound object to be appropriately usable in this object
Parameters: inbound – string or None or list or UnspacedList Returns: (coerced UnspacedList or string or None, spaced equivalent) Return type: tuple
-