/usr/lib/python2.7/dist-packages/pyte/__init__.py is in python-pyte 0.4.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | # -*- coding: utf-8 -*-
"""
pyte
~~~~
`pyte` implements a mix of VT100, VT220 and VT520 specification,
and aims to support most of the `TERM=linux` functionality.
Two classes: :class:`~pyte.streams.Stream`, which parses the
command stream and dispatches events for commands, and
:class:`~pyte.screens.Screen` which, when used with a stream
maintains a buffer of strings representing the screen of a
terminal.
.. warning:: From ``xterm/main.c`` "If you think you know what all
of this code is doing, you are probably very mistaken.
There be serious and nasty dragons here" -- nothing
has changed.
:copyright: (c) 2011-2013 by Selectel, see AUTHORS for details.
:license: LGPL, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ("Screen", "DiffScreen", "HistoryScreen",
"Stream", "ByteStream", "DebugStream",
"ctrl", "esc", "mo", "g", "cs")
from . import (
control as ctrl,
charsets as cs,
escape as esc,
graphics as g,
modes as mo
)
from .screens import Screen, DiffScreen, HistoryScreen
from .streams import Stream, ByteStream, DebugStream
if __debug__:
import sys
if sys.version_info[0] == 2:
str = unicode
def dis(chars):
"""A :func:`dis.dis` for terminals.
>>> dis(u"\u0007")
BELL
>>> dis(u"\x9b20m")
SELECT-GRAPHIC-RENDITION 20
"""
if isinstance(chars, str):
chars = chars.encode("utf-8")
return DebugStream().feed(chars)
|