R/lowlevel.R

Defines functions set_options get_python_script_name exec_python_script

# REMOVE!?
set_options <- function(imap, ...){
  cat("NOT implemented yet!")
}

get_python_script_name <- function(script_name){
  sprintf("python/%s", script_name) %>%
    system.file(package = "imapr")
}

exec_python_script <- function(script_name, argv){
  cmd <- get_python_cmd()
  system2(cmd, c(script_name, argv), stdout = TRUE) %>%
    jsonlite::fromJSON()
}
crazycapivara/imapr documentation built on May 14, 2019, 11:32 a.m.