How to use the webencodings.ascii_lower function in webencodings

To help you get started, we’ve selected a few webencodings 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 Kozea / tinycss2 / tinycss2 / ast.py View on Github external
def __init__(self, line, column, value):
        Node.__init__(self, line, column)
        self.value = value
        try:
            self.lower_value = ascii_lower(value)
        except UnicodeEncodeError:
            self.lower_value = value
github Kozea / tinycss2 / tinycss2 / ast.py View on Github external
def __init__(self, line, column, value, int_value, representation, unit):
        Node.__init__(self, line, column)
        self.value = value
        self.int_value = int_value
        self.is_integer = int_value is not None
        self.representation = representation
        self.unit = unit
        self.lower_unit = ascii_lower(unit)
github Kozea / tinycss2 / tinycss2 / tokenizer.py View on Github external
while css.startswith((' ', '\n', '\t'), pos):
                pos += 1
            tokens.append(WhitespaceToken(line, column))
            continue
        elif (c in 'Uu' and pos + 2 < length and css[pos + 1] == '+'
                and css[pos + 2] in '0123456789abcdefABCDEF?'):
            start, end, pos = _consume_unicode_range(css, pos + 2)
            tokens.append(UnicodeRangeToken(line, column, start, end))
            continue
        elif _is_ident_start(css, pos):
            value, pos = _consume_ident(css, pos)
            if not css.startswith('(', pos):  # Not a function
                tokens.append(IdentToken(line, column, value))
                continue
            pos += 1  # Skip the '('
            if ascii_lower(value) == 'url':
                value, pos = _consume_url(css, pos)
                tokens.append(
                    URLToken(line, column, value) if value is not None
                    else ParseError(line, column, 'bad-url', 'bad URL token'))
                continue
            arguments = []
            tokens.append(Function(line, column, value, arguments))
            stack.append((tokens, end_char))
            end_char = ')'
            tokens = arguments
            continue

        match = _NUMBER_RE.match(css, pos)
        if match:
            pos = match.end()
            repr_ = css[token_start_pos:pos]
github Kozea / tinycss2 / tinycss2 / ast.py View on Github external
def __init__(self, line, column, name, arguments):
        Node.__init__(self, line, column)
        self.name = name
        self.lower_name = ascii_lower(name)
        self.arguments = arguments

webencodings

Character encoding aliases for legacy web content

BSD-2-Clause
Latest version published 8 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages