How to use the certbot-nginx.certbot_nginx._internal.parser_obj.Statements function in certbot-nginx

To help you get started, we’ve selected a few certbot-nginx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github certbot / certbot / certbot-nginx / certbot_nginx / _internal / parser_obj.py View on Github external
def parsing_hooks(cls):
        """Returns object types that this class should be able to `parse` recusrively.
        The order of the objects indicates the order in which the parser should
        try to parse each subitem.
        :returns: A list of Parsable classes.
        :rtype list:
        """
        return (Block, Sentence, Statements)
github certbot / certbot / certbot-nginx / certbot_nginx / _internal / parser_obj.py View on Github external
def __init__(self, parent=None):
        super(Statements, self).__init__(parent)
        self._trailing_whitespace = None
github certbot / certbot / certbot-nginx / certbot_nginx / _internal / parser_obj.py View on Github external
The assumptions that this routine makes are:
            1. the first element of `raw_list` is a valid Sentence.
            2. the second element of `raw_list` is a valid Statement.
        If add_spaces is set, we call it recursively on `names` and `contents`, and
        add an extra trailing space to `names` (to separate the block's opening bracket
        and the block name).
        """
        if not Block.should_parse(raw_list):
            raise errors.MisconfigurationError("Block parsing expects a list of length 2. "
                "First element should be a list of string types (the bloc names), "
                "and second should be another list of statements (the bloc content).")
        self.names = Sentence(self)
        if add_spaces:
            raw_list[0].append(" ")
        self.names.parse(raw_list[0], add_spaces)
        self.contents = Statements(self)
        self.contents.parse(raw_list[1], add_spaces)
        self._data = [self.names, self.contents]