[Sciviews-commits] r338 - komodo komodo/SciViews-K komodo/SciViews-K/.komodotools komodo/SciViews-K/.komodotools/Project komodo/SciViews-K/components komodo/SciViews-K/content komodo/SciViews-K/content/js komodo/SciViews-K/content/js/tools komodo/SciViews-K/defaults komodo/SciViews-K/locale/en-GB komodo/SciViews-K/locale/fr-FR komodo/SciViews-K/pylib komodo/SciViews-K Unit komodo/SciViews-K Unit/.komodotools komodo/SciViews-K Unit/.komodotools/Project pkg/svGUI pkg/svGUI/R pkg/svGUI/man pkg/svMisc pkg/svMisc/R pkg/svMisc/man pkg/svSocket pkg/svSocket/R pkg/svSocket/man pkg/svUnit pkg/svUnit/inst/doc pkg/svUnit/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Oct 31 17:58:59 CET 2010


Author: phgrosjean
Date: 2010-10-31 17:58:58 +0100 (Sun, 31 Oct 2010)
New Revision: 338

Added:
   komodo/SciViews-K Unit/.komodotools/
   komodo/SciViews-K Unit/.komodotools/.migrated
   komodo/SciViews-K Unit/.komodotools/Project/
   komodo/SciViews-K Unit/.komodotools/Project/.folderdata
   komodo/SciViews-K Unit/.komodotools/Project/Build.komodotool
   komodo/SciViews-K Unit/.komodotools/Project/Configure.komodotool
   komodo/SciViews-K Unit/.komodotools/Project/extension_lib.komodotool
   komodo/SciViews-K Unit/SciViews-K Unit.komodoproject
   komodo/SciViews-K/.komodotools/
   komodo/SciViews-K/.komodotools/.migrated
   komodo/SciViews-K/.komodotools/Project/
   komodo/SciViews-K/.komodotools/Project/.folderdata
   komodo/SciViews-K/.komodotools/Project/Build.komodotool
   komodo/SciViews-K/.komodotools/Project/Configure.komodotool
   komodo/SciViews-K/.komodotools/Project/extension_lib.komodotool
   komodo/SciViews-K/SciViews-K.komodoproject
   komodo/SciViews-K/components/Conscript
   komodo/SciViews-K/components/koRLinter.py
   komodo/SciViews-K/defaults/R reference (0.9.20).kpz
   komodo/SciViews-K/defaults/SciViews-K (0.9.20).kpz
   komodo/SciViews-K/defaults/codetools_0.2-2.tar.gz
   komodo/SciViews-K/defaults/codetools_0.2-2.zip
   komodo/SciViews-K/defaults/svGUI_0.9-50.tar.gz
   komodo/SciViews-K/defaults/svGUI_0.9-50.zip
   komodo/SciViews-K/defaults/svSocket_0.9-51.tar.gz
   komodo/SciViews-K/defaults/svSocket_0.9-51.zip
   komodo/SciViews-K/defaults/svTools_0.9-1.tar.gz
   komodo/SciViews-K/defaults/svTools_0.9-1.zip
Removed:
   komodo/SciViews-K/defaults/R reference (0.9.18).kpz
   komodo/SciViews-K/defaults/SciViews-K (0.9.18).kpz
   komodo/SciViews-K/defaults/svGUI_0.9-49.tar.gz
   komodo/SciViews-K/defaults/svGUI_0.9-49.zip
   komodo/SciViews-K/defaults/svSocket_0.9-50.tar.gz
   komodo/SciViews-K/defaults/svSocket_0.9-50.zip
Modified:
   komodo/.DS_Store
   komodo/SciViews-K Unit/sciviewskunit-0.7.3-ko.xpi
   komodo/SciViews-K/components/koR_UDL_Language.py
   komodo/SciViews-K/components/svRinterpreter.js
   komodo/SciViews-K/content/Rinterpolationhelp.xul
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/js/interpolate.js
   komodo/SciViews-K/content/js/misc.js
   komodo/SciViews-K/content/js/pref-R.js
   komodo/SciViews-K/content/js/prefs.js
   komodo/SciViews-K/content/js/r-help.js
   komodo/SciViews-K/content/js/r.js
   komodo/SciViews-K/content/js/rinterpolationquery.js
   komodo/SciViews-K/content/js/robjects.js
   komodo/SciViews-K/content/js/sciviews.js
   komodo/SciViews-K/content/js/socket.js
   komodo/SciViews-K/content/js/tools/array.js
   komodo/SciViews-K/content/js/tools/file.js
   komodo/SciViews-K/content/pref-R.xul
   komodo/SciViews-K/content/rsearch.html
   komodo/SciViews-K/content/sessions.xul
   komodo/SciViews-K/defaults/svStart.R
   komodo/SciViews-K/install.rdf
   komodo/SciViews-K/locale/en-GB/sciviewsk.dtd
   komodo/SciViews-K/locale/fr-FR/main.properties
   komodo/SciViews-K/locale/fr-FR/sciviewsk.dtd
   komodo/SciViews-K/pylib/lang_r.py
   pkg/svGUI/DESCRIPTION
   pkg/svGUI/NEWS
   pkg/svGUI/R/guiRefresh.R
   pkg/svGUI/R/httpServer.R
   pkg/svGUI/man/svGUI-package.Rd
   pkg/svMisc/DESCRIPTION
   pkg/svMisc/NEWS
   pkg/svMisc/R/objList.R
   pkg/svMisc/man/svMisc-package.Rd
   pkg/svSocket/DESCRIPTION
   pkg/svSocket/NEWS
   pkg/svSocket/R/processSocket.R
   pkg/svSocket/man/svSocket-package.Rd
   pkg/svUnit/NEWS
   pkg/svUnit/TODO
   pkg/svUnit/inst/doc/svUnit.pdf
   pkg/svUnit/man/svSuiteData.Rd
