Merge pull request #1927 from gtaylor/futures-removal

Remove Python 2.7 compatibility shims
This commit is contained in:
Griatch 2019-09-15 13:00:43 +02:00 committed by GitHub
commit ac3a8d2199
26 changed files with 30 additions and 114 deletions

View file

@ -19,7 +19,6 @@ Evennia knows which modules to use for inputfuncs by
settings.INPUT_FUNC_MODULES.
"""
from future.utils import viewkeys
import importlib
from codecs import lookup as codecs_lookup

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-01-28 23:11
from __future__ import unicode_literals
from base64 import b64encode
from django.db import migrations

View file

@ -3,7 +3,6 @@ This connects to an IRC network/channel and launches an 'bot' onto it.
The bot then pipes what is being said between the IRC channel and one or
more Evennia channels.
"""
from future.utils import viewkeys, viewvalues, viewitems
import re
from twisted.application import internet
@ -90,15 +89,15 @@ IRC_COLOR_MAP = dict((
))
# ansi->irc
RE_ANSI_COLOR = re.compile(r"|".join(
[re.escape(key) for key in viewkeys(IRC_COLOR_MAP)]), re.DOTALL)
[re.escape(key) for key in IRC_COLOR_MAP.keys()]), re.DOTALL)
RE_MXP = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
RE_ANSI_ESCAPES = re.compile(r"(%s)" % "|".join(("{{", "%%", "\\\\")), re.DOTALL)
# irc->ansi
_CLR_LIST = [re.escape(val)
for val in sorted(viewvalues(IRC_COLOR_MAP), key=len, reverse=True) if val.strip()]
for val in sorted(IRC_COLOR_MAP.values(), key=len, reverse=True) if val.strip()]
_CLR_LIST = _CLR_LIST[-2:] + _CLR_LIST[:-2]
RE_IRC_COLOR = re.compile(r"|".join(_CLR_LIST), re.DOTALL)
ANSI_COLOR_MAP = dict((tup[1], tup[0]) for tup in viewitems(IRC_COLOR_MAP) if tup[1].strip())
ANSI_COLOR_MAP = dict((tup[1], tup[0]) for tup in IRC_COLOR_MAP.items() if tup[1].strip())
def parse_ansi_to_irc(string):

View file

@ -14,7 +14,6 @@ There are two similar but separate stores of sessions:
"""
import time
from builtins import object
from future.utils import listvalues
from django.conf import settings
from evennia.commands.cmdhandler import CMD_LOGINSTART
@ -148,7 +147,7 @@ class SessionHandler(dict):
"""
if include_unloggedin:
return listvalues(self)
return list(self.values())
else:
return [session for session in self.values() if session.logged_in]