File: print.R

package info (click to toggle)
r-cran-processx 3.8.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,068 kB
  • sloc: ansic: 6,485; sh: 13; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (4)
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

process_format <- function(self, private) {

  state <- if (self$is_alive()) {
    pid <- self$get_pid()
    paste0("running, pid ", paste(pid, collapse = ", "), ".")
  } else {
    "finished."
  }

  paste0(
    "PROCESS ",
    "'", private$get_short_name(), "', ",
    state,
    "\n"
  )
}

process_print <- function(self, private) {
  cat(process_format(self, private))
  invisible(self)
}

process_get_short_name <- function(self, private) {
  basename(private$command)
}