Commits (2)
......@@ -38,6 +38,14 @@ RDS_HEADERS = {
DUMP_RDB = rb"""
hideOutput = lazyLoad(commandArgs(TRUE));
safeDeparse <- function(obj) {
tryCatch({
deparse(obj)
}, error = function (e) {
(deparse(e))
});
}
for (x in ls(all.names = TRUE, sorted = TRUE)) {
obj = get(x)
......@@ -47,11 +55,11 @@ for (x in ls(all.names = TRUE, sorted = TRUE)) {
cat("\n{\n", sep = "");
for (y in ls(obj, all.names = TRUE, sorted = TRUE)) {
obj2 = get(y, envir = obj);
cat(sprintf(" \"%s\" = \"%s\"\n", y, deparse(obj2)), sep = "");
cat(sprintf(" \"%s\" = \"%s\"\n", y, safeDeparse(obj2)), sep = "");
}
cat("}\n");
} else {
for (line in deparse(obj))
for (line in safeDeparse(obj))
cat(line, "\n", sep = "");
}
cat("\n");
......@@ -86,17 +94,17 @@ def get_module_path_for_rdb(rdb):
# Calculate location of parallel .rdx file
rdx_name = "{}.rdx".format(os.path.splitext(rdb.name)[0])
try:
# Query the container for the full path (eg. `./path/to/foo.rdx`)...
rdx = rdb.container.get_member(rdx_name)
except KeyError:
try:
# ... falling back to looking in the same directory for when
# comparing two .rdb files directly
rdx = rdb.container.get_member(os.path.basename(rdx_name))
except KeyError:
# Corresponding .rdx does not exist
return
# Query the container for the full path (eg. `./path/to/foo.rdx`)...
rdx = rdb.container.get_member(rdx_name)
if not os.path.exists(rdx.path):
# ... falling back to looking in the same directory for when
# comparing two .rdb files directly
rdx = rdb.container.get_member(os.path.basename(rdx_name))
if not os.path.exists(rdx.path):
# Corresponding .rdx does not exist
return
temp_dir = get_temporary_directory().name
prefix = os.path.join(temp_dir, "temp")
......