Skip to content

Commit

Permalink
stop supporting python2 at all, remove eye.three
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrargyrum committed Jan 19, 2019
1 parent 765dd07 commit 437b471
Show file tree
Hide file tree
Showing 31 changed files with 15 additions and 80 deletions.
1 change: 0 additions & 1 deletion docs/eye.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ Submodules
eye.qt
eye.reutils
eye.structs
eye.three
eye.utils

7 changes: 0 additions & 7 deletions docs/eye.three.rst

This file was deleted.

11 changes: 9 additions & 2 deletions eye/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# this project is licensed under the WTFPLv2, see COPYING.txt for details

import argparse
Expand All @@ -12,7 +12,6 @@

qApp = lambda: QApplication.instance()

from .three import execfile
from .qt import Slot
from . import pathutils
from . import connector
Expand Down Expand Up @@ -181,6 +180,14 @@ def setupLogging():
root.handlers[0].setLevel(logging.WARNING)


def execfile(path, globals):
"""Exec Python `file` with `globals` as in Python 2"""
with open(path) as fd:
src = fd.read()
code = compile(src, path, 'exec')
exec(code, globals) # pylint: disable=exec-used


def main():
"""Run eye app"""

Expand Down
1 change: 0 additions & 1 deletion eye/colorutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor

from .three import bytes, str

__all__ = ('QColorAlpha', 'QColor')

Expand Down
1 change: 0 additions & 1 deletion eye/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def foo(editor_obj, path):
from PyQt5.QtWidgets import QWidget

from .qt import Signal, Slot
from .three import bytes, str
from .utils import exceptionLogging
from . import BUILDING_DOCS, _addDoc

Expand Down
1 change: 0 additions & 1 deletion eye/helpers/_lexercolorgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from PyQt5.Qsci import QsciLexerPython, QsciLexerCPP, QsciLexerBash, QsciLexerCSS

from ..three import range

# TODO case insensitive

Expand Down
1 change: 0 additions & 1 deletion eye/helpers/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def myActionFunc(ed):
from PyQt5.QtWidgets import QAction
from PyQt5.Qsci import QsciCommand, QsciScintilla

from ..three import bytes, str
from ..connector import categoryObjects, CONNECTOR
from ..qt import Slot
from .. import BUILDING_DOCS
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/confcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from PyQt5.QtCore import QObject

from ..qt import Slot
from ..three import str
from .file_monitor import MonitorWithRename


Expand Down
1 change: 0 additions & 1 deletion eye/helpers/editor_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from ..connector import registerSignal, CategoryMixin
from ..widgets.editor import HasWeakEditorMixin, SciModification
from ..widgets import minibuffer
from ..three import range
from ..qt import Signal, Slot
from .. import structs
from . import buffers
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/file_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from PyQt5.QtCore import QFileSystemWatcher, QSignalMapper, QObject

from ..three import str
from ..qt import Signal, Slot
from ..connector import registerSignal, disabled

Expand Down
1 change: 0 additions & 1 deletion eye/helpers/file_search_plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from PyQt5.QtCore import QObject

from ...three import str
from ...qt import Signal, Slot


Expand Down
1 change: 0 additions & 1 deletion eye/helpers/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeySequence

from ..three import str
from .actions import registerActionShortcut
from ..pathutils import getConfigFilePath

Expand Down
1 change: 0 additions & 1 deletion eye/helpers/lexercolor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
from six.moves.configparser import SafeConfigParser
from logging import getLogger

from ..three import str
from ..connector import categoryObjects, registerSignal, registerSetup, disabled
from ..colorutils import QColorAlpha
from ..lexers import stylesFromLexer
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/minimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from ..widgets.editor import Editor, SciModification
from ..widgets.window import Window
from ..widgets.helpers import acceptIf
from ..three import range
from ..qt import Signal, Slot


Expand Down
1 change: 0 additions & 1 deletion eye/helpers/remote_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from PyQt5.QtCore import QObject, Q_CLASSINFO
from PyQt5.QtDBus import QDBusConnection, QDBusVariant, QDBusMessage

