Update Updater.py to actually work, as well as gate font and templates behind flags to save some space on my drive

This commit is contained in:
DUOLabs333 committed 2023-04-13 14:47:37 -04:00
1 parent f748ef091e
commit 81f4797b6b
10 files changed
+24176 -19650

No files matched your search

+6 -3
View File
@@ -42,8 +42,9 @@ urls = [
def download_file(remote,local): def download_file(remote,local):
if os.path.exists(local): if os.path.exists(local):
return #return --- Maybe make some flag for this
with tqdm(desc=path, unit="B", unit_scale=True) as progress_bar: pass
with tqdm(desc=local, unit="B", unit_scale=True) as progress_bar:
r = requests.get(remote, stream=True) r = requests.get(remote, stream=True)
progress_bar.total = int(r.headers.get("Content-Length", 0)) progress_bar.total = int(r.headers.get("Content-Length", 0))
@@ -53,7 +54,7 @@ def download_file(remote,local):
os.makedirs(os.path.dirname(local), exist_ok=True) os.makedirs(os.path.dirname(local), exist_ok=True)
with open(outfn, "wb") as outf: with open(local, "wb") as outf:
for chunk in r.iter_content(chunk_size=1024): for chunk in r.iter_content(chunk_size=1024):
progress_bar.update(len(chunk)) progress_bar.update(len(chunk))
outf.write(chunk) outf.write(chunk)
@@ -119,6 +120,7 @@ def decompress_font_list(flist):
prev_ff, prev_fsf, prev_flg, prev_cat = ff, fsf, flg, cat prev_ff, prev_fsf, prev_flg, prev_cat = ff, fsf, flg, cat
if '--fonts' in sys.argv:
for font in decompress_font_list(db["FNTS"]["list"]): for font in decompress_font_list(db["FNTS"]["list"]):
path = "rsrc/fonts/" + font.url path = "rsrc/fonts/" + font.url
if not os.path.isfile(root + path): if not os.path.isfile(root + path):
@@ -135,6 +137,7 @@ for font_file in list(set(fonts_local)-set(fonts_db)):
print('Removing ' + font_file) print('Removing ' + font_file)
os.remove(font_file) os.remove(font_file)
if '--templates' in sys.argv:
templates_db=['file/' + ('psdshared' if _[4].startswith("https://i.imgur.com/") or _[4].startswith("https://imgur.com/") else 'pp-resources') +'/' + _[3] for _ in json.load(open(root+"papi/tpls.json"))['list']] templates_db=['file/' + ('psdshared' if _[4].startswith("https://i.imgur.com/") or _[4].startswith("https://imgur.com/") else 'pp-resources') +'/' + _[3] for _ in json.load(open(root+"papi/tpls.json"))['list']]
for template in templates_db: for template in templates_db:
path="https://f000.backblazeb2.com/" + template path="https://f000.backblazeb2.com/" + template
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
+15295 -14585
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

+7
View File
@@ -333,6 +333,8 @@
border-top-left-radius:4px; border-top-left-radius:4px;
border-top-right-radius:4px; border-top-right-radius:4px;
opacity: 0.7;
margin-right:4px; margin-right:4px;
transition: background 0.25s ease-in-out; transition: background 0.25s ease-in-out;
@@ -351,6 +353,11 @@
.block .panelhead .active .block .panelhead .active
{ {
background-color: var(--base); background-color: var(--base);
opacity:1;
}
.block .panelhead .active div
{
} }
.block .panelhead div .cross .block .panelhead div .cross
+2 -1
View File
@@ -130,7 +130,8 @@
function updateView() { function updateView() {
var w = window.innerWidth, h=window.innerHeight; var w = window.innerWidth, h=window.innerHeight;
itms.style.height=(h-90)+"px"; var sh = 90; if(w<1000) sh=130; if(w<800) sh=160;
itms.style.height=(h-sh)+"px";
cats.style.height=(h- 1)+"px"; cats.style.height=(h- 1)+"px";
add_link.style.display=(false?"none":"inline-block"); add_link.style.display=(false?"none":"inline-block");