Skip to content

Commit 198326a

Browse files
committed
remove comments
1 parent e34b7e8 commit 198326a

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

src/compas/utilities/remote.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,11 @@
44

55
import os
66

7-
# import io
8-
9-
# import compas
10-
117
try:
12-
# from urllib.request import urlopen
138
from urllib.request import urlretrieve
149
except ImportError:
15-
# from urllib2 import urlopen
1610
from urllib import urlretrieve
1711

18-
# try:
19-
# from PIL import Image
20-
# except ImportError:
21-
# if compas.is_windows():
22-
# compas.raise_if_not_ironpython()
23-
# elif not compas.is_mono():
24-
# raise
25-
2612

2713
def download_file_from_remote(source, target, overwrite=True):
2814
"""Download a file from a remote source and save it to a local destination.
@@ -66,41 +52,3 @@ def download_file_from_remote(source, target, overwrite=True):
6652
else:
6753
if overwrite:
6854
urlretrieve(source, target)
69-
70-
71-
# def download_image_from_remote(source, target, show=False):
72-
# """Download an image from a remote source and save it to a local destination.
73-
74-
# Parameters
75-
# ----------
76-
# source : str
77-
# The url of the source file.
78-
# target : str
79-
# The path of the local destination.
80-
# show : bool, optional
81-
# Show the downloaded image.
82-
# Default is ``False``
83-
84-
# Examples
85-
# --------
86-
# .. code-block:: python
87-
88-
# import os
89-
# import compas
90-
# from compas.utilities.remote import download_image_from_remote
91-
92-
# source = 'http://block.arch.ethz.ch/brg/images/cache/dsc02360_ni-2_cropped_1528706473_624x351.jpg'
93-
# target = os.path.join(compas.APPDATA, 'data', 'theblock.jpg')
94-
95-
# download_image_from_remote(source, target, show=True)
96-
97-
# """
98-
# # response = requests.get(source)
99-
# # response.raise_for_status()
100-
101-
# response = urlopen(source)
102-
# image = Image.open(io.BytesIO(response.read()))
103-
104-
# if show:
105-
# image.show()
106-
# image.save(target)

0 commit comments

Comments
 (0)