Example #1
0
    def __init__(self, irc):
        global instance
        super(Taiga, self).__init__(irc)
        instance = self

        callback = TaigaWebHookService(self, irc)
        httpserver.hook('taiga', callback)
Example #2
0
    def __init__(self, irc):
        global instance
        super(Gogs, self).__init__(irc)
        instance = self

        callback = GogsWebHookService(self, irc)
        httpserver.hook('gogs', callback)
Example #3
0
    def __init__(self, irc):
        global instance
        super(Gitlab, self).__init__(irc)
        instance = self

        callback = GitlabWebHookService(self, irc)
        httpserver.hook('gitlab', callback)
Example #4
0
    def __init__(self, irc):
        self.__parent = super(Glob2Chan, self)
        callbacks.Plugin.__init__(self, irc)

        callback = Glob2ChanCallback()
        callback.plugin = self
        httpserver.hook('glob2', callback)
        self._users = {}
Example #5
0
    def __init__(self, irc):
        self.__parent = super(Glob2Chan, self)
        callbacks.Plugin.__init__(self, irc)

        callback = Glob2ChanCallback()
        callback.plugin = self
        httpserver.hook('glob2', callback)
        self._users = {}
Example #6
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Gogs, self)
        self.__parent.__init__(irc)
        instance = self

        callback = GogsWebHookService(self)
        httpserver.hook('gogs', callback)
Example #7
0
    def __init__(self, irc):
        self.__parent = super(LimnoriaChan, self)
        self.__parent.__init__( irc)

        callback = LimnoriaDebBuildsCallback()
        callback.plugin = self
        httpserver.hook('limnoria_debian_builds', callback)
        self._users = {}
Example #8
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Wekan, self)
        self.__parent.__init__(irc)
        instance = self

        callback = WekanWebHookService(self)
        httpserver.hook('wekan', callback)
