aboutsummaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authorAlexander Hayden <alexhayden25@gmail.com>2020-11-30 00:53:05 -0500
committerAlexander Hayden <alexhayden25@gmail.com>2020-11-30 00:53:05 -0500
commit5b25086399f6a08d087b43ed57a9f3068516d0a2 (patch)
tree11d019421bb26562da4afd9f6b8cdde9b79c0dd8 /util.py
parentb29b1bb338e8745c24d5348de8f65f4667b9e22f (diff)
downloadmodpackman-5b25086399f6a08d087b43ed57a9f3068516d0a2.tar.gz
modpackman-5b25086399f6a08d087b43ed57a9f3068516d0a2.zip
finish automatic forge installer
Diffstat (limited to 'util.py')
-rw-r--r--util.py5
1 files changed, 5 insertions, 0 deletions
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):
"""