[WS] Move download_if_exist to lib

git-svn-id: svn://kolibrios.org@9382 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
2021-12-04 09:59:17 +00:00
parent f505262a89
commit 460c5f6329
2 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
import os
import urllib.request
from .logging import log
@@ -6,4 +7,7 @@ def download(link, path):
urllib.request.urlretrieve(link, path)
log("Done.")
def download_if_not_exist(link, path):
if not os.path.exists(path):
download(link, path)