Skip to content

Commit b8aa6fb

Browse files
committed
nicer UI
1 parent f42e2e8 commit b8aa6fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/core.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ get_czso_catalogue <- function() {
7474
timeout = 30000,
7575
debug = "on",
7676
run = "Run Query")
77-
usethis::ui_info("Downloading")
77+
usethis::ui_info("Reading data from data.gov.cz")
7878
cat_rslt <- httr::GET(sparql_url, query = params,
7979
# accept("application/sparql-results+json"),
8080
httr::user_agent(ua_string),
@@ -83,13 +83,13 @@ get_czso_catalogue <- function() {
8383

8484
# print(params$query)
8585

86-
usethis::ui_info("Reading data")
8786
if(httr::status_code(cat_rslt) > 200) {
8887
print(httr::http_status(cat_rslt))
8988
rslt <- httr::content(cat_rslt, as = "text")
9089
} else
9190
rslt <- cat_rslt %>% httr::content(as = "text")
9291
rslt <- readr::read_csv(rslt, col_types = readr::cols(modified = "T"))
92+
usethis::ui_done("Done downloading and reading data")
9393
usethis::ui_info("Transforming data")
9494
rslt <- dplyr::group_by(rslt, dataset_iri) %>%
9595
dplyr::mutate(keywords = stringr::str_c(keywords_all, collapse = "; ")) %>%
@@ -173,7 +173,7 @@ get_czso_table <- function(dataset_id, force_redownload = F, resource_num = 1) {
173173
dir.create(td, showWarnings = F, recursive = T)
174174
dfile <- paste0(td, "/ds_", dataset_id, ".", ext)
175175
if(file.exists(dfile) & !force_redownload) {
176-
message(stringr::str_glue("File already in {td}, not downloading. Set `force_redownload` to TRUE if needed."))
176+
usethis::ui_info("File already in {td}, not downloading. Set `force_redownload` to TRUE if needed.")
177177
} else {
178178
utils::download.file(url, dfile, headers = ua_header)
179179
}

0 commit comments

Comments
 (0)