diff options
| author | 2019-06-03 13:30:39 +0100 | |
|---|---|---|
| committer | 2019-06-03 13:30:39 +0100 | |
| commit | ef221f41658286968d709487ef25a8dcee48173d (patch) | |
| tree | 28ae5c76632097d1c93c1f00e81019854f90f8f1 /src | |
| parent | Bump resume back down to `draft/resume-0.4` (from `draft/resume-0.5`) for now (diff) | |
| signature | ||
v1.8.0 release
Diffstat (limited to 'src')
| -rw-r--r-- | src/IRCBot.py | 2 | ||||
| -rw-r--r-- | src/IRCLine.py | 8 | ||||
| -rw-r--r-- | src/utils/irc/__init__.py | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py index 37559d95..f5407e59 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -2,7 +2,7 @@ import enum, queue, os, select, socket, threading, time, traceback, typing, uuid from src import EventManager, Exports, IRCServer, Logging, ModuleManager from src import Socket, utils -VERSION = "v1.7.1" +VERSION = "v1.8.0" SOURCE = "https://git.io/bitbot" class TriggerResult(enum.Enum): diff --git a/src/IRCLine.py b/src/IRCLine.py index 9a545479..a612c0ad 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -39,12 +39,12 @@ class Hostmask(object): class ParsedLine(object): def __init__(self, command: str, args: typing.List[str], - prefix: Hostmask=None, + source: Hostmask=None, tags: typing.Dict[str, str]=None): self.command = command self._args = args self.args = IRCArgs(args) - self.prefix = prefix + self.source = source self.tags = {} if tags == None else tags def __repr__(self): @@ -69,8 +69,8 @@ class ParsedLine(object): if self.tags: pieces.append(self._tag_str(self.tags)) - if self.prefix: - pieces.append(str(self.prefix)) + if self.source: + pieces.append(str(self.source)) pieces.append(self.command.upper()) diff --git a/src/utils/irc/__init__.py b/src/utils/irc/__init__.py index 5a6fb69b..9577bcc1 100644 --- a/src/utils/irc/__init__.py +++ b/src/utils/irc/__init__.py @@ -45,7 +45,7 @@ def message_tag_unescape(s): def parse_line(line: str) -> IRCLine.ParsedLine: tags = {} # type: typing.Dict[str, typing.Any] - prefix = None # type: typing.Optional[IRCLine.Hostmask] + source = None # type: typing.Optional[IRCLine.Hostmask] command = None if line[0] == "@": @@ -65,8 +65,8 @@ def parse_line(line: str) -> IRCLine.ParsedLine: trailing = trailing_split if line[0] == ":": - prefix_str, line = line[1:].split(" ", 1) - prefix = seperate_hostmask(prefix_str) + source_str, line = line[1:].split(" ", 1) + source = seperate_hostmask(source_str) command, sep, line = line.partition(" ") args = [] # type: typing.List[str] @@ -77,7 +77,7 @@ def parse_line(line: str) -> IRCLine.ParsedLine: if not trailing == None: args.append(typing.cast(str, trailing)) - return IRCLine.ParsedLine(command, args, prefix, tags) + return IRCLine.ParsedLine(command, args, source, tags) REGEX_COLOR = re.compile("%s(?:(\d{1,2})(?:,(\d{1,2}))?)?" % utils.consts.COLOR) |
