[rkward-cvs] SF.net SVN: rkward:[2477] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed May 13 16:32:13 UTC 2009
Revision: 2477
http://rkward.svn.sourceforge.net/rkward/?rev=2477&view=rev
Author: tfry
Date: 2009-05-13 16:32:13 +0000 (Wed, 13 May 2009)
Log Message:
-----------
(Almost) all plugins should write an rk.header().
This commit takes care of the save/load plugins.
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/rkward/plugins/00saveload/import/import_csv.php
trunk/rkward/rkward/plugins/00saveload/import/import_spss.php
trunk/rkward/rkward/plugins/00saveload/import/load_data.php
trunk/rkward/rkward/plugins/00saveload/import/source.php
trunk/rkward/rkward/plugins/00saveload/save/save/code.php
trunk/rkward/rkward/plugins/00saveload/save/skeleton/code.php
trunk/rkward/rkward/plugins/00saveload/save/write/code.php
trunk/rkward/rkward/plugins/00saveload/save/write_table.php
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/ChangeLog 2009-05-13 16:32:13 UTC (rev 2477)
@@ -1,3 +1,5 @@
+- (Almost) all plugins now write a header to the output window TODO: work in progress; which ones should not?
+- Add makeHeaderCode convenience function for use inside plugins TODO: document
- Adjust some icons
- Add "Run again" link for plugin generated output TODO: revisit plugins without header
- Fixed: All objects in .Globalenv would be revisited if a single object was added / removed TODO: backport? (r2466, 2473)
Modified: trunk/rkward/rkward/plugins/00saveload/import/import_csv.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_csv.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_csv.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -42,6 +42,7 @@
<? }
}
-function printout () {
+function printout () {
+ makeHeaderCode ("Import text / csv data", array ("File" => getRK_val ("file"), "Import as" => getRK_val ("name")));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -65,5 +65,6 @@
}
function printout () {
+ makeHeaderCode ("Import SPSS data", array ("File" => getRK_val ("file"), "Import as" => getRK_val ("saveto")));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/import/load_data.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/load_data.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/import/load_data.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -3,6 +3,8 @@
}
function calculate () {
+ global $envir;
+
if (getRK_val ("other_env")) {
$other_env = true;
$envir = getRK_val ("envir");
@@ -18,6 +20,8 @@
}
function printout () {
+ global $envir;
+ makeHeaderCode ("Load data", array ("File" => getRK_val ("file"), "Import to environment" => $envir));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/import/source.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/source.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/import/source.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -23,6 +23,7 @@
}
function printout () {
+ makeHeadercode ("Source R file", array ("File" => getRK_val ("file")));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/save/save/code.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/save/save/code.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/save/save/code.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -3,12 +3,15 @@
}
function calculate () {
-$vars = str_replace ("\n", ",", trim (getRK_val ("data"))) ;
+ global $vars;
+ $vars = str_replace ("\n", ",", trim (getRK_val ("data")));
?>
save (<? echo ($vars); ?>, file="<? getRK("file"); ?>", ascii=<? getRK("ascii"); ?>, compress=<? getRK("compress"); ?>)
<?
}
function printout () {
+ global $vars;
+ makeHeaderCode ("Save R objects", array ("File" => getRK_val ("file"), "Variables" => $vars));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/save/skeleton/code.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/save/skeleton/code.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/save/skeleton/code.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -10,5 +10,6 @@
}
function printout () {
+ makeHeaderCode ("Create package skeleton", array ("Name" => getRK_val ("name"), "Directory" => getRK_val ("path")));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/save/write/code.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/save/write/code.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/save/write/code.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -9,5 +9,6 @@
}
function printout () {
+ makeHeaderCode ("Write Variables", array ("File" => getRK_val ("file"), "Data" => getRK_val ("data")));
}
?>
Modified: trunk/rkward/rkward/plugins/00saveload/save/write_table.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/save/write_table.php 2009-05-13 16:29:26 UTC (rev 2476)
+++ trunk/rkward/rkward/plugins/00saveload/save/write_table.php 2009-05-13 16:32:13 UTC (rev 2477)
@@ -9,5 +9,6 @@
}
function printout () {
+ makeHeaderCode ("Write as table", array ("File" => getRK_val ("file"), "Data" => getRK_val ("data")));
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list