Skip to content

Commit

Permalink
Merge pull request #11 from ecohealthalliance/hotfix/sanitise
Browse files Browse the repository at this point in the history
Hotfix/sanitise
  • Loading branch information
deanmarchiori authored Apr 16, 2024
2 parents e12f39d + 760ce51 commit 82bd908
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 86 deletions.
2 changes: 1 addition & 1 deletion R/create_translation_log.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' \dontrun{
#' create_translation_log(response_data = semi_clean_data,
#' form_schema = odk_schema_data,
#' url = "https://odk.eha.io/#/projects/5/forms/RVF2_animal_owner/submissions"))
#' url = "https://odk.xyz.io/#/projects/project-name/submissions"))
#' }
#'
create_translation_log <-
Expand Down
6 changes: 2 additions & 4 deletions R/download_dropbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#' @seealso [rdrop2::drop_download()]
#' @examples
#' \dontrun{
#' download_dropbox(dropbox_path = "DTRA_RVF2/RVF Mosquito Datasets",
#' dropbox_filename = "Mosquito dataset as at 01-02-2024.xlsx",
#' download_dropbox(dropbox_path = "XYZ/Project-Datasets",
#' dropbox_filename = "Project dataset as at 01-02-2024.xlsx",
#' download_path = here::here("data"),
#' overwrite = TRUE)
#' }
Expand All @@ -23,8 +23,6 @@ download_dropbox <-
dropbox_filename,
download_path,
...) {
# locate and update token
refresh_db_token()

# check if exists
if (!rdrop2::drop_exists(paste(dropbox_path, dropbox_filename, sep = "/"))) {
Expand Down
7 changes: 4 additions & 3 deletions R/download_googledrive_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
#' @examples
#' \dontrun{
#' download_googledrive_files(
#' drive_path = "https://drive.google.com/drive/u/0/folders/144cVfY4l087qeBz0Kkd31KAb5os9tw28",
#' key_path = here::here("./key.json"),
#' drive_path = "https://drive.google.com/drive/u/0/folders/asdjfnasiffas8ef7y7y89rf",
#' search_pattern = "*.xlsx",
#' out_path = here::here("data/kzn_animal_ship/")
#' out_path = here::here("data/project_data/")
#' )
#' }
#'
download_googledrive_files <-
function(key_path = here::here("./auth/rvf2-workflow-automation-2877f538ddb9.json"),
function(key_path,
drive_path,
search_pattern,
MIME_type = NULL,
Expand Down
23 changes: 0 additions & 23 deletions R/dropbox_refresh.R

This file was deleted.

7 changes: 2 additions & 5 deletions R/dropbox_upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
#' \dontrun{
#' dropbox_upload(
#' kzn_animal_ship_semiclean,
#' file_path = here::here("outputs/kzn_animal_ship_semiclean.csv"),
#' dropbox_path = "DTRA_RVF2/Data/rvf2_github_data/semi_clean_data"
#' file_path = here::here("outputs/data.csv"),
#' dropbox_path = "XYZ/Data/semi_clean_data"
#' )
#' }
#'
dropbox_upload <- function(log, file_path, dropbox_path) {
log_export <- readr::write_csv(log, file_path)

# upload token
refresh_db_token()

# upload
rdrop2::drop_upload(file_path, dropbox_path)

Expand Down
5 changes: 2 additions & 3 deletions R/get_dropbox_val_logs.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
#' @export
#' @examples
#' \dontrun{
#' get_dropbox_val_logs(file_name = "log_levellogger.csv", folder = NULL)
#' get_dropbox_val_logs(file_name = "log.csv", folder = NULL)
#' }
#'
get_dropbox_val_logs <-
function(file_name, folder, path_name = "DTRA_RVF2/Data/rvf2_github_data/validation_logs") {
refresh_db_token()
function(file_name, folder, path_name) {

# path handling when log isnt in a dedicated subfolder on drop box
if (is.null(folder)) {
Expand Down
2 changes: 1 addition & 1 deletion R/get_odk_form_schema.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @seealso [ruODK::form_schema_ext()]
#' @examples
#' \dontrun{
#' get_odk_form_schema(url ="https://odk.eha.io/v1/projects/5/forms/RVF2_animal_owner.svc",
#' get_odk_form_schema(url ="https://odk.xyz.io/v1/projects/5/forms/survey.svc",
#' un = Sys.getenv("ODK_USERNAME"),
#' pw = Sys.getenv("ODK_PASSWORD"),
#' odkc_version = Sys.getenv("ODKC_VERSION"))
Expand Down
2 changes: 1 addition & 1 deletion R/get_odk_responses.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @seealso [ruODK::form_schema_ext()]
#' @examples
#' \dontrun{
#' get_odk_responses(url ="https://odk.eha.io/v1/projects/5/forms/RVF2_animal_owner.svc",
#' get_odk_responses(url ="https://odk.xyz.io/v1/projects/5/forms/survey.svc",
#' un = Sys.getenv("ODK_USERNAME"),
#' pw = Sys.getenv("ODK_PASSWORD"),
#' odkc_version = Sys.getenv("ODKC_VERSION"))
Expand Down
2 changes: 1 addition & 1 deletion R/read_googlesheets.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' }
#'
read_googlesheets <-
function(key_path = here::here("./auth/rvf2-workflow-automation-2877f538ddb9.json"),
function(key_path,
sheet = "all",
ss,
...) {
Expand Down
2 changes: 1 addition & 1 deletion man/create_translation_log.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/download_dropbox.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/download_googledrive_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dropbox_upload.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions man/get_dropbox_val_logs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_odk_form_schema.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_odk_responses.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions man/read_googlesheets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions man/refresh_db_token.Rd

This file was deleted.

0 comments on commit 82bd908

Please sign in to comment.