From 9cb127ee218d681df9e33b739ba6c60cab1a0943 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 31 Jan 2019 15:44:31 +0100 Subject: [PATCH] Remove hipchat module --- README.md | 2 +- bumblebee/modules/hipchat.py | 47 --------------------------------- themes/icons/ascii.json | 3 --- themes/icons/awesome-fonts.json | 3 --- themes/icons/ionicons.json | 3 --- 5 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 bumblebee/modules/hipchat.py diff --git a/README.md b/README.md index ebb6f4d..a19a92a 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ Modules and commandline utilities are only required for modules, the core itself * psutil (for the modules 'cpu', 'memory', 'traffic') * netifaces (for the modules 'nic', 'traffic') -* requests (for the modules 'weather', 'github', 'getcrypto', 'stock', 'hipchat', 'currency') +* requests (for the modules 'weather', 'github', 'getcrypto', 'stock', 'currency') * power (for the module 'battery') * dbus (for the module 'spotify') * i3ipc (for the module 'title') diff --git a/bumblebee/modules/hipchat.py b/bumblebee/modules/hipchat.py deleted file mode 100644 index 00898e3..0000000 --- a/bumblebee/modules/hipchat.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Displays the unread messages count for an HipChat user - -Requires the following library: - * requests - -Parameters: - * hipchat.token: HipChat user access token, the token needs to have the 'View Messages' scope. - * hipchat.interval: Refresh interval in minutes (defaults to 5) -""" - -import bumblebee.input -import bumblebee.output -import bumblebee.engine - -try: - import requests -except ImportError: - pass - -HIPCHAT_API_URL = "https://www.hipchat.com/v2/readstate?expand=items.unreadCount" - -class Module(bumblebee.engine.Module): - def __init__(self, engine, config): - super(Module, self).__init__(engine, config, - bumblebee.output.Widget(full_text=self.output) - ) - self._count = 0 - self.interval(5) - - self._requests = requests.Session() - self._requests.headers.update({"Authorization":"Bearer {}".format(self.parameter("token", ""))}) - - engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, cmd=self.update) - - def output(self, _): - return str(self._count) - - def update(self, _): - try: - self._count = 0 - items = self._requests.get(HIPCHAT_API_URL).json().get('items') - self._count = sum([item.get('unreadCount').get('count') for item in items]) - - except Exception: - self._count = "n/a" - -# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/themes/icons/ascii.json b/themes/icons/ascii.json index 42e78af..3980e8b 100644 --- a/themes/icons/ascii.json +++ b/themes/icons/ascii.json @@ -106,9 +106,6 @@ "github": { "prefix": "github" }, - "hipchat": { - "prefix": "hipchat" - }, "spotify": { "prefix": "" }, diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 83b5ac8..56746d9 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -161,9 +161,6 @@ "github": { "prefix": "  " }, - "hipchat": { - "prefix": "  " - }, "spotify": { "prefix": "  " }, diff --git a/themes/icons/ionicons.json b/themes/icons/ionicons.json index 29f2303..ae1fa2e 100644 --- a/themes/icons/ionicons.json +++ b/themes/icons/ionicons.json @@ -143,9 +143,6 @@ "github": { "prefix": "\uf233" }, - "hipchat": { - "prefix": "\uf11c" - }, "spotify": { "prefix": "\uf305" },