Skip to content

Commit 345fcb2

Browse files
fix warnings and notes
1 parent c465c6c commit 345fcb2

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

R/notifier_handler.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ notifier_handler <- function(intrusiveness = getOption("progressr.intrusiveness.
1818
## Used for package testing purposes only when we want to perform
1919
## everything except the last part where the backend is called
2020
if (!is_fake("notifier_handler")) {
21-
if (!requireNamespace("notifier", quietly = TRUE)) {
21+
pkg <- "notifier"
22+
if (!requireNamespace(pkg, quietly = TRUE)) {
2223
stop("Package 'notifier' is not available. See ?progressr::notifier_handler() for installation instructions")
2324
}
24-
notifier_notify <- get("notify", mode = "function", envir = getNamespace("notifier"))
25+
notifier_notify <- get("notify", mode = "function", envir = getNamespace(pkg))
2526
} else {
2627
notifier_notify <- function(...) NULL
2728
}

incl/notifier_handler.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
if (requireNamespace("notifier", quietly = TRUE)) {
1+
pkg <- "notifier"
2+
if (requireNamespace(pkg, quietly = TRUE)) {
23
handlers("notifier")
34
with_progress({ y <- slow_sum(1:10) })
45
print(y)

incl/with_progress.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ if (requireNamespace("beepr", quietly = TRUE)) {
3838
})
3939
}
4040

41-
## Progress reported via customied utils::txtProgressBar, beepr::beep,
42-
## and notifier::notify, if available.
41+
## Progress reported via customized utils::txtProgressBar and beepr::beep,
42+
## if available.
4343
handlers(txtprogressbar_handler(style = 3L))
4444
if (requireNamespace("beepr", quietly = TRUE)) {
4545
handlers("beepr", append = TRUE)
4646
}
47-
if (requireNamespace("notifier", quietly = TRUE)) {
48-
handlers(notifier_handler(times = 3L, interval = 0.1), append = TRUE)
49-
}
5047

5148
with_progress({
5249
y <- slow_sum(1:30)

man/notifier_handler.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/with_progress.Rd

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)