<commit_before>#!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 <NAME>
# License: MIT, see LICENSE for details
from ..notifier import INotifier
from .. import state_helpers
from twisted.internet import protocol, reactor
from twisted.plugin import IPlugin
from twisted.words.protocols.irc import IRCClient
from zope.interface.declarations import implementer


class IRCNotifierBot(IRCClient):
    @property
    def nickname(self):
        return self.factory.nick

    def signedOn(self):
        self.join(self.factory.channel)

    def _msg_channel(self, msg):
        """Send ``msg`` to the configured channel.

        :type msg: str
        """
        self.msg(self.factory.channel, msg)

    def state_changed(self, unit, old_state, new_state):
        """
        :type unit: str
        :type old_state: :class:`sagbescheid.state.State`<commit_msg>irc: reply to CTCP version<commit_after>#!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 <NAME>
# License: MIT, see LICENSE for details
from ..notifier import INotifier
from ..version import __version__
from .. import state_helpers
from twisted.internet import protocol, reactor
from twisted.plugin import IPlugin
from twisted.words.protocols.irc import IRCClient
from zope.interface.declarations import implementer


class IRCNotifierBot(IRCClient):
    versionName = "sagbescheid"
    versionNum = __version__
    lineRate = 1

    @property
    def nickname(self):
        return self.factory.nick

    def signedOn(self):
        self.join(self.factory.channel)

    def _msg_channel(self, msg):
        """Send ``msg`` to the configured channel.

        :type msg: str
        """
        self.msg(self.factory.channel, msg)

    def state_changed(self, unit, old_state, new_state):
        """
        :type unit: str
        :type old_state: :class:`sagbescheid.state.State`
{'fraction_non_alphanumeric': 0.10032362459546926, 'fraction_numerical': 0.005933117583603021, 'mean_word_length': 3.2448512585812357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4806619', 'n_tokens_mistral': 574, 'n_tokens_neox': 542, 'n_words': 159}