이거 안되는 이유를 좀 알려주실분 찾아요

master
Qwreey 2023-02-02 19:24:35 +09:00
parent b7edf6654e
commit 912fe5951d
2 changed files with 24 additions and 0 deletions

22
src/nerdfonts/download.py Normal file
View File

@ -0,0 +1,22 @@
if __name__ == "__main__":
import os
import sys
sys.path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))+"/../"))
import os
import zipfile
import wgetHandler
link_FontPatcher = "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip"
def downloadPatcher():
if not os.path.exists("assets"): os.mkdir("assets")
if not os.path.exists("assets/NerdFontPatcher_extract"):
if not os.path.exists("assets/NerdFontPatcher.zip"):
wgetHandler.download(link_FontPatcher,"assets/NerdFontPatcher.zip")
print("Unzipping NerdFontPatcher.zip",end="")
with zipfile.ZipFile("assets/NerdFontPatcher.zip", 'r') as zip_ref:
extractName = zip_ref.extractall("assets/NerdFontPatcher_extract")
print(" [OK]")
return "assets/NanumSquareNeoKr.ttf"
if __name__ == "__main__": downloadPatcher()

View File

@ -1,6 +1,7 @@
from .wget import wget
import math
# bar 를 커스텀.... 하는 어떤 글에서 가져온거
def bar_custom(current, total, width=80):
width=30
avail_dots = width-2
@ -9,6 +10,7 @@ def bar_custom(current, total, width=80):
progress = "%d%% %s [%d / %d]" % (current / total * 100, percent_bar, current, total)
return progress
# 그냥 간단한 download 함수인데 좀 프린트를 넣어봤는거?
def download(url, fileName):
print("Downloading resource to "+fileName+" ...")
wget.download(url, fileName, bar=bar_custom)