[Sciviews-commits] r461 - in pkg: SciViews SciViews/R SciViews/man svHttp svHttp/inst svHttp/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Apr 2 11:05:06 CEST 2012
Author: phgrosjean
Date: 2012-04-02 11:05:06 +0200 (Mon, 02 Apr 2012)
New Revision: 461
Added:
pkg/svHttp/inst/NEWS.Rd
Modified:
pkg/SciViews/DESCRIPTION
pkg/SciViews/NAMESPACE
pkg/SciViews/R/character.R
pkg/SciViews/R/file.R
pkg/SciViews/R/misc.R
pkg/SciViews/man/SciViews-package.Rd
pkg/svHttp/DESCRIPTION
pkg/svHttp/NEWS
pkg/svHttp/man/svHttp-package.Rd
Log:
Reworked NEWS format for svHttp package + changes in SciViews package
Modified: pkg/SciViews/DESCRIPTION
===================================================================
--- pkg/SciViews/DESCRIPTION 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/DESCRIPTION 2012-04-02 09:05:06 UTC (rev 461)
@@ -1,7 +1,7 @@
Package: SciViews
Type: Package
Version: 0.9-7
-Date: 2012-03-31
+Date: 2012-04-01
Title: SciViews GUI API - Main package
Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"),
email = "phgrosjean at sciviews.org"))
Modified: pkg/SciViews/NAMESPACE
===================================================================
--- pkg/SciViews/NAMESPACE 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/NAMESPACE 2012-04-02 09:05:06 UTC (rev 461)
@@ -79,7 +79,7 @@
ifElse,
newEnv,
names,
- l,
+ n,
nc,
nr,
Rows,
Modified: pkg/SciViews/R/character.R
===================================================================
--- pkg/SciViews/R/character.R 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/R/character.R 2012-04-02 09:05:06 UTC (rev 461)
@@ -9,15 +9,15 @@
#nzChar <- nzchar
## Format character strings
-cEscape <- encodeString
-cWrap <- strwrap
+cEscape <- get("encodeString", envir = baseenv())
+cWrap <- get("strwrap", envir = baseenv())
# Add cPad => pad a string left/right or both or Pad/PadL/PadR?
#+sprintf/gettextf?
## String find/replace using fixed pattern (char*) or regular expressions (rx*)
## TODO: a rx object which prints an example of its work! => fine-tune it
## to make it easy to experiment with the rx object
-rx <- glob2rx
+rx <- glob2rx # This is in utils package
cSearch <- function (x, pattern, ignore.case = FALSE,
type = c("logical", "position", "value"), ...) # ... for useBytes
@@ -103,18 +103,22 @@
rxSplit <- function (x, pattern, ...) # for perl & useBytes
return(strsplit(x, split = pattern, fixed = FALSE, ...))
-cSub <- substr
-`cSub<-` <- `substr<-`
-cTrunc <- strtrim ## This indeed truncs strings!!!
+cSub <- get("substr", envir = baseenv())
+`cSub<-` <- get("substr<-", envir = baseenv())
+cTrunc <- get("strtrim", envir = baseenv()) ## This indeed truncs strings!!!
## paste() is rather long name, in comparison with, e.g., c().
## Also the default argument of sep = " " is irritating and is not consistent
## with stop() or warning() for instance, that use sep = "".
## Thus, we define:
-p <- function (..., sep = "", collapse = NULL)
- paste(..., sep = sel, collapse = collapse)
+if (exists("paste0", envir = baseenv())) { # Starting from R 2.15.0
+ p <- get("paste0", envir = baseenv())
+} else {
+ p <- function (..., sep = "", collapse = NULL)
+ paste(..., sep = sep, collapse = collapse)
+}
-p_ <- paste
+p_ <- get("paste", envir = baseenv())
## The same is true for cat() with sep = " "... and the default behaviour of
## not ending with line feed is more confusing that useful => change this
@@ -164,24 +168,24 @@
## Change case and translate
-cTrans <- chartr
-cFold <- casefold
-cLower <- tolower
-cUpper <- toupper
+cTrans <- get("chartr", envir = baseenv())
+cFold <- get("casefold", envir = baseenv())
+cLower <- get("tolower", envir = baseenv())
+cUpper <- get("toupper", envir = baseenv())
## Character encoding
-encodingToNative <- enc2native
-encodingToUTF8 <- enc2utf8
-encoding <- Encoding
-`encoding<-` <- `Encoding<-`
+encodingToNative <- get("enc2native", envir = baseenv())
+encodingToUTF8 <- get("enc2utf8", envir = baseenv())
+encoding <- get("Encoding", envir = baseenv())
+`encoding<-` <- get("Encoding<-", envir = baseenv())
## Measure size of a string (package graphics)
-cHeight <- strheight
-cWidth <- strwidth
+cHeight <- strheight # From package graphics
+cWidth <- strwidth # From package graphics
## Match and expand character strings to a list of items
-cExpand <- char.expand
-cMatch <- charmatch
+cExpand <- get("char.expand", envir = baseenv())
+cMatch <- get("charmatch", envir = baseenv())
# What to do with pmatch()???
## Conversion to character string... no change required
@@ -190,7 +194,7 @@
# To avoid using strtoi(), we prefer as.integerBase (because as.integer cannot
# be converted into a generic function, because it is a primitive!)
#charToInt <- strtoi # Allows to choose the base used for char representation
-as.integerBase <- strtoi
+as.integerBase <- get("strtoi", envir = baseenv())
## Define a function that takes: singular/plural msg and a vector of strings
## and construct a single string with:
Modified: pkg/SciViews/R/file.R
===================================================================
--- pkg/SciViews/R/file.R 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/R/file.R 2012-04-02 09:05:06 UTC (rev 461)
@@ -105,28 +105,28 @@
## Various file manipulation functions that do not return a path object
## (just homogenize the name...)
-dirCreate <- dir.create
-fileAccess <- file.access
-fileAppend <- file.append
-fileRename <- file.rename
-fileCopy <- file.copy
-fileCreate <- file.create
-fileExists <- file.exists
-fileInfo <- file.info
-fileChmod <- Sys.chmod
-fileRemove <- file.remove
+dirCreate <- get("dir.create", envir = baseenv())
+fileAccess <- get("file.access", envir = baseenv())
+fileAppend <- get("file.append", envir = baseenv())
+fileRename <- get("file.rename", envir = baseenv())
+fileCopy <- get("file.copy", envir = baseenv())
+fileCreate <- get("file.create", envir = baseenv())
+fileExists <- get("file.exists", envir = baseenv())
+fileInfo <- get("file.info", envir = baseenv())
+fileChmod <- get("Sys.chmod", envir = baseenv())
+fileRemove <- get("file.remove", envir = baseenv())
## This is "stronger" than fileRemove()!
fileDelete <- function (path, recursive = FALSE, force = FALSE)
return(unlink(x = path, recursive = recursive, force = force))
-fileLink <- file.link
-fileSymlink <- file.symlink
+fileLink <- get("file.link", envir = baseenv())
+fileSymlink <- get("file.symlink", envir = baseenv())
fileReadLink <- function (path)
return(structure(Sys.readlink(paths = path),
class = c("path", "character")))
## This is linked to some GUI element, possibly... anyway...
-fileShow <- file.show
+fileShow <- get("file.show", envir = baseenv())
## TODO: this file choose... but this is really for svDialogs (dlgOpen(), dlgSave())
#fileChoose <- file.choose
Modified: pkg/SciViews/R/misc.R
===================================================================
--- pkg/SciViews/R/misc.R 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/R/misc.R 2012-04-02 09:05:06 UTC (rev 461)
@@ -18,7 +18,7 @@
## or in a function
# return(ifValid(obj, "class"))
-ifElse <- ifelse
+ifElse <- get("ifelse", envir = baseenv())
`%else%` <- function (test, expr) if (test) return(invisible()) else expr
## Useful to write shorter code in something like:
@@ -30,7 +30,8 @@
# res <- try(...., silent = TRUE)
# if (inherits(res, "try-error")) stop(msg)
-enum <- seq_along
+enum <- function (x)
+ return(seq_along(x))
## Defines only increasing integer sequences
`%:%` <- function (lower, upper)
@@ -57,7 +58,7 @@
## Usually, to create an object, we use its name, but
## environment() means something else here!
## So, OK, we'll stick with
-newEnv <- new.env
+newEnv <- get("new.env", envir = baseenv())
## for the moment...
## Now, we want to be able to use names() on it too!
@@ -68,13 +69,13 @@
## Do we implement `names<-` for environments???
## Simpler names for often used functions
-l <- length
-nc <- NCOL
-nr <- NROW
+n <- get("length", envir = baseenv())
+nc <- get("NCOL", envir = baseenv())
+nr <- get("NROW", envir = baseenv())
## Constants (must start with an uppercase letter)
## => redefine Pi instead of pi
-Pi <- pi
+Pi <- get("pi", envir = baseenv())
## Useful for apply() familly:
Rows <- 1
Cols <- 2
Modified: pkg/SciViews/man/SciViews-package.Rd
===================================================================
--- pkg/SciViews/man/SciViews-package.Rd 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/SciViews/man/SciViews-package.Rd 2012-04-02 09:05:06 UTC (rev 461)
@@ -14,7 +14,7 @@
Package: \tab SciViews\cr
Type: \tab Package\cr
Version: \tab 0.9-7\cr
- Date: \tab 2012-03-31\cr
+ Date: \tab 2012-04-01\cr
License: \tab GPL (>= 2)\cr
LazyLoad: \tab yes\cr
}
Modified: pkg/svHttp/DESCRIPTION
===================================================================
--- pkg/svHttp/DESCRIPTION 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/svHttp/DESCRIPTION 2012-04-02 09:05:06 UTC (rev 461)
@@ -1,7 +1,7 @@
Package: svHttp
Type: Package
-Version: 0.9-53
-Date: 2012-03-31
+Version: 0.9-54
+Date: 2012-04-02
Title: SciViews GUI API - R HTTP server
Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"),
email = "phgrosjean at sciviews.org"))
Modified: pkg/svHttp/NEWS
===================================================================
--- pkg/svHttp/NEWS 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/svHttp/NEWS 2012-04-02 09:05:06 UTC (rev 461)
@@ -1,5 +1,9 @@
= svHttp News
+== Changes in svHttp 0.9-54
+
+* NEWS file reworked to use the new Rd format.
+
== Changes in svHttp 0.9-53
* If the Http server is not started, .onUnload() failed in
Added: pkg/svHttp/inst/NEWS.Rd
===================================================================
--- pkg/svHttp/inst/NEWS.Rd (rev 0)
+++ pkg/svHttp/inst/NEWS.Rd 2012-04-02 09:05:06 UTC (rev 461)
@@ -0,0 +1,37 @@
+\name{NEWS}
+\title{NEWS file for the svHttp package}
+
+\section{Changes in version 0.9-54}{
+ \itemize{
+ \item{ NEWS file reworked to use the new Rd format. }
+ }
+}
+
+\section{Changes in version 0.9-53}{
+ \itemize{
+ \item{ If the Http server is not started, \code{.onUnload()} failed in
+ \code{tools::startDynamicHelp(FALSE)}. Fixed. }
+ }
+}
+
+\section{Changes in version 0.9-52}{
+ \itemize{
+ \item{ Functions to manage the SciViews HTTP server have been moved from
+ \pkg{svGUI} 0.9-51 to here. }
+
+ \item{ The SciViews HTTP server was broken under R 2.13.0 because of wrong
+ arguments in the function called by HTTP clients. Fixed now. }
+
+ \item{ The SciViews HTTP server cannot accept very long instructions (they
+ are truncated). In such a case, write the instructions in a file instead
+ and pass /code{SOURCE=<filepath>} as message. Note that the temporary file
+ is deleted by the HTTP server after use. The maximum length of the request
+ is perhaps different from one to the other system (I had little problems
+ on Mac OS X). It is probably safe to use a file if argument is more than
+ 100 characters long. Note that encoding for this temporary file is assumed
+ to be UTF-8! }
+
+ \item{ For additional changes in the Http server in \pkg{svGUI} up to
+ version 0.9-51, see its corresponding \preformatted{NEWS} file. }
+ }
+}
Modified: pkg/svHttp/man/svHttp-package.Rd
===================================================================
--- pkg/svHttp/man/svHttp-package.Rd 2012-03-31 11:01:33 UTC (rev 460)
+++ pkg/svHttp/man/svHttp-package.Rd 2012-04-02 09:05:06 UTC (rev 461)
@@ -14,8 +14,8 @@
\tabular{ll}{
Package: \tab svHttp\cr
Type: \tab Package\cr
- Version: \tab 0.9-53\cr
- Date: \tab 2012-03-31\cr
+ Version: \tab 0.9-54\cr
+ Date: \tab 2012-04-02\cr
License: \tab GPL 2 or above, at your convenience\cr
}
% TODO: add description of main functions here. Also add examples
More information about the Sciviews-commits
mailing list