Skip to content

Commit f8e191c

Browse files
committed
Dropped 2.X support
1 parent 9104e16 commit f8e191c

22 files changed

+15
-122
lines changed

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# pyte documentation build configuration file, created by
42
# sphinx-quickstart on Fri Apr 8 12:49:51 2011.
53
#

examples/capture.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
capture
43
~~~~~~~
@@ -10,8 +9,6 @@
109
:license: LGPL, see LICENSE for more details.
1110
"""
1211

13-
from __future__ import print_function, unicode_literals
14-
1512
import os
1613
import pty
1714
import signal

examples/debug.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
debug
43
~~~~~
@@ -12,8 +11,6 @@
1211
:license: LGPL, see LICENSE for more details.
1312
"""
1413

15-
from __future__ import print_function, unicode_literals
16-
1714
import pyte
1815

1916
# A blob of `ADOM` output we need to debug. Hey! I know this is ugly ...

examples/helloworld.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
helloworld
43
~~~~~~~~~~
@@ -9,8 +8,6 @@
98
:license: LGPL, see LICENSE for more details.
109
"""
1110

12-
from __future__ import print_function, unicode_literals
13-
1411
import pyte
1512

1613

examples/history.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
history
43
~~~~~~~
@@ -9,16 +8,11 @@
98
:license: LGPL, see LICENSE for more details.
109
"""
1110

12-
from __future__ import print_function, unicode_literals
13-
1411
import os
1512
import random
1613
import string
1714
import sys
1815

19-
if sys.version_info[0] == 2:
20-
input = raw_input
21-
2216
import pyte
2317
from pyte import modes as mo
2418

examples/nanoterm.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
nanoterm
43
~~~~~~~~
@@ -11,8 +10,6 @@
1110
:license: LGPL, see LICENSE for more details.
1211
"""
1312

14-
from __future__ import print_function, unicode_literals
15-
1613
import os
1714
import pty
1815
import select

pyte/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte
43
~~~~
@@ -23,8 +22,6 @@
2322
:license: LGPL, see LICENSE for more details.
2423
"""
2524

26-
from __future__ import absolute_import
27-
2825
__all__ = ("Screen", "DiffScreen", "HistoryScreen", "DebugScreen",
2926
"Stream", "ByteStream")
3027

@@ -35,8 +32,6 @@
3532

3633

3734
if __debug__:
38-
from .compat import str
39-
4035
def dis(chars):
4136
"""A :func:`dis.dis` for terminals.
4237

pyte/__main__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte
43
~~~~
@@ -23,8 +22,6 @@
2322
:license: LGPL, see LICENSE for more details.
2423
"""
2524

26-
from __future__ import unicode_literals
27-
2825
if __name__ == "__main__":
2926
import sys
3027
import pyte

pyte/charsets.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.charsets
43
~~~~~~~~~~~~~
@@ -17,11 +16,6 @@
1716
:license: LGPL, see LICENSE for more details.
1817
"""
1918

20-
from __future__ import absolute_import, unicode_literals
21-
22-
from .compat import chr, map
23-
24-
2519
#: Latin1.
2620
LAT1_MAP = "".join(map(chr, range(256)))
2721

pyte/compat.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

pyte/control.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.control
43
~~~~~~~~~~~~
@@ -12,7 +11,6 @@
1211
see AUTHORS for details.
1312
:license: LGPL, see LICENSE for more details.
1413
"""
15-
from __future__ import unicode_literals
1614

1715
#: *Space*: Not surprisingly -- ``" "``.
1816
SP = " "

pyte/escape.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.escape
43
~~~~~~~~~~~
@@ -11,7 +10,6 @@
1110
see AUTHORS for details.
1211
:license: LGPL, see LICENSE for more details.
1312
"""
14-
from __future__ import unicode_literals
1513

1614
#: *Reset*.
1715
RIS = "c"

pyte/graphics.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.graphics
43
~~~~~~~~~~~~~
@@ -13,8 +12,6 @@
1312
:license: LGPL, see LICENSE for more details.
1413
"""
1514

16-
from __future__ import unicode_literals
17-
1815
#: A mapping of ANSI text style codes to style names, "+" means the:
1916
#: attribute is set, "-" -- reset; example:
2017
#:

pyte/modes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.modes
43
~~~~~~~~~~

pyte/screens.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.screens
43
~~~~~~~~~~~~
@@ -26,8 +25,6 @@
2625
:license: LGPL, see LICENSE for more details.
2726
"""
2827

29-
from __future__ import absolute_import, unicode_literals, division
30-
3128
import copy
3229
import json
3330
import math
@@ -36,23 +33,19 @@
3633
import unicodedata
3734
import warnings
3835
from collections import deque, namedtuple, defaultdict
36+
from functools import lru_cache
3937

4038
from wcwidth import wcwidth
4139

42-
# There is no standard 2.X backport for ``lru_cache``.
43-
if sys.version_info >= (3, 2):
44-
from functools import lru_cache
45-
wcwidth = lru_cache(maxsize=4096)(wcwidth)
46-
4740
from . import (
4841
charsets as cs,
4942
control as ctrl,
5043
graphics as g,
5144
modes as mo
5245
)
53-
from .compat import map, range, str
5446
from .streams import Stream
5547

48+
wcwidth = lru_cache(maxsize=4096)(wcwidth)
5649

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

109102

110-
class Cursor(object):
103+
class Cursor:
111104
"""Screen cursor.
112105
113106
:param int x: 0-based horizontal cursor position.
@@ -144,7 +137,7 @@ def __missing__(self, key):
144137
return self.default
145138

146139

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

12891282

1290-
class DebugScreen(object):
1283+
class DebugScreen:
12911284
r"""A screen which dumps a subset of the received events to a file.
12921285
12931286
>>> import io

pyte/streams.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
pyte.streams
43
~~~~~~~~~~~~
@@ -20,19 +19,16 @@
2019
:license: LGPL, see LICENSE for more details.
2120
"""
2221

23-
from __future__ import absolute_import, unicode_literals
24-
2522
import codecs
2623
import itertools
2724
import re
2825
import warnings
2926
from collections import defaultdict
3027

3128
from . import control as ctrl, escape as esc
32-
from .compat import pass_through_str
3329

3430

35-
class Stream(object):
31+
class Stream:
3632
"""A stream is a state machine that parses a stream of bytes and
3733
dispatches events based on what it sees.
3834
@@ -408,7 +404,7 @@ def feed(self, data):
408404
if self.use_utf8:
409405
data = self.utf8_decoder.decode(data)
410406
else:
411-
data = pass_through_str(data)
407+
data = "".join(map(chr, data))
412408

413409
super(ByteStream, self).feed(data)
414410

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#! /usr/bin/env python
2-
# -*- coding: utf-8 -*-
32

43
import os
54

@@ -23,9 +22,10 @@
2322
"Intended Audience :: Developers",
2423
"Operating System :: OS Independent",
2524
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
26-
"Programming Language :: Python :: 2.7",
27-
"Programming Language :: Python :: 3.5",
28-
"Programming Language :: Python :: 3.6",
25+
"Programming Language :: Python :: 3.7",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: PyPy",
2929
"Topic :: Terminals :: Terminal Emulators/X Terminals",
3030
]
3131

tests/test_diff.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
import pyte
62
from pyte import modes as mo
73

tests/test_history.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
import os
62

73
import pyte
84
from pyte import control as ctrl, modes as mo
9-
from pyte.compat import str
105

116

127
def chars(history_lines, columns):

tests/test_input_output.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import json
42
import os.path
53

tests/test_screen.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
import copy
62

73
import pytest

0 commit comments

Comments
 (0)