Log:
Synch of Kamil and Philippe changes (conflicts resolution, but several things are broken... cannot even start R from Komodo any more in Mac OS X)!

Modified: komodo/.DS_Store
===================================================================
(Binary files differ)

Added: komodo/SciViews-K/.komodotools/.migrated
===================================================================
--- komodo/SciViews-K/.komodotools/.migrated	                        (rev 0)
+++ komodo/SciViews-K/.komodotools/.migrated	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1 @@
+migrated SciViews-K on Tue Oct  5 05:06:29 2010

Added: komodo/SciViews-K/.komodotools/Project/.folderdata
===================================================================
--- komodo/SciViews-K/.komodotools/Project/.folderdata	                        (rev 0)
+++ komodo/SciViews-K/.komodotools/Project/.folderdata	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,5 @@
+{
+  "version": "1.0.7", 
+  "type": "folder", 
+  "name": "Project"
+}
\ No newline at end of file

Added: komodo/SciViews-K/.komodotools/Project/Build.komodotool
===================================================================
--- komodo/SciViews-K/.komodotools/Project/Build.komodotool	                        (rev 0)
+++ komodo/SciViews-K/.komodotools/Project/Build.komodotool	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,55 @@
+{
+  "keyboard_shortcut": "", 
+  "name": "Build", 
+  "language": "JavaScript", 
+  "trigger_enabled": "0", 
+  "rank": "100", 
+  "trigger": "trigger_postopen", 
+  "value": [
+    "/**", 
+    " * Script to build an xpi, running koext build in the current project root.", 
+    " */", 
+    "", 
+    "var project = ko.macros.current.project;", 
+    "", 
+    "var os = Components.classes['@activestate.com/koOs;1'].", 
+    "  getService(Components.interfaces.koIOs);", 
+    "", 
+    "var koSysUtils = Components.classes[\"@activestate.com/koSysUtils;1\"].", 
+    "  getService(Components.interfaces.koISysUtils);", 
+    "", 
+    "var appInfo = Components.classes[\"@mozilla.org/xre/app-info;1\"].", 
+    "  getService(Components.interfaces.nsIXULRuntime);", 
+    "", 
+    "var koDirs = Components.classes['@activestate.com/koDirs;1'].", 
+    "  getService(Components.interfaces.koIDirs);", 
+    "", 
+    "var pythonExe = koDirs.pythonExe;", 
+    "var projectDir = ko.interpolate.interpolateStrings('%p');", 
+    "var scriptName = 'koext';", 
+    "", 
+    "if (appInfo.OS == 'WINNT') {", 
+    "  scriptName += \".py\"; ", 
+    "}", 
+    "", 
+    "var arr = [koDirs.sdkDir, 'bin', scriptName]", 
+    "var app = os.path.joinlist(arr.length, arr);", 
+    "var cmd = '\"'+pythonExe+'\" \"'+app+'\" build -d \"'+projectDir+'\"';", 
+    "", 
+    "if (appInfo.OS == 'WINNT') {", 
+    "  cmd = '\"' + cmd + '\"';", 
+    "}", 
+    "var cwd = koDirs.mozBinDir;", 
+    "cmd += \" {'cwd': u'\"+cwd+\"'}\";", 
+    "", 
+    "ko.run.runEncodedCommand(window, cmd, function() {", 
+    "  ko.statusBar.AddMessage('Build complete', 'projects', 5000, true);", 
+    "  ko.projects.manager.saveProject(project);", 
+    "});", 
+    ""
+  ], 
+  "version": "1.0.7", 
+  "async": "0", 
+  "type": "macro", 
+  "icon": "chrome://famfamfamsilk/skin/icons/lightning_go.png"
+}
\ No newline at end of file

