Browse code

Consistency and clean up

lshep authored on 13/05/2025 12:26:37
Showing 5 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: BiocFileCache
2 2
 Title: Manage Files Across Sessions
3
-Version: 2.99.2
3
+Version: 2.99.3
4 4
 Authors@R: c(person("Lori", "Shepherd",
5 5
 email = "lori.shepherd@roswellpark.org",
6 6
 role = c("aut", "cre")),
... ...
@@ -323,7 +323,7 @@ setMethod("bfcadd", "missing",
323 323
 )
324 324
 {
325 325
 bfcadd(x=BiocFileCache(), rname=rname, fpath=fpath, rtype=rtype,
326
- action=action, proxy=proxy, download=download, config=config,
326
+ action=action, proxy=proxy, download=download, progress=progress, config=config,
327 327
 ext=ext, fname=fname,...)
328 328
 })
329 329
 
... ...
@@ -423,7 +423,7 @@ setMethod("bfcadd", "BiocFileCache",
423 423
 }
424 424
 )
425 425
 } else if (download) { # rtype == "web"
426
- .util_download(x, rid[i], proxy, config, progress, "bfcadd()", ...)
426
+ .util_download(x, rid[i], proxy, progress, config, "bfcadd()", ...)
427 427
 }
428 428
 }
429 429
 
