mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 23:39:46 +00:00
Change IRCv3 marks to reference capabilities instead of v3.1 / v3.2
This commit is contained in:
@ -5,16 +5,51 @@ import enum
|
||||
class Specifications(enum.Enum):
|
||||
RFC1459 = "RFC1459"
|
||||
RFC2812 = "RFC2812"
|
||||
IRC301 = "IRCv3.1"
|
||||
IRC302 = "IRCv3.2"
|
||||
IRCv3 = "IRCv3" # Mark with capabilities whenever possible
|
||||
Oragono = "Oragono"
|
||||
Multiline = "multiline"
|
||||
MessageTags = "message-tags"
|
||||
|
||||
Ircdocs = "ircdocs"
|
||||
"""Any document on ircdocs.horse (especially defs.ircdocs.horse),
|
||||
excluding modern.ircdocs.horse"""
|
||||
|
||||
Modern = "modern"
|
||||
|
||||
@classmethod
|
||||
def of_name(cls, name):
|
||||
def from_name(cls, name):
|
||||
name = name.upper()
|
||||
for spec in cls:
|
||||
if spec.value.upper() == name:
|
||||
return spec
|
||||
raise ValueError(name)
|
||||
|
||||
|
||||
@enum.unique
|
||||
class Capabilities(enum.Enum):
|
||||
AWAY_NOTIFY = "away-notify"
|
||||
BATCH = "batch"
|
||||
ECHO_MESSAGE = "echo-message"
|
||||
EXTENDED_JOIN = "extended-join"
|
||||
LABELED_RESPONSE = "labeled-response"
|
||||
MESSAGE_TAGS = "message-tags"
|
||||
MULTILINE = "draft/multiline"
|
||||
MULTI_PREFIX = "multi-prefix"
|
||||
SERVER_TIME = "server-time"
|
||||
|
||||
@classmethod
|
||||
def from_name(cls, name):
|
||||
try:
|
||||
return cls(name.lower())
|
||||
except ValueError:
|
||||
raise ValueError(name) from None
|
||||
|
||||
|
||||
@enum.unique
|
||||
class IsupportTokens(enum.Enum):
|
||||
MONITOR = "MONITOR"
|
||||
|
||||
@classmethod
|
||||
def from_name(cls, name):
|
||||
try:
|
||||
return cls(name.upper())
|
||||
except ValueError:
|
||||
raise ValueError(name) from None
|
||||
|
Reference in New Issue
Block a user