Added: komodo/SciViews-K/.komodotools/Project/Configure.komodotool
===================================================================
--- komodo/SciViews-K/.komodotools/Project/Configure.komodotool	                        (rev 0)
+++ komodo/SciViews-K/.komodotools/Project/Configure.komodotool	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,77 @@
+{
+  "keyboard_shortcut": "", 
+  "name": "Configure", 
+  "language": "JavaScript", 
+  "trigger_enabled": "0", 
+  "rank": "100", 
+  "trigger": "trigger_postopen", 
+  "value": [
+    "try {", 
+    "", 
+    "var libPart = ko.projects.findPart('macro', 'extension_lib', 'container');", 
+    "eval(libPart.value);", 
+    "", 
+    "var koExt = new extensionLib();", 
+    "", 
+    "var project = ko.macros.current.project;", 
+    "", 
+    "var setupWin = project.getChildByAttributeValue('name','setup.xul', 1);", 
+    "var rdf = project.getChildByAttributeValue('name','install.rdf', 1);", 
+    "var data = {};", 
+    "", 
+    "var prefset = project.prefset;", 
+    "", 
+    "if(prefset.hasPrefHere('configured')) {", 
+    "    var rdf_xml = koExt.readFile(rdf.getFile().URI);", 
+    "    data = {", 
+    "        'valid': false,", 
+    "        'configured': true,", 
+    "        'vars': koExt.getRdfVars(rdf_xml)", 
+    "    };", 
+    "    data.vars['ext_name'] = koExt.getNiceName(data.vars.name);", 
+    "} else { // init data", 
+    "    data = {", 
+    "        'valid': false,", 
+    "        'configured': false,", 
+    "        'vars': {", 
+    "            'id': '',", 
+    "            'name': 'My Extension',", 
+    "            'creator': 'Me',", 
+    "            'version': '0.1',", 
+    "            'description': '',", 
+    "            'homepageURL': '',", 
+    "            'ext_name': ''", 
+    "        }", 
+    "    };", 
+    "}", 
+    "", 
+    "window.openDialog(", 
+    "    setupWin.getFile().URI,", 
+    "    \"_blank\",", 
+    "    \"centerscreen,chrome,resizable,scrollbars,dialog=no,close,modal=yes\",", 
+    "    data", 
+    ");", 
+    "", 
+    "if(data.valid) {", 
+    "    if(koExt.updateProject(data.vars)) {", 
+    "        prefset.setBooleanPref('configured', true);", 
+    "        var part = project.getChildByAttributeValue('name', 'oncreate',1);", 
+    "        if(part) { part.name = 'Configure'; }", 
+    "        var msg = 'Extension Project '+data.vars.name+' configured!';", 
+    "        ko.statusBar.AddMessage(msg, 'project', 3000, true);", 
+    "        ko.projects.manager.saveProject(project);", 
+    "    } else {", 
+    "        alert('Error encountered: '+koExt.error+\"\\nConfiguration aborted.\");", 
+    "    }", 
+    "}", 
+    "", 
+    "} catch(e) {", 
+    "    alert(e);", 
+    "}", 
+    ""
+  ], 
+  "version": "1.0.7", 
+  "async": "0", 
+  "type": "macro", 
+  "icon": "chrome://famfamfamsilk/skin/icons/wrench.png"
+}
\ No newline at end of file

