INNER CODE UNIT · Python

extent

siznax/wptools · wptools/core.py:304

    extent = maxwidth - (rpad + 2)
    for line in datastr:
        if len(line) >= maxwidth:
            line = line[:extent] + '...'
        utils.stderr(line)


def safestr(text):
    """
    Safely convert unicode to a string
    """
    if text is None:
        return
    try:
        return str(text)
    except UnicodeEncodeError:
        return str(text.encode('utf-8'))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…