Example #9
0
    def __init__(self, irc):
        global instance
        self.__parent = super(GitHub, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = GithubCallback()
        callback.plugin = self
        httpserver.hook('github', callback)
Example #10
0
    def __init__(self, irc):
        self.__parent = super(Herald, self)
        callbacks.Plugin.__init__(self, irc)
        self.irc = irc

        callback = HeraldServerCallback()
        # Insert callbacks.Plugin into the ole httpservercallback class
        callback.plugin = self
        httpserver.hook('herald', callback)
Example #11
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Website, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = WebsiteCallback()
        callback.plugin = self
        httpserver.hook('website', callback)
Example #12
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Website, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = WebsiteCallback()
        callback.plugin = self
        httpserver.hook('website', callback)
Example #13
0
    def __init__(self, irc):
        global instance
        self.__parent = super(GitHub, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = GithubCallback()
        callback.plugin = self
        httpserver.hook('github', callback)
Example #14
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Realhook, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = RealhookCallback()
        callback.plugin = self
        httpserver.hook('realhook', callback)
Example #15
0
    def __init__(self, irc):
        global instance
        self.__parent = super(Realhook, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = RealhookCallback()
        callback.plugin = self
        httpserver.hook('realhook', callback)
Example #16
0
    def __init__(self, irc):
        self.__parent = super(ShortURLService, self)
        callbacks.Plugin.__init__(self, irc)
        self.db = ShortURLServiceDB()

        callback = ShortURLServiceCallback()
        callback.plugin = self
        callback.db = self.db
        httpserver.hook('S', callback)
Example #17
0
    def __init__(self, irc):
        # Some stuff needed by Supybot
        self.__parent = super(WebLogs, self)
        callbacks.Plugin.__init__(self, irc)

        self.lastStates = {}

        # registering the callback
        callback = WebLogsServerCallback() # create an instance of the callback
        httpserver.hook('weblogs', callback)
Example #18
0
 def __init__(self, irc):
     self.__parent = super(WebHooks, self)
     self.__parent.__init__(irc)
     # webhook.
     callback = WebHooksServiceCallback(self)
     callback.plugin = self
     httpserver.hook('webhooks', callback)
     # db.
     self._webhooks = defaultdict(set)
     self._loadpickle() # load saved data.
Example #19
0
    def __init__(self, irc):
        global instance

        # Store the super() information so that reloads don't fail
        self.__parent = super(Gitlab, self)
        self.__parent.__init__(irc)
        instance = self

        callback = GitlabWebHookService(self)
        httpserver.hook('gitlab', callback)
Example #20
0
    def __init__(self, irc):
        self.__parent = super(WebStats, self)
        callbacks.Plugin.__init__(self, irc)
        self.lastmsg = {}
        self.ircstates = {}
        self.db = WebStatsDB()

        callback = WebStatsServerCallback()
        callback.plugin = self
        callback.db = self.db
        httpserver.hook('webstats', callback)
Example #21
0
    def __init__(self, irc):
        self.__parent = super(WebStats, self)
        callbacks.Plugin.__init__(self, irc)
        self.lastmsg = {}
        self.ircstates = {}
        self.db = WebStatsDB()

        callback = WebStatsServerCallback()
        callback.plugin = self
        callback.db = self.db
        httpserver.hook("webstats", callback)
Example #22
0
    def __init__(self, irc):
        # Some stuff needed by Supybot
        self.__parent = super(WebLogs, self)
        callbacks.Plugin.__init__(self, irc)

        self.lastStates = {}
        WebLogsMiddleware._plugin = self

        # registering the callback
        callback = WebLogsServerCallback(
        )  # create an instance of the callback
        httpserver.hook('weblogs', callback)
Example #23
0
    def __init__(self, irc):
        # Some stuff needed by Supybot
        global instance
        self.__parent = super(MsgServer, self)
        instance = self
        callbacks.Plugin.__init__(self, irc)

        # registering the callback
        callback = ServerCallback()  # create an instance of the callback
        callback.plugin = self
        httpserver.hook("msgserver", callback)  # register the callback at `/msgserver`
        for cb in self.cbs:
            cb.plugin = self
Example #24
0
    def __init__(self, irc):
        global instance
        self.__parent = super(GitHub, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = GithubCallback()
        callback.plugin = self
        httpserver.hook('github', callback)
        for cb in self.cbs:
            cb.plugin = self

        if 'reply_env' not in ircmsgs.IrcMsg.__slots__:
            log.error("Your version of Supybot is not compatible with "
                      "reply environments. So, the GitHub plugin won't "
                      "be able to announce events from GitHub.")
Example #25
0
    def __init__(self, irc):
        global instance
        self.__parent = super(GitHub, self)
        callbacks.Plugin.__init__(self, irc)
        instance = self

        callback = GithubCallback()
        callback.plugin = self
        httpserver.hook('github', callback)
        for cb in self.cbs:
            cb.plugin = self

        if 'reply_env' not in ircmsgs.IrcMsg.__slots__:
            log.error("Your version of Supybot is not compatible with "
                      "reply environments. So, the GitHub plugin won't "
                      "be able to announce events from GitHub.")
Example #26
0
 def _startHttp(self):
     callback = ChannelStatusCallback()
     callback._plugin = self
     httpserver.hook('channelstatus', callback)
     self._http_running = True
Example #27
0
    def __init__(self, irc):
        self.__parent = super(IcingaNotifier, self)
        self.__parent.__init__(irc)

        callback = IcingaCallback()
        httpserver.hook('icinga', callback)
Example #28
0
    def __init__(self, irc):
        self.__parent = super(WebDoc, self)
        callbacks.Plugin.__init__(self, irc)

        callback = WebDocServerCallback(self, irc)
        httpserver.hook('plugindoc', callback)
Example #29
0
 def _startHttp(self):
     callback = FactoidsCallback()
     callback._plugin = self
     httpserver.hook('factoids', callback)
     self._http_running = True
Example #30
0
 def _startHttp(self):
     callback = FactoidsCallback()
     callback._plugin = self
     httpserver.hook('factoids', callback)
     self._http_running = True
Example #31
0
    def __init__(self, irc):
        self.__parent = super(WebLogsS3, self)
        callbacks.Plugin.__init__(self, irc)

        httpserver.hook("weblogs", WebLogsS3Callback())
Example #32
0
 def _startHttp(self):
     callback = FediverseHttp()
     callback._plugin = self
     httpserver.hook("fediverse", callback)
Example #33
0
 def _startHttp(self):
     callback = AkaHTTPCallback()
     callback._plugin = self
     httpserver.hook('aka', callback)
     self._http_running = True
Example #34
0
    def __init__(self, irc):
        self.__parent = super(WebDoc, self)
        callbacks.Plugin.__init__(self, irc)

        callback = WebDocServerCallback(self, irc)
        httpserver.hook('plugindoc', callback)
Example #35
0
    def __init__(self, irc):
        self.__parent = super(GitHub, self)
        callbacks.Plugin.__init__(self, irc)

        httpserver.hook("github", GitHubCallback())
Example #36
0
    def __init__(self, irc):
        self.__parent = super(DropboxWatch, self)
        self.__parent.__init__(irc)
        callback = DropboxWatchServerCallback()
        self._abbrev = DropboxWatchServerCallback.name.lower()

        for server in httpserver.http_servers:
            if self._abbrev in server.callbacks:
                httpserver.unhook(self._abbrev)
                break

        httpserver.hook(self._abbrev, callback)
        interval = conf.supybot.plugins.DropboxWatch.interval()

        def f():
            if events.empty():
                return

            path_dict = dict()

            for channel in irc.state.channels:
                paths = conf.supybot.plugins.DropboxWatch.paths.get(channel)()

                if len(paths) == 0:
                    continue

                for path in paths:
                    if path in path_dict:
                        continue

                    path_dict[path] = (set(), set())

            try:
                while not events.empty():
                    event = events.get_nowait()

                    for path in path_dict.keys():
                        if event[1].startswith('/' + path):
                            updates, deletes = path_dict[path]

                            if event[0] == EventType.delete:
                                deletes.add(event[1])
                            else:
                                updates.add(event[1])

                            path_dict[path] = (updates, deletes)
            except Queue.Empty:
                log.warning('Queue empty')

            for k in path_dict.keys():
                updates, deletes = path_dict[k]
                output = ''

                if len(deletes) > 0:
                    output = 'Deleted: %s' % (', '.join(deletes))

                if len(updates) > 0:
                    if len(output) > 0:
                        output += ' | '

                    output += 'Updated: %s' % (', '.join(updates))

                if len(output) == 0:
                    continue

                output = '[Dropbox] %s' % output

                for chan in irc.state.channels:
                    paths = conf.supybot.plugins.DropboxWatch.paths.get(chan)()

                    if len(paths) == 0 or k not in paths:
                        continue

                    log.info('%s >> %s' % (chan, output))
                    irc.queueMsg(ircmsgs.privmsg(chan, output))

        if self._abbrev in schedule.schedule.events:
            schedule.removeEvent(self._abbrev)

        schedule.addPeriodicEvent(f, interval, name=self._abbrev, now=False)