Added: komodo/SciViews-K/.komodotools/Project/extension_lib.komodotool
===================================================================
--- komodo/SciViews-K/.komodotools/Project/extension_lib.komodotool	                        (rev 0)
+++ komodo/SciViews-K/.komodotools/Project/extension_lib.komodotool	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,174 @@
+{
+  "keyboard_shortcut": "", 
+  "name": "extension_lib", 
+  "language": "JavaScript", 
+  "trigger_enabled": "0", 
+  "rank": "100", 
+  "trigger": "trigger_postopen", 
+  "value": [
+    "try {", 
+    "    ", 
+    "var extensionLib = function() {", 
+    "    this.os = Components.classes['@activestate.com/koOs;1'].", 
+    "        getService(Components.interfaces.koIOs);", 
+    "    this.error = false;", 
+    "}", 
+    "", 
+    "extensionLib.prototype.getPath = function(relative) {", 
+    "    try {", 
+    "        var prj_path = ko.interpolate.interpolateStrings('%p');", 
+    "        path = this.os.path.join(prj_path, relative);", 
+    "        return path;", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg name: \"+name);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.readFile = function(filename) {", 
+    "    // read the template file", 
+    "    try {", 
+    "        var fileEx = Components.classes[\"@activestate.com/koFileEx;1\"]", 
+    "                .createInstance(Components.interfaces.koIFileEx);", 
+    "        fileEx.URI = filename;", 
+    "        fileEx.open('rb');", 
+    "        var content = fileEx.readfile();", 
+    "        fileEx.close();", 
+    "        return content;", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg filename: \"+filename);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.writeFile = function(filename, content) {", 
+    "    try {", 
+    "        var fileEx = Components.classes[\"@activestate.com/koFileEx;1\"]", 
+    "                .createInstance(Components.interfaces.koIFileEx);", 
+    "        fileEx.URI = filename;", 
+    "        fileEx.open('wb+');", 
+    "        fileEx.puts(content);", 
+    "        fileEx.close();", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg filename: \"+filename);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.getRdfVars = function(txt) {", 
+    "    try {", 
+    "        var Rx = /\\<em\\:([\\w]+)[\\ \\S]*\\>([\\S\\ ]+?)\\<\\//g;", 
+    "        var ext_vars = {};", 
+    "        while(results = Rx.exec(txt)) {", 
+    "            var idRx = /type|min|max|\\{/;", 
+    "            if(!idRx.test(results[0])) { // filter out stuff we don't want", 
+    "                ext_vars[results[1]] = results[2];", 
+    "            }", 
+    "        }", 
+    "        return ext_vars;", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg rdf_path: \"+rdf_path);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.getManifestVars = function(txt) {", 
+    "    try {", 
+    "        var rx1 = /content ([\\S]+?) jar\\:([\\S]+?)\\.jar/g;", 
+    "        var res1 = rx1.exec(txt);", 
+    "        var rx2 = /chrome:\\/\\/([\\S]+?)\\/content\\/overlay\\.xul/g;", 
+    "        var res2 = rx2.exec(txt);", 
+    "        return new Array(res1[1], res1[2], res2[1]);", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg path: \"+path);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.getOverlayVars = function(txt) {", 
+    "    try {", 
+    "        var rx1 = /<overlay id=\"([\\S]+?)\"/g;", 
+    "        var res1 = rx1.exec(txt);", 
+    "        var rx2 = /<menuitem id=\"([\\S]+?)\"[\\s]+?label=\"([\\S\\ ]+?)\"/g;", 
+    "        var res2 = rx2.exec(txt);", 
+    "        return [res1[1], res2[1], res2[2]];", 
+    "    } catch(e) {", 
+    "        alert(e+\"\\narg path: \"+path);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.updateProject = function(vars) {", 
+    "    try {", 
+    "        var overlayPath = this.getPath('content/overlay.xul');", 
+    "        if(this.os.path.exists(overlayPath)) {", 
+    "            var ovl_str = this.readFile(overlayPath);", 
+    "            var ov_vars = this.getOverlayVars(ovl_str);", 
+    "            var ovl_new = [vars.ext_name+'Overlay', 'menu_'+vars.ext_name, vars.name];", 
+    "            this.writeFile(overlayPath, this.replaceAll(ov_vars, ovl_new, ovl_str));", 
+    "        } else { this.error = \"Doesn't exist: \"+overlayPath; return false; }", 
+    "        ", 
+    "        var manifestPath = this.getPath('chrome.manifest');", 
+    "        if(this.os.path.exists(manifestPath)) {", 
+    "            var man_str = this.readFile(manifestPath);", 
+    "            var man_vars = this.getManifestVars(man_str);", 
+    "            var man_new = [vars.ext_name, vars.ext_name, vars.ext_name];", 
+    "            this.writeFile(manifestPath, this.replaceAll(man_vars, man_new, man_str));", 
+    "        } else { this.error = \"Doesn't exist: \"+overlayPath; return false; }", 
+    "        ", 
+    "        var rdf_path = this.getPath('install.rdf');", 
+    "        if(this.os.path.exists(rdf_path)) {", 
+    "            var rdf_str = this.readFile(rdf_path);", 
+    "            var rdf_vars = this.getRdfVars(rdf_str);", 
+    "            this.writeFile(rdf_path, this.replaceAll(rdf_vars, vars, rdf_str));", 
+    "        } else { this.error = \"Doesn't exist: \"+overlayPath; return false; }", 
+    "        ", 
+    "    } catch(e) {", 
+    "        this.error = e;", 
+    "        return false;", 
+    "    }", 
+    "    return true;", 
+    "}", 
+    "", 
+    "extensionLib.prototype.replaceAll = function(orig_vars, new_vars, str) {", 
+    "    try {", 
+    "        var out = str;", 
+    "        for(v in orig_vars) {", 
+    "            out = out.replace(orig_vars[v], new_vars[v]);", 
+    "        }", 
+    "        return out;", 
+    "    } catch(e) {", 
+    "        alert(e);", 
+    "    }", 
+    "}", 
+    "", 
+    "extensionLib.prototype.getNiceName = function(name) {", 
+    "    return this.trim(name).replace(/[\\W]/g,'').toLowerCase();", 
+    "}", 
+    "", 
+    "extensionLib.prototype.trim = function(str) {", 
+    "    return str.replace(/^\\s*/, '').replace(/\\s*$/, '');", 
+    "}", 
+    "", 
+    "extensionLib.prototype.clone = function(obj) {", 
+    "    var newobj = {}; for(i in obj) {", 
+    "        newobj[i] = obj[i];", 
+    "    } return newobj;", 
+    "}", 
+    "", 
+    "extensionLib.prototype._dump = function(obj) {", 
+    "    var str = ''; for(i in obj) {", 
+    "        str += i+': '+obj[i]+'\\n';", 
+    "    } return(str);", 
+    "}", 
+    "", 
+    "extensionLib.prototype._keys = function(obj) {", 
+    "  var out = new Array(); for(i in obj) {", 
+    "    out.push(i);", 
+    "  } return out;", 
+    "}", 
+    "", 
+    "} catch(e) {", 
+    "    allert(e);", 
+    "}", 
+    ""
+  ], 
+  "version": "1.0.7", 
+  "async": "0", 
+  "type": "macro", 
+  "icon": "chrome://famfamfamsilk/skin/icons/brick.png"
+}
\ No newline at end of file

