You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
672B

  1. py_c <- reticulate::py_config()
  2. .dns <- NULL
  3. .onLoad <- function(libname, pkgname) {
  4. if (utils::compareVersion(py_c$version, "3.5") < 0) {
  5. stop(
  6. paste0(
  7. c(
  8. "Python 3.5+ is required. If this is installed please set RETICULATE_PYTHON ",
  9. "to the path to the Python 3 binary on your system and try re-installing/",
  10. "re-loading the package."
  11. ),
  12. collapse = ""
  13. )
  14. )
  15. return()
  16. }
  17. if (!reticulate::py_module_available("dnslib")) {
  18. packageStartupMessage(
  19. "The 'dnslib' Python module must be installed."
  20. )
  21. } else {
  22. .dns <<- reticulate::import("dnslib", delay_load = TRUE)
  23. }
  24. }