From 5b25086399f6a08d087b43ed57a9f3068516d0a2 Mon Sep 17 00:00:00 2001 From: Alexander Hayden Date: Mon, 30 Nov 2020 00:53:05 -0500 Subject: finish automatic forge installer --- util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'util.py') diff --git a/util.py b/util.py index fba40fe..d6ac035 100644 --- a/util.py +++ b/util.py @@ -8,6 +8,7 @@ import collections import urllib.parse import multiprocessing import pathlib +import base64 from configparser import ConfigParser import requests @@ -79,6 +80,10 @@ def sanitize_text(text): sanitized += replacement_map[char] return sanitized +def generate_base64_icon(filename): + with open(filename, "rb") as f: + return "data:image/png;base64," + base64.b64encode(f.read()).decode("utf8") + def read_file(fil): """ -- cgit v1.2.3