diff options
author | Alexander Hayden <alexhayden25@gmail.com> | 2020-11-30 00:53:05 -0500 |
---|---|---|
committer | Alexander Hayden <alexhayden25@gmail.com> | 2020-11-30 00:53:05 -0500 |
commit | 5b25086399f6a08d087b43ed57a9f3068516d0a2 (patch) | |
tree | 11d019421bb26562da4afd9f6b8cdde9b79c0dd8 /util.py | |
parent | b29b1bb338e8745c24d5348de8f65f4667b9e22f (diff) | |
download | modpackman-5b25086399f6a08d087b43ed57a9f3068516d0a2.tar.gz modpackman-5b25086399f6a08d087b43ed57a9f3068516d0a2.zip |
finish automatic forge installer
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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): """ |