From 13d27d4b81017b52001364edcd36b02e1067d722 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Wed, 3 Jan 2018 15:58:57 +0100 Subject: [PATCH] [themes] Do not automatically download symbols.json In order to use symbol files, symbol.json needs to be created manually now. Also, remove symbol usage from the prepackaged themes to avoid breakage. fixes #216 --- bumblebee/theme.py | 25 +++++++++++-------------- themes/icons/awesome-fonts.json | 4 ++-- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/bumblebee/theme.py b/bumblebee/theme.py index c65cc7b..6a81fb3 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -61,20 +61,17 @@ class Theme(object): except Exception: pass try: - if not os.path.exists("{}/symbols.json".format(path)): - data = yaml.load(requests.get("https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/src/icons.yml").text) - with io.open("{}/symbols.json".format(path), "w") as f: - json.dump(data, f) - data = json.load(io.open("{}/symbols.json".format(path))) - self._symbols = {} - for icon in data["icons"]: - code = int(icon["unicode"], 16) - try: - code = unichr(code) - except Exception: - code = chr(code) - self._symbols["${{{}}}".format(icon["id"])] = code - self._symbols["${{{}}}".format(icon["name"])] = code + if os.path.exists("{}/symbols.json".format(path)): + data = json.load(io.open("{}/symbols.json".format(path))) + self._symbols = {} + for icon in data["icons"]: + code = int(icon["unicode"], 16) + try: + code = unichr(code) + except Exception: + code = chr(code) + self._symbols["${{{}}}".format(icon["id"])] = code + self._symbols["${{{}}}".format(icon["name"])] = code except Exception as e: logging.error("failed to load symbols: {}".format(str(e))) diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 62ea82f..d5f1c97 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -3,8 +3,8 @@ "separator": "", "padding": " ", "unknown": { "prefix": "" } }, - "date": { "prefix": "${calendar}" }, - "time": { "prefix": "${clock-o}" }, + "date": { "prefix": "" }, + "time": { "prefix": "" }, "datetime": { "prefix": "" }, "memory": { "prefix": "" }, "cpu": { "prefix": "" },