[Sciviews-commits] r164 - in pkg/svTools: R data man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 6 14:04:54 CEST 2009
Author: romain
Date: 2009-08-06 14:04:51 +0200 (Thu, 06 Aug 2009)
New Revision: 164
Added:
pkg/svTools/man/checkUsageFile.Rd
pkg/svTools/man/completeDescription.Rd
Modified:
pkg/svTools/R/complete_description.R
pkg/svTools/data/descriptionFields.rda
Log:
added some documentation
Modified: pkg/svTools/R/complete_description.R
===================================================================
--- pkg/svTools/R/complete_description.R 2009-08-06 11:37:56 UTC (rev 163)
+++ pkg/svTools/R/complete_description.R 2009-08-06 12:04:51 UTC (rev 164)
@@ -44,18 +44,18 @@
c( "AGPL-3", 'The "GNU Affero General Public License" version 3 ' ),
c( "Artistic-1.0", 'The "Artistic License" version 1.0 ' ),
c( "Artistic-2.0", 'The "Artistic License" version 2.0 ' ) )
- return( list( ok = 1, data = possibleLicenses, token = lastLine %-~% ".*: *", type = "other" ) )
+ return( list( ok = TRUE, data = possibleLicenses, token = lastLine %-~% ".*: *", type = "other" ) )
}
### propose today's date
if( field == "Date"){
data <- cbind( format( Sys.time( ) , "%Y-%m-%d" ), "Today" )
- return( list( ok = 1, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
+ return( list( ok = TRUE, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
}
if( field %in% c("LazyLoad", "LazyData", "ZipData") ){
data <- rbind( c("yes", ""), c("no", "" ) )
- return( list( ok = 1, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
+ return( list( ok = TRUE, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
}
if( field == "Encoding" ){
@@ -63,7 +63,7 @@
c("latin1" , "" ),
c("latin2" , "" ),
c("UTF-8" , "" ) )
- return( list( ok = 1, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
+ return( list( ok = TRUE, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
}
if( field == "Type" ){
@@ -71,21 +71,21 @@
c("Package" , "Usual package" ),
c("Translation" , "Translation package" ),
c("Frontend" , "Frontend package" ) )
- return( list( ok = 1, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
+ return( list( ok = TRUE, data = data, token = lastLine %-~% ".*: *" , type = "other" ) )
}
### give up
- return( list( ok = 0 ) )
+ return( list( ok = FALSE ) )
} else{
if( lastLine %~% "[^[:alpha:]]" ){
- return( list( ok = 0 ) )
+ return( list( ok = FALSE ) )
} else{
keep <- descriptionFields[,1] %~% lastLine | descriptionFields[,3] %~% lastLine
data <- as.matrix( descriptionFields[ keep, c(1, 3), drop = FALSE ] )
data[,1] <- paste( data[,1], ": ", sep = "")
- return( list( data = data, ok = 1, token = lastLine, type = "fields" ) )
+ return( list( data = data, ok = TRUE, token = lastLine, type = "fields" ) )
}
}
Modified: pkg/svTools/data/descriptionFields.rda
===================================================================
(Binary files differ)
Added: pkg/svTools/man/checkUsageFile.Rd
===================================================================
--- pkg/svTools/man/checkUsageFile.Rd (rev 0)
+++ pkg/svTools/man/checkUsageFile.Rd 2009-08-06 12:04:51 UTC (rev 164)
@@ -0,0 +1,28 @@
+\name{checkUsageFile}
+\Rdversion{1.1}
+\alias{checkUsageFile}
+\title{
+File based version of checkUsage
+}
+\description{
+Simple wrapper to the checkUsage function of the codetools
+package that calls checkUsage on all objects contained in a source file
+}
+\usage{
+checkUsageFile(file, encoding = "unknown")
+}
+\arguments{
+ \item{file}{file to check}
+ \item{encoding}{encoding to assume for the file}
+}
+\value{
+A data frame of errors/problems in the file is returned
+}
+\author{
+Romain Francois <francoisromain at free.fr>
+}
+\seealso{
+\code{\link[codetools]{checkUsage}}
+}
+\keyword{ manip }
+
Added: pkg/svTools/man/completeDescription.Rd
===================================================================
--- pkg/svTools/man/completeDescription.Rd (rev 0)
+++ pkg/svTools/man/completeDescription.Rd 2009-08-06 12:04:51 UTC (rev 164)
@@ -0,0 +1,36 @@
+\name{completeDescription}
+\Rdversion{1.1}
+\alias{completeDescription}
+\title{
+completion helper for DESCRIPTION files
+}
+\description{
+Attemps to find completions for a DESCRIPTION file
+}
+\usage{
+completeDescription(file, row, col, text = readLines(file),
+ author = getOption("svTools.description.author"))
+}
+\arguments{
+ \item{file}{DESCRIPTION file to complete}
+ \item{row}{line in the file where the cursor is}
+ \item{col}{column in the file where the cursor is}
+ \item{text}{text to complete}
+ \item{author}{How to complete Author fields. The default value
+ looks for the "svTools.description.author" option }
+}
+\value{
+ A list with the following items
+ \item{ok}{logical indicating if there actually are completions}
+ \item{data}{character matrix. The first column gives the completion, the second a description}
+ \item{token}{token that is being completed}
+ \item{type}{type of results, can be "package", "fields", "other" }
+}
+\references{
+Writing R extensions defines what should be in a DESCRIPTION file
+}
+\author{
+Romain Francois <francoisromain at free.fr>
+}
+\keyword{ manip }
+
More information about the Sciviews-commits
mailing list