Skip to content

Commit

Permalink
Dropped 2.X support
Browse files Browse the repository at this point in the history
  • Loading branch information
superbobry committed Oct 11, 2021
1 parent 9104e16 commit f8e191c
Show file tree
Hide file tree
Showing 22 changed files with 15 additions and 122 deletions.
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# pyte documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 8 12:49:51 2011.
#
Expand Down
3 changes: 0 additions & 3 deletions examples/capture.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
capture
~~~~~~~
Expand All @@ -10,8 +9,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import print_function, unicode_literals

import os
import pty
import signal
Expand Down
3 changes: 0 additions & 3 deletions examples/debug.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
debug
~~~~~
Expand All @@ -12,8 +11,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import print_function, unicode_literals

import pyte

# A blob of `ADOM` output we need to debug. Hey! I know this is ugly ...
Expand Down
3 changes: 0 additions & 3 deletions examples/helloworld.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
helloworld
~~~~~~~~~~
Expand All @@ -9,8 +8,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import print_function, unicode_literals

import pyte


Expand Down
6 changes: 0 additions & 6 deletions examples/history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
history
~~~~~~~
Expand All @@ -9,16 +8,11 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import print_function, unicode_literals

import os
import random
import string
import sys

if sys.version_info[0] == 2:
input = raw_input

import pyte
from pyte import modes as mo

Expand Down
3 changes: 0 additions & 3 deletions examples/nanoterm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
nanoterm
~~~~~~~~
Expand All @@ -11,8 +10,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import print_function, unicode_literals

import os
import pty
import select
Expand Down
5 changes: 0 additions & 5 deletions pyte/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte
~~~~
Expand All @@ -23,8 +22,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import absolute_import

__all__ = ("Screen", "DiffScreen", "HistoryScreen", "DebugScreen",
"Stream", "ByteStream")

Expand All @@ -35,8 +32,6 @@


if __debug__:
from .compat import str

def dis(chars):
"""A :func:`dis.dis` for terminals.
Expand Down
3 changes: 0 additions & 3 deletions pyte/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte
~~~~
Expand All @@ -23,8 +22,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import unicode_literals

if __name__ == "__main__":
import sys
import pyte
Expand Down
6 changes: 0 additions & 6 deletions pyte/charsets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.charsets
~~~~~~~~~~~~~
Expand All @@ -17,11 +16,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import absolute_import, unicode_literals

from .compat import chr, map


#: Latin1.
LAT1_MAP = "".join(map(chr, range(256)))

Expand Down
30 changes: 0 additions & 30 deletions pyte/compat.py

This file was deleted.

2 changes: 0 additions & 2 deletions pyte/control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.control
~~~~~~~~~~~~
Expand All @@ -12,7 +11,6 @@
see AUTHORS for details.
:license: LGPL, see LICENSE for more details.
"""
from __future__ import unicode_literals

#: *Space*: Not surprisingly -- ``" "``.
SP = " "
Expand Down
2 changes: 0 additions & 2 deletions pyte/escape.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.escape
~~~~~~~~~~~
Expand All @@ -11,7 +10,6 @@
see AUTHORS for details.
:license: LGPL, see LICENSE for more details.
"""
from __future__ import unicode_literals

#: *Reset*.
RIS = "c"
Expand Down
3 changes: 0 additions & 3 deletions pyte/graphics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.graphics
~~~~~~~~~~~~~
Expand All @@ -13,8 +12,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import unicode_literals

#: A mapping of ANSI text style codes to style names, "+" means the:
#: attribute is set, "-" -- reset; example:
#:
Expand Down
1 change: 0 additions & 1 deletion pyte/modes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.modes
~~~~~~~~~~
Expand Down
17 changes: 5 additions & 12 deletions pyte/screens.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.screens
~~~~~~~~~~~~
Expand Down Expand Up @@ -26,8 +25,6 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import absolute_import, unicode_literals, division

import copy
import json
import math
Expand All @@ -36,23 +33,19 @@
import unicodedata
import warnings
from collections import deque, namedtuple, defaultdict
from functools import lru_cache

from wcwidth import wcwidth

# There is no standard 2.X backport for ``lru_cache``.
if sys.version_info >= (3, 2):
from functools import lru_cache
wcwidth = lru_cache(maxsize=4096)(wcwidth)

from . import (
charsets as cs,
control as ctrl,
graphics as g,
modes as mo
)
from .compat import map, range, str
from .streams import Stream

wcwidth = lru_cache(maxsize=4096)(wcwidth)

#: A container for screen's scroll margins.
Margins = namedtuple("Margins", "top bottom")
Expand Down Expand Up @@ -107,7 +100,7 @@ def __new__(cls, data, fg="default", bg="default", bold=False,
blink)


class Cursor(object):
class Cursor:
"""Screen cursor.
:param int x: 0-based horizontal cursor position.
Expand Down Expand Up @@ -144,7 +137,7 @@ def __missing__(self, key):
return self.default


class Screen(object):
class Screen:
"""
A screen is an in-memory matrix of characters that represents the
screen display of the terminal. It can be instantiated on its own
Expand Down Expand Up @@ -1287,7 +1280,7 @@ def __call__(self, screen):
return getattr(screen, self.name)(*self.args, **self.kwargs)


class DebugScreen(object):
class DebugScreen:
r"""A screen which dumps a subset of the received events to a file.
>>> import io
Expand Down
8 changes: 2 additions & 6 deletions pyte/streams.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
pyte.streams
~~~~~~~~~~~~
Expand All @@ -20,19 +19,16 @@
:license: LGPL, see LICENSE for more details.
"""

from __future__ import absolute_import, unicode_literals

import codecs
import itertools
import re
import warnings
from collections import defaultdict

from . import control as ctrl, escape as esc
from .compat import pass_through_str


class Stream(object):
class Stream:
"""A stream is a state machine that parses a stream of bytes and
dispatches events based on what it sees.
Expand Down Expand Up @@ -408,7 +404,7 @@ def feed(self, data):
if self.use_utf8:
data = self.utf8_decoder.decode(data)
else:
data = pass_through_str(data)
data = "".join(map(chr, data))

super(ByteStream, self).feed(data)

Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os

Expand All @@ -23,9 +22,10 @@
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: PyPy",
"Topic :: Terminals :: Terminal Emulators/X Terminals",
]

Expand Down
4 changes: 0 additions & 4 deletions tests/test_diff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import pyte
from pyte import modes as mo

Expand Down
5 changes: 0 additions & 5 deletions tests/test_history.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import os

import pyte
from pyte import control as ctrl, modes as mo
from pyte.compat import str


def chars(history_lines, columns):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_input_output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import json
import os.path

Expand Down
4 changes: 0 additions & 4 deletions tests/test_screen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import copy

import pytest
Expand Down
Loading

0 comments on commit f8e191c

Please sign in to comment.