Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

import os

# See if there is a `venv` directory next to our script, and use that if
Expand All @@ -41,7 +39,6 @@
import logbook
import json
import OpenSSL.crypto as crypto
from future.utils import bytes_to_native_str as n
from logbook import Logger, StreamHandler

try:
Expand Down Expand Up @@ -96,7 +93,7 @@
matrix_config_server_write_cb, matrix_timer_cb,
send_cb, matrix_load_users_cb)
from matrix.utf import utf8_decode
from matrix.utils import server_buffer_prnt, server_buffer_set_title
from matrix.utils import server_buffer_prnt, server_buffer_set_title, bytes_to_native_str as n

from matrix.uploads import UploadsBuffer, upload_cb

Expand Down
2 changes: 0 additions & 2 deletions matrix/bar_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

from . import globals as G
from .globals import SERVERS, W
from .utf import utf8_decode
Expand Down
2 changes: 0 additions & 2 deletions matrix/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

import time
import attr
import pprint
Expand Down
2 changes: 0 additions & 2 deletions matrix/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

import html
import re
import textwrap
Expand Down
3 changes: 1 addition & 2 deletions matrix/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals
import argparse
import os
import re
import shlex
from builtins import str
from future.moves.itertools import zip_longest
from collections import defaultdict
from functools import partial
from itertools import zip_longest
from nio import EncryptionError, LocalProtocolError

from . import globals as G
Expand Down
2 changes: 0 additions & 2 deletions matrix/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

from typing import List, Optional
from matrix.globals import SERVERS, W, SCRIPT_NAME
from matrix.utf import utf8_decode
Expand Down
2 changes: 0 additions & 2 deletions matrix/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

import sys
from typing import Any, Dict, Optional
from logbook import Logger
Expand Down
1 change: 0 additions & 1 deletion matrix/message_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

"""Module for rendering matrix messages in Weechat."""

from __future__ import unicode_literals
from nio import Api
from .globals import W
from .colors import Formatted
Expand Down
2 changes: 0 additions & 2 deletions matrix/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals

import os
import pprint
import socket
Expand Down
2 changes: 0 additions & 2 deletions matrix/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

"""Module implementing upload functionality."""

from __future__ import unicode_literals

import attr
import time
import json
Expand Down
2 changes: 0 additions & 2 deletions matrix/utf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import unicode_literals

import sys

# pylint: disable=redefined-builtin
Expand Down
8 changes: 6 additions & 2 deletions matrix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from __future__ import unicode_literals, division

import sys
import time
from typing import Any, Dict, List

Expand All @@ -26,6 +25,11 @@
from .server import MatrixServer


def bytes_to_native_str(b, encoding='utf-8' if sys.version_info[0] >= 3 else None):
return b.decode(encoding) if sys.version_info[0] >= 3 else (
b.__native__() if hasattr(b, '__native__') else b)


def key_from_value(dictionary, value):
# type: (Dict[str, Any], Any) -> str
return list(dictionary.keys())[list(dictionary.values()).index(value)]
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ python = "^3.6"
pyOpenSSL = "^19.1.0"
webcolors = "^1.11.1"
atomicwrites = "^1.3.0"
future = { version = "^0.18.2", python = "<3.2" }
attrs = "^19.3.0"
logbook = "^1.5.3"
pygments = "^2.6.1"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pyOpenSSL
typing ; python_version < "3.5"
webcolors
future; python_version < "3.2"
atomicwrites
attrs
logbook
Expand Down
2 changes: 0 additions & 2 deletions tests/buffer_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

from matrix.buffer import WeechatChannelBuffer
from matrix.utils import parse_redact_args

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

from __future__ import unicode_literals

import webcolors
from collections import OrderedDict
from hypothesis import given
Expand Down