Move equals from users to context

This commit is contained in:
Vgr E. Barry 2016-12-19 12:29:45 -05:00
parent 63d908a61a
commit 59e7c13a0b
2 changed files with 4 additions and 4 deletions

View File

@ -91,6 +91,9 @@ def lower(nick):
return nick.lower().translate(str.maketrans(mapping))
def equals(nick1, nick2):
return lower(nick1) == lower(nick2)
def context_types(*types):
def wrapper(cls):
cls._getters = l = []

View File

@ -2,7 +2,7 @@ from weakref import WeakSet
import fnmatch
import re
from src.context import IRCContext, Features, lower
from src.context import IRCContext, Features, lower, equals
from src import settings as var
from src import db
@ -169,9 +169,6 @@ def parse_rawnick_as_dict(rawnick, *, default=None):
return _raw_nick_pattern.search(rawnick).groupdict(default)
def equals(nick1, nick2):
return lower(nick1) == lower(nick2)
class User(IRCContext):
is_user = True