Added: komodo/SciViews-K/SciViews-K.komodoproject
===================================================================
--- komodo/SciViews-K/SciViews-K.komodoproject	                        (rev 0)
+++ komodo/SciViews-K/SciViews-K.komodoproject	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,557 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Komodo Project File - DO NOT EDIT -->
+<project id="6200c0ed-45ec-4f46-a159-284803d65c04" kpf_version="5" name="SciViews-K.komodoproject">
+<folder id="f5feb14c-33f6-a44d-ad41-ab38bf630926" idref="6200c0ed-45ec-4f46-a159-284803d65c04" name="Project">
+</folder>
+<file id="46c370a6-978b-4513-9cb8-056aebcf01f3" idref="aeee779f-9156-4b41-be2d-675d32098ff1" name="setup.xul" url="_prj_internal_/setup.xul">
+</file>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/wrench.png" id="51c7310c-805d-4bcb-af72-57b51804be23" idref="aeee779f-9156-4b41-be2d-675d32098ff1" keyboard_shortcut="" language="JavaScript" name="Configure" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+try {
+
+var libPart = ko.projects.findPart('macro', 'extension_lib', 'container');
+eval(libPart.value);
+
+var koExt = new extensionLib();
+
+var project = ko.macros.current.project;
+
+var setupWin = project.getChildByAttributeValue('name','setup.xul', 1);
+var rdf = project.getChildByAttributeValue('name','install.rdf', 1);
+var data = {};
+
+var prefset = project.prefset;
+
+if(prefset.hasPrefHere('configured')) {
+    var rdf_xml = koExt.readFile(rdf.getFile().URI);
+    data = {
+        'valid': false,
+        'configured': true,
+        'vars': koExt.getRdfVars(rdf_xml)
+    };
+    data.vars['ext_name'] = koExt.getNiceName(data.vars.name);
+} else { // init data
+    data = {
+        'valid': false,
+        'configured': false,
+        'vars': {
+            'id': '',
+            'name': 'My Extension',
+            'creator': 'Me',
+            'version': '0.1',
+            'description': '',
+            'homepageURL': '',
+            'ext_name': ''
+        }
+    };
+}
+
+window.openDialog(
+    setupWin.getFile().URI,
+    "_blank",
+    "centerscreen,chrome,resizable,scrollbars,dialog=no,close,modal=yes",
+    data
+);
+
+if(data.valid) {
+    if(koExt.updateProject(data.vars)) {
+        prefset.setBooleanPref('configured', true);
+        var part = project.getChildByAttributeValue('name', 'oncreate',1);
+        if(part) { part.name = 'Configure'; }
+        var msg = 'Extension Project '+data.vars.name+' configured!';
+        ko.statusBar.AddMessage(msg, 'project', 3000, true);
+        ko.projects.manager.saveProject(project);
+    } else {
+        alert('Error encountered: '+koExt.error+"\nConfiguration aborted.");
+    }
+}
+
+} catch(e) {
+    alert(e);
+}
+</macro>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/lightning_go.png" id="a9aadbbc-4089-4c4e-b7ed-87089102aa06" idref="aeee779f-9156-4b41-be2d-675d32098ff1" keyboard_shortcut="" language="JavaScript" name="Build" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+/**
+ * Script to build an xpi, running koext build in the current project root.
+ */
+
+var project = ko.macros.current.project;
+
+var os = Components.classes['@activestate.com/koOs;1'].
+  getService(Components.interfaces.koIOs);
+
+var koSysUtils = Components.classes["@activestate.com/koSysUtils;1"].
+  getService(Components.interfaces.koISysUtils);
+
+var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
+  getService(Components.interfaces.nsIXULRuntime);
+
+var koDirs = Components.classes['@activestate.com/koDirs;1'].
+  getService(Components.interfaces.koIDirs);
+
+var pythonExe = koDirs.pythonExe;
+var projectDir = ko.interpolate.interpolateStrings('%p');
+var scriptName = 'koext';
+
+if (appInfo.OS == 'WINNT') {
+  scriptName += ".py"; 
+}
+
+var arr = [koDirs.sdkDir, 'bin', scriptName]
+var app = os.path.joinlist(arr.length, arr);
+var cmd = '"'+pythonExe+'" "'+app+'" build -d "'+projectDir+'"';
+
+if (appInfo.OS == 'WINNT') {
+  cmd = '"' + cmd + '"';
+}
+var cwd = koDirs.mozBinDir;
+cmd += " {'cwd': u'"+cwd+"'}";
+
+ko.run.runEncodedCommand(window, cmd, function() {
+  ko.statusBar.AddMessage('Build complete', 'projects', 5000, true);
+  ko.projects.manager.saveProject(project);
+});
+</macro>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/brick.png" id="ff0456a2-4546-480a-897e-6bc9f30d58a2" idref="aeee779f-9156-4b41-be2d-675d32098ff1" keyboard_shortcut="" language="JavaScript" name="extension_lib" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+try {
+    
+var extensionLib = function() {
+    this.os = Components.classes['@activestate.com/koOs;1'].
+        getService(Components.interfaces.koIOs);
+    this.error = false;
+}
+
+extensionLib.prototype.getPath = function(relative) {
+    try {
+        var prj_path = ko.interpolate.interpolateStrings('%p');
+        path = this.os.path.join(prj_path, relative);
+        return path;
+    } catch(e) {
+        alert(e+"\narg name: "+name);
+    }
+}
+
+extensionLib.prototype.readFile = function(filename) {
+    // read the template file
+    try {
+        var fileEx = Components.classes["@activestate.com/koFileEx;1"]
+                .createInstance(Components.interfaces.koIFileEx);
+        fileEx.URI = filename;
+        fileEx.open('rb');
+        var content = fileEx.readfile();
+        fileEx.close();
+        return content;
+    } catch(e) {
+        alert(e+"\narg filename: "+filename);
+    }
+}
+
+extensionLib.prototype.writeFile = function(filename, content) {
+    try {
+        var fileEx = Components.classes["@activestate.com/koFileEx;1"]
+                .createInstance(Components.interfaces.koIFileEx);
+        fileEx.URI = filename;
+        fileEx.open('wb+');
+        fileEx.puts(content);
+        fileEx.close();
+    } catch(e) {
+        alert(e+"\narg filename: "+filename);
+    }
+}
+
+extensionLib.prototype.getRdfVars = function(txt) {
+    try {
+        var Rx = /\&lt;em\:([\w]+)[\ \S]*\&gt;([\S\ ]+?)\&lt;\//g;
+        var ext_vars = {};
+        while(results = Rx.exec(txt)) {
+            var idRx = /type|min|max|\{/;
+            if(!idRx.test(results[0])) { // filter out stuff we don't want
+                ext_vars[results[1]] = results[2];
+            }
+        }
+        return ext_vars;
+    } catch(e) {
+        alert(e+"\narg rdf_path: "+rdf_path);
+    }
+}
+
+extensionLib.prototype.getManifestVars = function(txt) {
+    try {
+        var rx1 = /content ([\S]+?) jar\:([\S]+?)\.jar/g;
+        var res1 = rx1.exec(txt);
+        var rx2 = /chrome:\/\/([\S]+?)\/content\/overlay\.xul/g;
+        var res2 = rx2.exec(txt);
+        return new Array(res1[1], res1[2], res2[1]);
+    } catch(e) {
+        alert(e+"\narg path: "+path);
+    }
+}
+
+extensionLib.prototype.getOverlayVars = function(txt) {
+    try {
+        var rx1 = /&lt;overlay id="([\S]+?)"/g;
+        var res1 = rx1.exec(txt);
+        var rx2 = /&lt;menuitem id="([\S]+?)"[\s]+?label="([\S\ ]+?)"/g;
+        var res2 = rx2.exec(txt);
+        return [res1[1], res2[1], res2[2]];
+    } catch(e) {
+        alert(e+"\narg path: "+path);
+    }
+}
+
+extensionLib.prototype.updateProject = function(vars) {
+    try {
+        var overlayPath = this.getPath('content/overlay.xul');
+        if(this.os.path.exists(overlayPath)) {
+            var ovl_str = this.readFile(overlayPath);
+            var ov_vars = this.getOverlayVars(ovl_str);
+            var ovl_new = [vars.ext_name+'Overlay', 'menu_'+vars.ext_name, vars.name];
+            this.writeFile(overlayPath, this.replaceAll(ov_vars, ovl_new, ovl_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+        var manifestPath = this.getPath('chrome.manifest');
+        if(this.os.path.exists(manifestPath)) {
+            var man_str = this.readFile(manifestPath);
+            var man_vars = this.getManifestVars(man_str);
+            var man_new = [vars.ext_name, vars.ext_name, vars.ext_name];
+            this.writeFile(manifestPath, this.replaceAll(man_vars, man_new, man_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+        var rdf_path = this.getPath('install.rdf');
+        if(this.os.path.exists(rdf_path)) {
+            var rdf_str = this.readFile(rdf_path);
+            var rdf_vars = this.getRdfVars(rdf_str);
+            this.writeFile(rdf_path, this.replaceAll(rdf_vars, vars, rdf_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+    } catch(e) {
+        this.error = e;
+        return false;
+    }
+    return true;
+}
+
+extensionLib.prototype.replaceAll = function(orig_vars, new_vars, str) {
+    try {
+        var out = str;
+        for(v in orig_vars) {
+            out = out.replace(orig_vars[v], new_vars[v]);
+        }
+        return out;
+    } catch(e) {
+        alert(e);
+    }
+}
+
+extensionLib.prototype.getNiceName = function(name) {
+    return this.trim(name).replace(/[\W]/g,'').toLowerCase();
+}
+
+extensionLib.prototype.trim = function(str) {
+    return str.replace(/^\s*/, '').replace(/\s*$/, '');
+}
+
+extensionLib.prototype.clone = function(obj) {
+    var newobj = {}; for(i in obj) {
+        newobj[i] = obj[i];
+    } return newobj;
+}
+
+extensionLib.prototype._dump = function(obj) {
+    var str = ''; for(i in obj) {
+        str += i+': '+obj[i]+'\n';
+    } return(str);
+}
+
+extensionLib.prototype._keys = function(obj) {
+  var out = new Array(); for(i in obj) {
+    out.push(i);
+  } return out;
+}
+
+} catch(e) {
+    allert(e);
+}
+</macro>
+<file id="ce09e80e-4f8e-784c-81c1-6564f46e2cf8" idref="f5feb14c-33f6-a44d-ad41-ab38bf630926" name="setup.xul" url="_prj_internal_/setup.xul">
+</file>
+<file id="1d542d8f-6043-4618-85b2-750f688afb86" idref="fd57ad7e-32b5-46a5-8b5a-36f513b953ad" name="setup.xul" url="_prj_internal_/setup.xul">
+</file>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/wrench.png" id="45c63c14-27f6-4b60-b387-43ea4946597f" idref="fd57ad7e-32b5-46a5-8b5a-36f513b953ad" keyboard_shortcut="" language="JavaScript" name="Configure" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+try {
+
+var libPart = ko.projects.findPart('macro', 'extension_lib', 'container');
+eval(libPart.value);
+
+var koExt = new extensionLib();
+
+var project = ko.macros.current.project;
+
+var setupWin = project.getChildByAttributeValue('name','setup.xul', 1);
+var rdf = project.getChildByAttributeValue('name','install.rdf', 1);
+var data = {};
+
+var prefset = project.prefset;
+
+if(prefset.hasPrefHere('configured')) {
+    var rdf_xml = koExt.readFile(rdf.getFile().URI);
+    data = {
+        'valid': false,
+        'configured': true,
+        'vars': koExt.getRdfVars(rdf_xml)
+    };
+    data.vars['ext_name'] = koExt.getNiceName(data.vars.name);
+} else { // init data
+    data = {
+        'valid': false,
+        'configured': false,
+        'vars': {
+            'id': '',
+            'name': 'My Extension',
+            'creator': 'Me',
+            'version': '0.1',
+            'description': '',
+            'homepageURL': '',
+            'ext_name': ''
+        }
+    };
+}
+
+window.openDialog(
+    setupWin.getFile().URI,
+    "_blank",
+    "centerscreen,chrome,resizable,scrollbars,dialog=no,close,modal=yes",
+    data
+);
+
+if(data.valid) {
+    if(koExt.updateProject(data.vars)) {
+        prefset.setBooleanPref('configured', true);
+        var part = project.getChildByAttributeValue('name', 'oncreate',1);
+        if(part) { part.name = 'Configure'; }
+        var msg = 'Extension Project '+data.vars.name+' configured!';
+        ko.statusBar.AddMessage(msg, 'project', 3000, true);
+        ko.projects.manager.saveProject(project);
+    } else {
+        alert('Error encountered: '+koExt.error+"\nConfiguration aborted.");
+    }
+}
+
+} catch(e) {
+    alert(e);
+}
+</macro>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/lightning_go.png" id="4b74a155-8acd-4a55-97e9-f193ab92dc4a" idref="fd57ad7e-32b5-46a5-8b5a-36f513b953ad" keyboard_shortcut="" language="JavaScript" name="Build" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+/**
+ * Script to build an xpi, running koext build in the current project root.
+ */
+
+var project = ko.macros.current.project;
+
+var os = Components.classes['@activestate.com/koOs;1'].
+  getService(Components.interfaces.koIOs);
+
+var koSysUtils = Components.classes["@activestate.com/koSysUtils;1"].
+  getService(Components.interfaces.koISysUtils);
+
+var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
+  getService(Components.interfaces.nsIXULRuntime);
+
+var koDirs = Components.classes['@activestate.com/koDirs;1'].
+  getService(Components.interfaces.koIDirs);
+
+var pythonExe = koDirs.pythonExe;
+var projectDir = ko.interpolate.interpolateStrings('%p');
+var scriptName = 'koext';
+
+if (appInfo.OS == 'WINNT') {
+  scriptName += ".py"; 
+}
+
+var arr = [koDirs.sdkDir, 'bin', scriptName]
+var app = os.path.joinlist(arr.length, arr);
+var cmd = '"'+pythonExe+'" "'+app+'" build -d "'+projectDir+'"';
+
+if (appInfo.OS == 'WINNT') {
+  cmd = '"' + cmd + '"';
+}
+var cwd = koDirs.mozBinDir;
+cmd += " {'cwd': u'"+cwd+"'}";
+
+ko.run.runEncodedCommand(window, cmd, function() {
+  ko.statusBar.AddMessage('Build complete', 'projects', 5000, true);
+  ko.projects.manager.saveProject(project);
+});
+</macro>
+<macro async="0" icon="chrome://famfamfamsilk/skin/icons/brick.png" id="a2c99057-bcb3-43d5-8284-66628a53eadb" idref="fd57ad7e-32b5-46a5-8b5a-36f513b953ad" keyboard_shortcut="" language="JavaScript" name="extension_lib" rank="100" trigger="trigger_postopen" trigger_enabled="0">
+try {
+    
+var extensionLib = function() {
+    this.os = Components.classes['@activestate.com/koOs;1'].
+        getService(Components.interfaces.koIOs);
+    this.error = false;
+}
+
+extensionLib.prototype.getPath = function(relative) {
+    try {
+        var prj_path = ko.interpolate.interpolateStrings('%p');
+        path = this.os.path.join(prj_path, relative);
+        return path;
+    } catch(e) {
+        alert(e+"\narg name: "+name);
+    }
+}
+
+extensionLib.prototype.readFile = function(filename) {
+    // read the template file
+    try {
+        var fileEx = Components.classes["@activestate.com/koFileEx;1"]
+                .createInstance(Components.interfaces.koIFileEx);
+        fileEx.URI = filename;
+        fileEx.open('rb');
+        var content = fileEx.readfile();
+        fileEx.close();
+        return content;
+    } catch(e) {
+        alert(e+"\narg filename: "+filename);
+    }
+}
+
+extensionLib.prototype.writeFile = function(filename, content) {
+    try {
+        var fileEx = Components.classes["@activestate.com/koFileEx;1"]
+                .createInstance(Components.interfaces.koIFileEx);
+        fileEx.URI = filename;
+        fileEx.open('wb+');
+        fileEx.puts(content);
+        fileEx.close();
+    } catch(e) {
+        alert(e+"\narg filename: "+filename);
+    }
+}
+
+extensionLib.prototype.getRdfVars = function(txt) {
+    try {
+        var Rx = /\&lt;em\:([\w]+)[\ \S]*\&gt;([\S\ ]+?)\&lt;\//g;
+        var ext_vars = {};
+        while(results = Rx.exec(txt)) {
+            var idRx = /type|min|max|\{/;
+            if(!idRx.test(results[0])) { // filter out stuff we don't want
+                ext_vars[results[1]] = results[2];
+            }
+        }
+        return ext_vars;
+    } catch(e) {
+        alert(e+"\narg rdf_path: "+rdf_path);
+    }
+}
+
+extensionLib.prototype.getManifestVars = function(txt) {
+    try {
+        var rx1 = /content ([\S]+?) jar\:([\S]+?)\.jar/g;
+        var res1 = rx1.exec(txt);
+        var rx2 = /chrome:\/\/([\S]+?)\/content\/overlay\.xul/g;
+        var res2 = rx2.exec(txt);
+        return new Array(res1[1], res1[2], res2[1]);
+    } catch(e) {
+        alert(e+"\narg path: "+path);
+    }
+}
+
+extensionLib.prototype.getOverlayVars = function(txt) {
+    try {
+        var rx1 = /&lt;overlay id="([\S]+?)"/g;
+        var res1 = rx1.exec(txt);
+        var rx2 = /&lt;menuitem id="([\S]+?)"[\s]+?label="([\S\ ]+?)"/g;
+        var res2 = rx2.exec(txt);
+        return [res1[1], res2[1], res2[2]];
+    } catch(e) {
+        alert(e+"\narg path: "+path);
+    }
+}
+
+extensionLib.prototype.updateProject = function(vars) {
+    try {
+        var overlayPath = this.getPath('content/overlay.xul');
+        if(this.os.path.exists(overlayPath)) {
+            var ovl_str = this.readFile(overlayPath);
+            var ov_vars = this.getOverlayVars(ovl_str);
+            var ovl_new = [vars.ext_name+'Overlay', 'menu_'+vars.ext_name, vars.name];
+            this.writeFile(overlayPath, this.replaceAll(ov_vars, ovl_new, ovl_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+        var manifestPath = this.getPath('chrome.manifest');
+        if(this.os.path.exists(manifestPath)) {
+            var man_str = this.readFile(manifestPath);
+            var man_vars = this.getManifestVars(man_str);
+            var man_new = [vars.ext_name, vars.ext_name, vars.ext_name];
+            this.writeFile(manifestPath, this.replaceAll(man_vars, man_new, man_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+        var rdf_path = this.getPath('install.rdf');
+        if(this.os.path.exists(rdf_path)) {
+            var rdf_str = this.readFile(rdf_path);
+            var rdf_vars = this.getRdfVars(rdf_str);
+            this.writeFile(rdf_path, this.replaceAll(rdf_vars, vars, rdf_str));
+        } else { this.error = "Doesn't exist: "+overlayPath; return false; }
+        
+    } catch(e) {
+        this.error = e;
+        return false;
+    }
+    return true;
+}
+
+extensionLib.prototype.replaceAll = function(orig_vars, new_vars, str) {
+    try {
+        var out = str;
+        for(v in orig_vars) {
+            out = out.replace(orig_vars[v], new_vars[v]);
+        }
+        return out;
+    } catch(e) {
+        alert(e);
+    }
+}
+
+extensionLib.prototype.getNiceName = function(name) {
+    return this.trim(name).replace(/[\W]/g,'').toLowerCase();
+}
+
+extensionLib.prototype.trim = function(str) {
+    return str.replace(/^\s*/, '').replace(/\s*$/, '');
+}
+
+extensionLib.prototype.clone = function(obj) {
+    var newobj = {}; for(i in obj) {
+        newobj[i] = obj[i];
+    } return newobj;
+}
+
+extensionLib.prototype._dump = function(obj) {
+    var str = ''; for(i in obj) {
+        str += i+': '+obj[i]+'\n';
+    } return(str);
+}
+
+extensionLib.prototype._keys = function(obj) {
+  var out = new Array(); for(i in obj) {
+    out.push(i);
+  } return out;
+}
+
+} catch(e) {
+    allert(e);
+}
+</macro>
+<preference-set idref="6200c0ed-45ec-4f46-a159-284803d65c04">
+  <boolean id="configured">1</boolean>
+  <string id="import_exclude_matches">*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;*%*;tmp*.html;.DS_Store;_prj_internal_</string>
+  <string id="import_include_matches"></string>
+  <boolean id="import_live">1</boolean>
+  <boolean id="import_recursive">1</boolean>
+  <string id="import_type">useFolders</string>
+</preference-set>
+<preference-set idref="6200c0ed-45ec-4f46-a159-284803d65c04/content/js/rinterpolationquery.js">
+  <string id="spellcheckLangID">en-US</string>
+</preference-set>
+</project>

Added: komodo/SciViews-K/components/Conscript
===================================================================
--- komodo/SciViews-K/components/Conscript	                        (rev 0)
+++ komodo/SciViews-K/components/Conscript	2010-10-31 16:58:58 UTC (rev 338)
@@ -0,0 +1,53 @@
+#!/usr/local/bin/perl
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+# 
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.1 (the "License"); you may not use this file except in
+# compliance with the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+# 
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+# License for the specific language governing rights and limitations
+# under the License.
+# 
+# The Original Code is SciViews code.
+# 
+# The Initial Developer of the Original Code is ActiveState Software Inc.
+# Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
+# ActiveState Software Inc. All Rights Reserved.
+# 
+# Contributor(s):
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/sciviews -r 338


More information about the Sciviews-commits mailing list