File: main.r

package info (click to toggle)
r-cran-irkernel 1.3.2%2Bgit20240429.124f234-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 400 kB
  • sloc: python: 242; javascript: 69; makefile: 26; sh: 15
file content (16 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#' Initialise and run the kernel
#'
#' @param connection_file  The path to the Jupyter connection file, written by the frontend
#' 
#' @export 
main <- function(connection_file = '') {
    if (connection_file == '') {
        # On Windows, passing the connection file in as a string literal fails,
        # because the \U in C:\Users looks like a unicode escape. So, we have to
        # pass it as a separate command line argument.
        connection_file <- commandArgs(TRUE)[[1]]
    }
    log_debug('Starting the R kernel...')
    kernel <- Kernel$new(connection_file = connection_file)
    kernel$run()
}