Browse Source

plist reading ability

master
boB Rudis 6 years ago
parent
commit
e3f4d7ec4c
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 1
      NAMESPACE
  2. 14
      R/read-plist.R
  3. 2
      R/system-profile.R
  4. 2
      R/zzz.R
  5. 18
      man/read_plist.Rd
  6. 2
      man/system_profile.Rd

1
NAMESPACE

@ -4,6 +4,7 @@ export(airport_scan)
export(find_dsstore)
export(kernel_state)
export(read_dsstore)
export(read_plist)
export(software_update_history)
export(sw_vers)
export(system_profile)

14
R/read-plist.R

@ -0,0 +1,14 @@
#' Read a macOS property list file
#'
#' @md
#' @param path path to `plist` file
#' @return `list` with property list contents or `NULL` if there was an error
#' reading the property list.
#' @export
read_plist <- function(path) {
.read_plist <- purrr::safely(plistlib$readPlist)
path <- path.expand(path[1])
if (!file.exists(path)) stop("File not found.", call.=FALSE)
res <- .read_plist(path)
res$result
}

2
R/system-profile.R

@ -1,6 +1,6 @@
#' Report system hardware and software configuration
#'
#' TODO Do more than just return an xml document once a generica plist reader
#' TODO Do more than just return an xml document once a generic plist reader
#' is created.
#'
#' @md

2
R/zzz.R

@ -15,6 +15,7 @@ if (utils::compareVersion(x$version, "3.5") < 0) {
dsstore <- NULL
os <- NULL
plistlib <- NULL
.onLoad <- function(libname, pkgname) {
dsstore <<- reticulate::import_from_path(
@ -22,4 +23,5 @@ os <- NULL
path = system.file("modules", package = "mactheknife")
)
os <<- reticulate::import("os", delay_load = TRUE)
plistlib <<- reticulate::import("plistlib", delay_load = TRUE)
}

18
man/read_plist.Rd

@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read-plist.R
\name{read_plist}
\alias{read_plist}
\title{Read a macOS property list file}
\usage{
read_plist(path)
}
\arguments{
\item{path}{path to \code{plist} file}
}
\value{
\code{list} with property list contents or \code{NULL} if there was an error
reading the property list.
}
\description{
Read a macOS property list file
}

2
man/system_profile.Rd

@ -15,7 +15,7 @@ system_profile(detail_level = c("mini", "basic", "full"))
}}
}
\description{
TODO Do more than just return an xml document once a generica plist reader
TODO Do more than just return an xml document once a generic plist reader
is created.
}
\note{

Loading…
Cancel
Save