File: zzz.R

package info (click to toggle)
r-cran-progressr 0.15.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,132 kB
  • sloc: sh: 13; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.onLoad <- function(libname, pkgname) {
  debug <- isTRUE(as.logical(Sys.getenv("R_PROGRESSR_DEBUG", "FALSE")))
  if (debug) options(progressr.debug = TRUE)
  debug <- getOption("progressr.debug", debug)

  ## Set package options based on environment variables
  update_package_options(debug = debug)

  ## Record the process ID (PID) when the package is loaded
  is_fork_child()
  
  ## R CMD check
  if (in_r_cmd_check()) {
    options(progressr.demo.delay = 0.0)
  }

  ## R CMD build
  register_vignette_engine_during_build_only(pkgname)

  ## Register a global progression handler on load?
  if (isTRUE(getOption("progressr.global.handler", FALSE))) {
    ## UPDATE It is not possible to register a global calling handler when
    ## there is already an active condition handler as it is here because
    ## loadNamespace()/library() uses tryCatch() internally.  If attempted,
    ## we'll get an error "should not be called with handlers on the stack".
    ## /HB 2020-11-19
#    register_global_progression_handler()
  }
}