... ...
@@ -626,7 +626,7 @@ setMethod("bfcupdate", "missing",
626 626
 #' @exportMethod bfcupdate
627 627
 setMethod("bfcupdate", "BiocFileCache",
628 628
 function(x, rids, ..., rname=NULL, rpath=NULL, fpath=NULL,
629
- proxy="", config=list(), progress=TRUE, ask=TRUE)
629
+ proxy="", progress=TRUE, config=list(), ask=TRUE)
630 630
 {
631 631
 stopifnot(!missing(rids), all(rids %in% bfcrid(x)))
632 632
 stopifnot(
... ...
@@ -691,7 +691,7 @@ setMethod("bfcupdate", "BiocFileCache",
691 691
 }
692 692
 if (doit) {
693 693
 .util_download_and_rename(
694
- x, rids[i], proxy, config, progress, "bfcupdate()", fpath[i], ...
694
+ x, rids[i], proxy, progress, config, "bfcupdate()", fpath[i], ...
695 695
 )
696 696
 .sql_set_fpath(x, rids[i], fpath[i])
697 697
 }
... ...
@@ -1057,7 +1057,7 @@ setMethod("bfcneedsupdate", "BiocFileCacheBase",
1057 1057
 
1058 1058
 #' @export
1059 1059
 setGeneric("bfcdownload",
1060
- function(x, rid, proxy="", config=list(), ask=TRUE, FUN, ...)
1060
+ function(x, rid, proxy="", progress=TRUE, config=list(), ask=TRUE, FUN, ...)
1061 1061
 standardGeneric("bfcdownload"),
1062 1062
 signature = "x"
1063 1063
 )
... ...
@@ -1069,7 +1069,7 @@ setGeneric("bfcdownload",
1069 1069
 setMethod("bfcdownload", "missing",
1070 1070
 function(x, rid, proxy="", config=list(), ask=TRUE, FUN, ...)
1071 1071
 {
1072
- bfcdownload(x=BiocFileCache(), rid=rid, proxy=proxy, config=config, ask=ask,
1072
+ bfcdownload(x=BiocFileCache(), rid=rid, proxy=proxy, progress=TRUE, config=config, ask=ask,
1073 1073
 FUN=FUN, ...)
1074 1074
 })
1075 1075
 
... ...
@@ -1088,7 +1088,7 @@ setMethod("bfcdownload", "missing",
1088 1088
 #' @aliases bfcdownload
1089 1089
 #' @exportMethod bfcdownload
1090 1090
 setMethod("bfcdownload", "BiocFileCache",
1091
- function(x, rid, proxy="", config=list(), progress=TRUE, ask=TRUE, FUN, ...)
1091
+ function(x, rid, proxy="", progress=TRUE, config=list(), ask=TRUE, FUN, ...)
1092 1092
 {
1093 1093
 stopifnot(
1094 1094
 !missing(rid), length(rid) > 0L,
... ...
@@ -1106,7 +1106,7 @@ setMethod("bfcdownload", "BiocFileCache",
1106 1106
 doit <- TRUE
1107 1107
 }
1108 1108
 if (doit)
1109
- .util_download_and_rename(x, rid, proxy, config, progress, "bfcdownload()",
1109
+ .util_download_and_rename(x, rid, proxy, progress, config, "bfcdownload()",
1110 1110
 FUN=FUN, ...)
1111 1111
 
1112 1112
 bfcrpath(x, rids=rid)
... ...
@@ -121,7 +121,7 @@
121 121
 
122 122
 #' @importFrom utils packageVersion
123 123
 .httr_download <-
124
- function(websource, localfile, proxy, config, progress, ...)
124
+ function(websource, localfile, proxy, progress, config, ...)
125 125
 {
126 126
 
127 127
 ## retrieve file from hub to cache
... ...
@@ -140,7 +140,7 @@
140 140
 if(missing(progress)){
141 141
 progress=TRUE
142 142
 }
143
- 
143
+
144 144
 if (!all(file.exists(dirname(localfile)))) dir.create(dirname(localfile), recursive=TRUE)
145 145
 
146 146
 # set up request using httr2
... ...
@@ -120,13 +120,13 @@
120 120
 }
121 121
 
122 122
 .util_download <-
123
- function(bfc, rid, proxy, config, progress, call, ...)
123
+ function(bfc, rid, proxy, progress, config, call, ...)
124 124
 {
125 125
 rpath <- .sql_get_rpath(bfc, rid)
126 126
 fpath <- .sql_get_fpath(bfc, rid)
127 127
 status <- Map(
128 128
 .httr_download, fpath, rpath,
129
- MoreArgs = list(proxy = proxy, config = config, progress = progress, ...)
129
+ MoreArgs = list(proxy = proxy, progress = progress, config = config, ...)
130 130
 )
131 131
 ok <- vapply(status, isTRUE, logical(1))
132 132
 if (!all(ok)) {
... ...
@@ -146,7 +146,7 @@
146 146
 }
147 147
 
148 148
 .util_download_and_rename <-
149
- function(bfc, rid, proxy, config, progress, call, fpath = .sql_get_fpath(bfc, rid),
149
+ function(bfc, rid, proxy, progress, config, call, fpath = .sql_get_fpath(bfc, rid),
150 150
 FUN, ...)
151 151
 {
152 152
 rpath <- .sql_get_rpath(bfc, rid)
... ...
@@ -164,7 +164,7 @@
164 164
 status <- Map(function(rpath, fpath) {
165 165
 temppath <- tempfile(tmpdir=bfccache(bfc))
166 166
 
167
- status <- .httr_download(fpath, temppath, proxy, config, progress, ...)
167
+ status <- .httr_download(fpath, temppath, proxy, progress, config, ...)
168 168
 if (!status)
169 169
 return("download failed")
170 170
 
... ...
@@ -181,8 +181,8 @@ bfcrid(x)
181 181
 rpath = NULL,
182 182
 fpath = NULL,
183 183
 proxy = "",
184
- config = list(),
185 184
 progress = TRUE,
185
+ config = list(),
186 186
 ask = TRUE
187 187
 )
188 188
 
... ...
@@ -220,14 +220,23 @@ bfcmeta(x, name, ...) <- value
220 220
 
221 221
 \S4method{bfcneedsupdate}{BiocFileCacheBase}(x, rids, ..., config = list())
222 222
 
223
-\S4method{bfcdownload}{missing}(x, rid, proxy = "", config = list(), ask = TRUE, FUN, ...)
223
+\S4method{bfcdownload}{missing}(
224
+ x,
225
+ rid,
226
+ proxy = "",
227
+ progress = TRUE,
228
+ config = list(),
229
+ ask = TRUE,
230
+ FUN,
231
+ ...
232
+)
224 233
 
225 234
 \S4method{bfcdownload}{BiocFileCache}(
226 235
 x,
227 236
 rid,
228 237
 proxy = "",
229
- config = list(),
230 238
 progress = TRUE,
239
+ config = list(),
231 240
 ask = TRUE,
232 241
 FUN,
233 242
 ...