Skip to content

Commit 57a5c44

Browse files
authored
Merge pull request #22 from pywugate/dev
Replace Base.download() with Downloads.download()
2 parents 6e32c1a + 8b91b95 commit 57a5c44

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
*.jl.cov
1111

1212
# Dev tools
13-
.vscode/
13+
.vscode/
14+
Manifest_.toml

Project.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
name = "ReverseGeocode"
22
uuid = "96b87e3f-b46e-456c-8178-0e438baab6fa"
33
authors = ["Jan Mrkos <[email protected]>"]
4-
version = "0.5.0"
4+
version = "0.5.1"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
88
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
99
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
10+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1011
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1112
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
1213
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
1314

1415
[compat]
15-
julia = "1"
1616
CSV = "0.10"
1717
DataFrames = "1"
1818
DataStructures = "0.18"
1919
NearestNeighbors = "0.4"
2020
ZipFile = "0.10"
21+
julia = "1"
22+
Downloads = "1"

src/ReverseGeocode.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ using ZipFile,
55
NearestNeighbors,
66
Logging,
77
DataFrames,
8-
DataStructures
8+
DataStructures,
9+
Downloads
910

1011
export Geocoder, decode
1112

src/geocoder.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ function download_raw_geoname_data(;
177177
data_dir::String=DATA_DIR,
178178
geo_file::String=GEO_FILE,
179179
)
180-
181-
download("$GEO_SOURCE/$geo_file.zip", joinpath(data_dir,"$geo_file.zip"))
180+
Downloads.download("$GEO_SOURCE/$geo_file.zip", joinpath(data_dir,"$geo_file.zip"))
182181
end
183182

184183
"""
@@ -208,7 +207,7 @@ Download and resave the country codes csv from geonames.
208207
Country codes are part of the package so this function does not usually need to run during install.
209208
"""
210209
function download_country_codes(;data_dir::String=DATA_DIR)
211-
download("http://download.geonames.org/export/dump/countryInfo.txt", joinpath(data_dir, "countryInfo.txt"))
210+
Downloads.download("http://download.geonames.org/export/dump/countryInfo.txt", joinpath(data_dir, "countryInfo.txt"))
212211
country_info = CSV.File(joinpath(data_dir,"countryInfo.txt"); delim="\t", header=false, select=[1,5], datarow=51)
213212
country_codes = Dict([(c.Column1, c.Column5) for c in country_info])
214213
CSV.write(joinpath(data_dir,"country_codes.csv"), country_codes, delim="\t", header=false)

0 commit comments

Comments
 (0)