We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42110e9 commit 5040170Copy full SHA for 5040170
src/fetchcode/__init__.py
@@ -88,13 +88,16 @@ def fetch_ftp(url, location):
88
return resp
89
90
91
-def fetch(url):
+def fetch(url, location=None):
92
"""
93
Return a `Response` object built from fetching the content at the `url` URL string and store content at a temporary file.
94
+ Saving the content in a file at `location`.
95
+ If location is None, save the file in a newly created temporary directory.
96
97
- temp = tempfile.NamedTemporaryFile(delete=False)
- location = temp.name
98
+ if location is None:
99
+ temp = tempfile.NamedTemporaryFile(delete=False)
100
+ location = temp.name
101
102
url_parts = urlparse(url)
103
scheme = url_parts.scheme
0 commit comments