[Rprotobuf-commits] r519 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Aug 31 02:22:12 CEST 2013


Author: edd
Date: 2013-08-31 02:22:11 +0200 (Sat, 31 Aug 2013)
New Revision: 519

Modified:
   pkg/ChangeLog
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/internals.R
   pkg/R/read.R
   pkg/R/serialize.R
   pkg/R/wrapper_ZeroCopyInputStream.R
   pkg/R/zzz.R
Log:
relatively minor changes to make R CMD check happy when using R-devel


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/ChangeLog	2013-08-31 00:22:11 UTC (rev 519)
@@ -1,3 +1,10 @@
+2013-08-30  Dirk Eddelbuettel  <edd at debian.org>
+
+	* NAMESPACE: Import 'file_path_as_absolute' from package tools, and
+	  the two functions needed from the RCurl package
+	* R/*R: Updated several files which no longer need 'tools:::' prefix 
+	* DESCRIPTION: Updated Depends: and Imports accordingly
+
 2013-08-29  Murray Stokely  <murray at FreeBSD.org>
 
 	* R/zzz.R (.onLoad): Rename option controlling int64 handling with

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/DESCRIPTION	2013-08-31 00:22:11 UTC (rev 519)
@@ -1,5 +1,5 @@
 Package: RProtoBuf
-Version: 0.3
+Version: 0.3.0.1
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Murray Stokely
 Maintainer: Dirk Eddelbuettel <edd at debian.org>
@@ -7,9 +7,10 @@
 Description: Protocol Buffers are a way of encoding structured data in an
  efficient yet extensible format. Google uses Protocol Buffers for almost all
  of its internal RPC protocols and file formats.  
-Depends: R (>= 2.11.0), RCurl, Rcpp (>= 0.9.6), methods
+Depends: R (>= 2.11.0), methods
 LinkingTo: Rcpp
 Suggests: RUnit, highlight
+Imports: utils, stats, tools, RCurl
 SystemRequirements: Protocol Buffer compiler (to create C++ header and source files
  from .proto descriptions) and library (version 2.2.0 or later)
 License: GPL-2

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/NAMESPACE	2013-08-31 00:22:11 UTC (rev 519)
@@ -2,10 +2,11 @@
 ## Package has dynamic library
 useDynLib(RProtoBuf)
 
-importFrom( methods, new )
-importFrom( utils, str )
-importFrom( "stats", "update")
-importFrom( "utils", "packageDescription" )
+importFrom(methods, new)
+importFrom(utils, str, packageDescription)
+importFrom(stats, update)
+importFrom(tools, file_path_as_absolute)
+importFrom(RCurl, basicTextGatherer, curlPerform)
 
 exportClasses(
 
@@ -16,19 +17,19 @@
 	"FileDescriptor", "EnumValueDescriptor",
 
 	# message
-	"Message", 
+	"Message",
 
 	# rpc
-	"RpcHTTP", 
-	
+	"RpcHTTP",
+
 	# virtual streams
 	"ZeroCopyInputStream", "ZeroCopyOutputStream",
-	
+
 	# concrete implementations
-	"ArrayInputStream", "ArrayOutputStream", 
-	"FileInputStream", "FileOutputStream", 
+	"ArrayInputStream", "ArrayOutputStream",
+	"FileInputStream", "FileOutputStream",
 	"ConnectionInputStream", "ConnectionOutputStream"
-	
+
 	)
 
 exportMethods( "new", "[[", "[[<-", "$", "$<-", "show",
@@ -38,7 +39,7 @@
 	"clear", "size", "size<-", "swap",
 	"descriptor", "set", "fetch", "toString",
 	"identical", "==", "!=", "all.equal", "add",
-	"fileDescriptor", "name", "flush", "close", 
+	"fileDescriptor", "name", "flush", "close",
         "setExtension", "getExtension",
 
         "containing_type",
@@ -61,19 +62,19 @@
 	"input_type", "output_type",
 
 	# rpc
-	"invoke", 
-	
+	"invoke",
+
 	# streams
-	"Next", "ByteCount", "BackUp", "Skip", 
-	"ArrayInputStream", "ArrayOutputStream", "FileInputStream", "FileOutputStream", 
-	"GetErrno", "SetCloseOnDelete", 
-	"ConnectionInputStream", "ConnectionOutputStream", 
-	"ReadRaw", "ReadString", "ReadVarint32", 
-	"ReadLittleEndian32", "ReadLittleEndian64", "ReadVarint64", 
-	"WriteRaw", "WriteString", "WriteLittleEndian32", 
+	"Next", "ByteCount", "BackUp", "Skip",
+	"ArrayInputStream", "ArrayOutputStream", "FileInputStream", "FileOutputStream",
+	"GetErrno", "SetCloseOnDelete",
+	"ConnectionInputStream", "ConnectionOutputStream",
+	"ReadRaw", "ReadString", "ReadVarint32",
+	"ReadLittleEndian32", "ReadLittleEndian64", "ReadVarint64",
+	"WriteRaw", "WriteString", "WriteLittleEndian32",
 	"WriteLittleEndian64", "WriteVarint32", "WriteVarint64"
-	
-	
+
+
 	)
 
 export( "P", "readProtoFiles", "asMessage" )

Modified: pkg/R/internals.R
===================================================================
--- pkg/R/internals.R	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/R/internals.R	2013-08-31 00:22:11 UTC (rev 519)
@@ -41,9 +41,7 @@
 		# TODO: we need to pass the full path of the file
 		#       or create a mapping from the current working directory
 		#       in the DiskSourceTree
-		files <- sapply( files[ex], function(x){
-			tools:::file_path_as_absolute(x)
-		} )
+		files <- sapply(files[ex], function(x) file_path_as_absolute(x) )
 	}
 	directories <- unique( c( getwd(), dirname(files) ) )
 	.Call( "readProtoFiles", files, directories, PACKAGE = "RProtoBuf" )

Modified: pkg/R/read.R
===================================================================
--- pkg/R/read.R	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/R/read.R	2013-08-31 00:22:11 UTC (rev 519)
@@ -3,19 +3,19 @@
 	standardGeneric( "read" )
 } )
 
-setMethod( "read", c( descriptor = "Descriptor" , input = "character" ), 
+setMethod( "read", c( descriptor = "Descriptor" , input = "character" ),
 function(descriptor, input ){
-	file <- tools:::file_path_as_absolute( input )
-	.Call( "Descriptor__readMessageFromFile", descriptor at pointer, file, PACKAGE = "RProtoBuf" ) 
+	file <- file_path_as_absolute( input )
+	.Call( "Descriptor__readMessageFromFile", descriptor at pointer, file, PACKAGE = "RProtoBuf" )
 } )
 
 setMethod( "read", c( descriptor = "Descriptor", input = "raw" ), function(descriptor, input ){
 	.Call( "Descriptor__readMessageFromRawVector", descriptor at pointer, input, PACKAGE="RProtoBuf" )
 } )
 
-setMethod( "read", c( descriptor = "Descriptor" ), 
+setMethod( "read", c( descriptor = "Descriptor" ),
 function( descriptor, input ){
-	if( !inherits( input, "connection" ) ){ 
+	if( !inherits( input, "connection" ) ){
 		stop( "can only read from connections" )
 	}
 	wasopen <- identical( summary(input)[["opened"]], "opened" )
@@ -33,14 +33,14 @@
 	standardGeneric( "readASCII" )
 } )
 
-setMethod( "readASCII", c( descriptor = "Descriptor" , input = "character" ), 
+setMethod( "readASCII", c( descriptor = "Descriptor" , input = "character" ),
 function(descriptor, input ){
-	.Call( "Descriptor__readASCIIFromString", descriptor at pointer, input, PACKAGE = "RProtoBuf" ) 
+	.Call( "Descriptor__readASCIIFromString", descriptor at pointer, input, PACKAGE = "RProtoBuf" )
 } )
 
-setMethod( "readASCII", c( descriptor = "Descriptor" ), 
+setMethod( "readASCII", c( descriptor = "Descriptor" ),
 function( descriptor, input ){
-	if( !inherits( input, "connection" ) ){ 
+	if( !inherits( input, "connection" ) ){
 		stop( "can only read from connections" )
 	}
 	wasopen <- identical( summary(input)[["opened"]], "opened" )

Modified: pkg/R/serialize.R
===================================================================
--- pkg/R/serialize.R	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/R/serialize.R	2013-08-31 00:22:11 UTC (rev 519)
@@ -1,44 +1,44 @@
 
 # serialization of protobuf messages
-# at the moment, we grab the payload as a raw vector and send this 
-# to the connection, but in the future, we will directly stream out 
+# at the moment, we grab the payload as a raw vector and send this
+# to the connection, but in the future, we will directly stream out
 # the payload to the connection
 
 setGeneric( "serialize" )
-setMethod( "serialize", c( object = "Message" ) , 
+setMethod( "serialize", c( object = "Message" ) ,
 	function( object, connection, ascii = FALSE, refhook = NULL){
                 stopifnot(object$isInitialized())
 		iscon <- inherits(connection, "connection")
 		isnull <- is.null( connection )
-		
+
 		if( is.character( connection ) ){
 			# pretend it is a file name
 			if( !file.exists(connection) ){
 				# FIXME: hack to grab the absolute path name
 				file.create( connection )
-				file <- tools:::file_path_as_absolute(connection)
+				file <- file_path_as_absolute(connection)
 				unlink( file )
 			} else{
-				file <- tools:::file_path_as_absolute(connection)
+				file <- file_path_as_absolute(connection)
 			}
 			.Call( "Message__serialize_to_file", object at pointer, file, PACKAGE = "RProtoBuf" )
 			invisible( NULL)
 		} else if( iscon || isnull ) {
-			
-			# first grab the payload as a raw vector, 
+
+			# first grab the payload as a raw vector,
 			payload <- .Call( "Message__get_payload", object at pointer, PACKAGE = "RProtoBuf" )
 			if( isnull ){
 				# just return it if the connection is NULL
 				payload
 			} else{
 				# otherwise write the payload to the connection
-				# FIXME: we might want to be more clever about this so that 
+				# FIXME: we might want to be more clever about this so that
 				#        we don't have to store the full payload in memory
 				#        but for now it will do just fine
 				writeBin( payload, connection )
 				invisible( NULL )
 			}
-			
+
 		}
 	}
 )

Modified: pkg/R/wrapper_ZeroCopyInputStream.R
===================================================================
--- pkg/R/wrapper_ZeroCopyInputStream.R	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/R/wrapper_ZeroCopyInputStream.R	2013-08-31 00:22:11 UTC (rev 519)
@@ -62,15 +62,15 @@
 setGeneric( "ArrayInputStream", function(payload, block_size){
 	standardGeneric( "ArrayInputStream" )
 } )
-setMethod( "ArrayInputStream", c( payload = "raw", block_size = "missing" ) , 
+setMethod( "ArrayInputStream", c( payload = "raw", block_size = "missing" ) ,
 function(payload, block_size){
 	.Call( "ArrayInputStream__new", payload, -1L, PACKAGE = "RProtoBuf" )
 } )
-setMethod( "ArrayInputStream", c( payload = "raw", block_size = "integer" ) , 
+setMethod( "ArrayInputStream", c( payload = "raw", block_size = "integer" ) ,
 function(payload, block_size){
 	.Call( "ArrayInputStream__new", payload, block_size, PACKAGE = "RProtoBuf" )
 } )
-setMethod( "ArrayInputStream", c( payload = "raw", block_size = "numeric" ) , 
+setMethod( "ArrayInputStream", c( payload = "raw", block_size = "numeric" ) ,
 function(payload, block_size){
 	.Call( "ArrayInputStream__new", payload, as.integer(block_size), PACKAGE = "RProtoBuf" )
 } )
@@ -81,22 +81,22 @@
 	standardGeneric( "ArrayOutputStream" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "integer", block_size = "missing" ), function(size, block_size){
-	.Call( "ArrayOutputStream__new", size, -1L, PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", size, -1L, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "integer", block_size = "integer" ), function(size, block_size){
-	.Call( "ArrayOutputStream__new", size, block_size, PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", size, block_size, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "integer", block_size = "numeric" ), function(size, block_size){
-	.Call( "ArrayOutputStream__new", size, as.integer(block_size) , PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", size, as.integer(block_size) , PACKAGE = "RProtoBuf" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "numeric", block_size = "missing" ), function(size, block_size){
-	.Call( "ArrayOutputStream__new", as.integer(size), -1L, PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", as.integer(size), -1L, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "numeric", block_size = "integer" ),function(size, block_size){
-	.Call( "ArrayOutputStream__new", as.integer(size), block_size, PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", as.integer(size), block_size, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "ArrayOutputStream", signature( size = "numeric", block_size = "numeric" ), function(size, block_size){
-	.Call( "ArrayOutputStream__new", as.integer(size), as.integer(block_size) , PACKAGE = "RProtoBuf" ) 
+	.Call( "ArrayOutputStream__new", as.integer(size), as.integer(block_size) , PACKAGE = "RProtoBuf" )
 } )
 # }}}
 
@@ -105,7 +105,7 @@
 	standardGeneric( "FileInputStream" )
 } )
 setMethod( "FileInputStream", signature( filename = "character", block_size = "integer", close.on.delete = "logical" ), function(filename, block_size = -1L, close.on.delete = FALSE){
-	full_filename <- tools:::file_path_as_absolute(filename)
+	full_filename <- file_path_as_absolute(filename)
 	.Call( "FileInputStream_new", filename, block_size, close.on.delete, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "close", "FileInputStream", function(con, ...){
@@ -129,12 +129,12 @@
 			stop( "directory does not exist" )
 		}
 		file.create( filename )
-		filename <- tools:::file_path_as_absolute(filename)
+		filename <- file_path_as_absolute(filename)
 		unlink( filename )
 	} else{
-		filename <- tools:::file_path_as_absolute(filename)
+		filename <- file_path_as_absolute(filename)
 	}
-	
+
 	.Call( "FileOutputStream_new", filename, block_size, close.on.delete, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "flush", "FileOutputStream", function(con){

Modified: pkg/R/zzz.R
===================================================================
--- pkg/R/zzz.R	2013-08-30 06:30:35 UTC (rev 518)
+++ pkg/R/zzz.R	2013-08-31 00:22:11 UTC (rev 519)
@@ -6,8 +6,8 @@
     readProtoFiles( package=pkgname, lib.loc=libname )
     attachDescriptorPool( pos = length(search()) )
     options("RProtoBuf.int64AsString" = FALSE)
-    if( exists( ".httpd.handlers.env", asNamespace( "tools" ) ) ){
-        e <- tools:::.httpd.handlers.env
-        e[["RProtoBuf"]] <- RProtoBuf.http.handler
-    }
+    #if( exists( ".httpd.handlers.env", asNamespace( "tools" ) ) ){
+    #    e <- tools:::.httpd.handlers.env
+    #    e[["RProtoBuf"]] <- RProtoBuf.http.handler
+    #}
 }



More information about the Rprotobuf-commits mailing list