[Genabel-commits] r1938 - pkg/DatABEL/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 30 17:47:56 CEST 2015
Author: lckarssen
Date: 2015-03-30 17:47:56 +0200 (Mon, 30 Mar 2015)
New Revision: 1938
Modified:
pkg/DatABEL/R/zzz.R
Log:
DatABEL: Removed all internet accesses from the .onAttach() function as requested by Prof. Ripley.
Modified: pkg/DatABEL/R/zzz.R
===================================================================
--- pkg/DatABEL/R/zzz.R 2015-03-30 15:37:47 UTC (rev 1937)
+++ pkg/DatABEL/R/zzz.R 2015-03-30 15:47:56 UTC (rev 1938)
@@ -2,51 +2,6 @@
pkgVersion <- "0.9-6"
welcomeMessage <- paste0(pkg, " v.", pkgVersion," loaded\n")
- ## check for news
- address <- c(
- "http://genabel.r-forge.r-project.org/version_and_news.html",
- "http://www.genabel.org/sites/default/files/version_and_news.html"
- )
- svtmo <- options("timeout")
- options("timeout"=2)
- tryRes1 <- 0; class(tryRes1) <- "try-error"
- curaddr <- 1
- while (class(tryRes1) == "try-error" && curaddr <= length(address) ) {
- suppressWarnings(
- tryRes0 <- try(conn <- url(address[curaddr]), silent=TRUE)
- )
- suppressWarnings(
- tryRes1 <- try(fulltext <- readLines(conn), silent=TRUE)
- )
- close(conn)
- curaddr <- curaddr + 1
- }
- if (class(tryRes1) != "try-error") {
- if (length(fulltext)>0)
- {
- ## message to all users
- strnews <- grep("<messagetoall>", tolower(fulltext))
- endnews <- grep("</messagetoall>", tolower(fulltext))
- if (length(strnews) > 0 && length(endnews) > 0)
- if ((endnews-1) >= (strnews+1)) {
- welcomeMessage <- paste(welcomeMessage,
- fulltext[(strnews+1):(endnews-1)],
- sep="\n")
- }
- ## check for specific package news
- strnews <- grep(paste("<", pkg,"news>", sep=""), tolower(fulltext))
- endnews <- grep(paste("</", pkg,"news>", sep=""), tolower(fulltext))
- if (length(strnews)>0 && length(endnews)>0)
- if ((endnews-1) >= (strnews+1)) {
- welcomeMessage <- paste(welcomeMessage,
- fulltext[(strnews+1):(endnews-1)],
- sep="\n")
- }
- }
- ##rm(a,fulltext,ver)
- }
- options("timeout"=svtmo)
-
.Call("checkNumBits");
packageStartupMessage(welcomeMessage)
}
More information about the Genabel-commits
mailing list