[WS] Move download_if_exist to lib
git-svn-id: svn://kolibrios.org@9382 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user