from ..three import str
from ..connector import disabled, CategoryMixin
from ..app import qApp
from ..qt import Slot
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/script_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import logging
import os

from ..three import str
from ..app import qApp
from ..connector import deleteCreatedBy
from ..qt import Slot
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
import os

from ..three import range, bytes
from ..connector import categoryObjects
from ..pathutils import getConfigFilePath
from ..widgets.window import Window
Expand Down
1 change: 0 additions & 1 deletion eye/helpers/ycm/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from PyQt5.QtCore import QObject, QTimer, QProcess, QUrl
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest

from ...three import str, bytes
from ...connector import CategoryMixin
from ...qt import Signal, Slot
from ...app import qApp
Expand Down
1 change: 0 additions & 1 deletion eye/procutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from PyQt5.QtCore import QProcess

from .three import str, bytes
from .qt import Signal, Slot


Expand Down
35 changes: 0 additions & 35 deletions eye/three.py

This file was deleted.

8 changes: 3 additions & 5 deletions eye/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
Positions in the text of an editor widget can be expressed in multiple ways.
First, the position of a character can be expressed as "line-index", which is the line and column of
that character, in terms of Unicode codepoints, with the `str` type (`unicode` for Python 2,
see :doc:`eye.three`).
that character, in terms of Unicode codepoints, with the `str` type.
Unless specified otherwise, line and column numbers start at 0 in EYE.
Another way, more low-level, is the byte offset of the byte in the byte text (with type `bytes`, see
:doc:`eye.three`). The internal byte encoding of the editor is UTF-8, regardless of the encoding of
Another way, more low-level, is the byte offset of the byte in the byte text (with type `bytes`).
The internal byte encoding of the editor is UTF-8, regardless of the encoding of
the underlying disk file, which only intervenes when loading/saving.
Module contents
Expand All @@ -38,7 +37,6 @@
import sip
import six

from ..three import bytes, str
from ..connector import disabled, registerEventFilter
from .helpers import CentralWidgetMixin, acceptIf
from ..qt import Slot, Signal, override
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/eval_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from PyQt5.QtWidgets import QVBoxLayout, QLineEdit, QPlainTextEdit, QWidget, QAction, QCompleter
from six import StringIO

from ..three import bytes
from ..app import qApp
from ..utils import exceptionLogging
from ..qt import Signal, Slot
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import re
from time import time

from ..three import str, range
from ..structs import PropDict
from ..consts import AbsolutePathRole
from ..qt import Slot
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/locationlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from PyQt5.QtGui import QStandardItemModel, QStandardItem
from PyQt5.QtWidgets import QTreeView

from ..three import str
from .helpers import WidgetMixin
from .. import consts
from ..consts import AbsolutePathRole
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/minibuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QLineEdit, QShortcut

from ..three import str
from ..app import qApp
from ..connector import categoryObjects
from ..qt import Signal, Slot
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import os

from ..three import str
from .. import consts
from .helpers import WidgetMixin
from ..helpers import file_search, buffers
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from PyQt5.QtWidgets import QTabWidget, QTabBar, QStackedWidget, QToolButton, QMenu

from .. import consts
from ..three import str
from ..qt import Signal, Slot, override
from ..connector import CategoryMixin, disabled, registerSetup
from .droparea import DropAreaMixin, BandMixin
Expand Down
1 change: 0 additions & 1 deletion eye/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from PyQt5.QtWidgets import QMainWindow, QFileDialog, QDockWidget, QWidget

from ..connector import registerSignal, disabled
from ..three import str
from ..qt import Signal, Slot
from .. import consts
from .helpers import CategoryMixin, acceptIf, parentTabWidget
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# this project is licensed under the WTFPLv2, see COPYING.txt for details

import sys
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,16 @@ classifier =
License :: Public Domain
Topic :: Text Editors
Topic :: Text Editors :: Integrated Development Environments (IDE)
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6


[options]
zip_safe = 0
python_requires = >=3.3
install_requires =
six
PyQt5
QScintilla
pyxdg
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# this project is licensed under the WTFPLv2, see COPYING.txt for details

import glob
Expand Down

0 comments on commit 437b471

Please sign in to comment.