[Sciviews-commits] r357 - in komodo/SciViews-K-dev: . .komodotools/Project components content content/js content/js/tools defaults pylib skin skin/images
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 28 22:12:50 CET 2011
Author: prezez
Date: 2011-02-28 22:12:49 +0100 (Mon, 28 Feb 2011)
New Revision: 357
Added:
komodo/SciViews-K-dev/.komodotools/Project/R_2-way_communication_test.komodotool
komodo/SciViews-K-dev/.komodotools/Project/R_test_for_connection_with_R.komodotool
komodo/SciViews-K-dev/.komodotools/Project/R_toggle_status.komodotool
komodo/SciViews-K-dev/.komodotools/Project/Restart_Komodo.komodotool
komodo/SciViews-K-dev/.komodotools/Project/Smart_highlight.komodotool
komodo/SciViews-K-dev/.komodotools/Project/Test_R_completion.komodotool
komodo/SciViews-K-dev/.komodotools/Project/restartSocketServer.komodotool
komodo/SciViews-K-dev/.komodotools/Project/startSocketServer.komodotool
komodo/SciViews-K-dev/.komodotools/Project/stopSocketServer.komodotool
komodo/SciViews-K-dev/SciViews-K (dev).komodoproject
komodo/SciViews-K-dev/content/js/rconnection.js
komodo/SciViews-K-dev/defaults/svMisc_0.9-61.tar.gz
komodo/SciViews-K-dev/defaults/svMisc_0.9-61.zip
komodo/SciViews-K-dev/defaults/svSocket_0.9-48.tar.gz
komodo/SciViews-K-dev/defaults/svSocket_0.9-48.zip
komodo/SciViews-K-dev/skin/images/R2.png
komodo/SciViews-K-dev/skin/images/book.png
komodo/SciViews-K-dev/skin/images/book_edit.png
komodo/SciViews-K-dev/skin/images/page_find.png
komodo/SciViews-K-dev/skin/images/page_white_find.png
komodo/SciViews-K-dev/skin/images/run_all_disabled.png
komodo/SciViews-K-dev/skin/images/run_block_disabled.png
komodo/SciViews-K-dev/skin/images/run_enter_disabled.png
komodo/SciViews-K-dev/skin/images/run_function_disabled.png
komodo/SciViews-K-dev/skin/images/run_line_begin_disabled.png
komodo/SciViews-K-dev/skin/images/run_line_disabled.png
komodo/SciViews-K-dev/skin/images/run_line_end_disabled.png
komodo/SciViews-K-dev/skin/images/run_line_endpage_disabled.png
komodo/SciViews-K-dev/skin/images/run_para_disabled.png
komodo/SciViews-K-dev/skin/images/run_sel_disabled.png
komodo/SciViews-K-dev/skin/images/source_block_disabled.png
komodo/SciViews-K-dev/skin/images/source_disabled.png
komodo/SciViews-K-dev/skin/images/source_function_disabled.png
komodo/SciViews-K-dev/skin/images/source_para_disabled.png
komodo/SciViews-K-dev/skin/images/source_sel_disabled.png
komodo/SciViews-K-dev/skin/images/world_link.png
Removed:
komodo/SciViews-K-dev/.DS_Store
komodo/SciViews-K-dev/SciViews-K.komodoproject
komodo/SciViews-K-dev/SciViews-K.kpf
komodo/SciViews-K-dev/_prj_internal_/
komodo/SciViews-K-dev/components/Conscript
komodo/SciViews-K-dev/components/svIRinterpreter.idl
komodo/SciViews-K-dev/components/svRinterpreter.js
komodo/SciViews-K-dev/content/.DS_Store
komodo/SciViews-K-dev/content/js/r_new.js
komodo/SciViews-K-dev/content/js/socket.js
komodo/SciViews-K-dev/content/js/tools/e4x2dom.js
komodo/SciViews-K-dev/defaults/.DS_Store
komodo/SciViews-K-dev/defaults/ANNOUNCE
komodo/SciViews-K-dev/defaults/NEWS
komodo/SciViews-K-dev/defaults/R reference (0.9.20).kpz
komodo/SciViews-K-dev/defaults/R.bat
komodo/SciViews-K-dev/defaults/README
komodo/SciViews-K-dev/defaults/Rgui.bat
komodo/SciViews-K-dev/defaults/SciViews-K (0.9.20).kpz
komodo/SciViews-K-dev/defaults/SciViews_0.9-2.tar.gz
komodo/SciViews-K-dev/defaults/SciViews_0.9-2.zip
komodo/SciViews-K-dev/defaults/codetools_0.2-2.tar.gz
komodo/SciViews-K-dev/defaults/codetools_0.2-2.zip
komodo/SciViews-K-dev/defaults/ellipse_0.3-5.tar.gz
komodo/SciViews-K-dev/defaults/ellipse_0.3-5.zip
komodo/SciViews-K-dev/defaults/svGUI_0.9-50.tar.gz
komodo/SciViews-K-dev/defaults/svGUI_0.9-50.zip
komodo/SciViews-K-dev/defaults/svMisc_0.9-60.tar.gz
komodo/SciViews-K-dev/defaults/svMisc_0.9-60.zip
komodo/SciViews-K-dev/defaults/svSocket_0.9-51.tar.gz
komodo/SciViews-K-dev/defaults/svSocket_0.9-51.zip
komodo/SciViews-K-dev/defaults/svTools_0.9-1.tar.gz
komodo/SciViews-K-dev/defaults/svTools_0.9-1.zip
komodo/SciViews-K-dev/pylib/.DS_Store
komodo/SciViews-K-dev/sciviewsk-0.10.dev-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.0-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.1-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.10-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.11-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.12-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.15-slim-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.16-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.2-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.3-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.4-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.5-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.6-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.7-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.8-ko.xpi
komodo/SciViews-K-dev/sciviewsk-0.9.9-ko.xpi
komodo/SciViews-K-dev/skin/.DS_Store
komodo/SciViews-K-dev/skin/icons/
komodo/SciViews-K-dev/skin/images/.DS_Store
komodo/SciViews-K-dev/skin/images/body_bg_sav.gif
Modified:
komodo/SciViews-K-dev/components/koRLinter.py
komodo/SciViews-K-dev/components/koR_UDL_Language.py
komodo/SciViews-K-dev/components/svIUtils.idl
komodo/SciViews-K-dev/components/svUtils.py
komodo/SciViews-K-dev/content/RHelpWindow.xul
komodo/SciViews-K-dev/content/RObjectsOverlay.xul
komodo/SciViews-K-dev/content/default-keybindings.kkf
komodo/SciViews-K-dev/content/js/ask.js
komodo/SciViews-K-dev/content/js/commands.js
komodo/SciViews-K-dev/content/js/misc.js
komodo/SciViews-K-dev/content/js/pref-R.js
komodo/SciViews-K-dev/content/js/prefs.js
komodo/SciViews-K-dev/content/js/r.js
komodo/SciViews-K-dev/content/js/rconsole.js
komodo/SciViews-K-dev/content/js/rinterpolationquery.js
komodo/SciViews-K-dev/content/js/robjects.js
komodo/SciViews-K-dev/content/js/sciviews.js
komodo/SciViews-K-dev/content/js/tools/array.js
komodo/SciViews-K-dev/content/js/tools/file.js
komodo/SciViews-K-dev/content/js/tools/strings.js
komodo/SciViews-K-dev/content/overlayMain.xul
komodo/SciViews-K-dev/content/pref-R.xul
komodo/SciViews-K-dev/content/sessions.xul
komodo/SciViews-K-dev/defaults/.Rprofile
komodo/SciViews-K-dev/defaults/svStart.R
komodo/SciViews-K-dev/install.rdf
komodo/SciViews-K-dev/pylib/lang_r.py
Log:
A huge dump of changes for Sciviews-k-dev (experimental):
* svUtils: XPCOM component with methods for socket communication between R an Komodo (client/server), added methods for displaying calltips and autocompletion - but these do not make a proper use of codeintel mechanism...
* KoRLinter.py rewritten from scratch - uses svUtils and simple parsing (gives only the first syntax error, but it is fast.
`quick.lint` helper function is defined in svStart.R)
* R object browser - smart refresh, preserves open/closed branches (almost invisibly for the user)
* svStart.R - tries to find a free port on startup and notify Komodo about the result (note that server in Komodo does the same)
* sv.pref.(set|get)Pref replaces sv.prefs. Type of value is detected invisibly. (all files using sv.prefs were modified)
* sv.command - modified mechanism of starting R (still buggy, works fine with Rgui only, due to the limitations of koRunService)
* removed some old and unnecessary files
* use svSocket 0.9-48 due to the bug in later versions (output printing)
Note: functions' descriptions in the files are not yet updated.
Deleted: komodo/SciViews-K-dev/.DS_Store
===================================================================
(Binary files differ)
Added: komodo/SciViews-K-dev/.komodotools/Project/R_2-way_communication_test.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/R_2-way_communication_test.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/R_2-way_communication_test.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,19 @@
+{
+ "keyboard_shortcut": "",
+ "name": "R: 2-way communication test",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "sv.cmdout.clear();",
+ "sv.cmdout.append(sv.rconn.evalAtOnce(\"cat('R<-Komodo : OK', '\\n')\").trim());",
+ "sv.rconn.eval(\"cat(koCmd('\\\"R->Komodo : OK\\\"', type='j'))\", function(res) {",
+ "\tsv.cmdout.append(res.trim());",
+ "}, \"h\");"
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/disconnect.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/R_test_for_connection_with_R.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/R_test_for_connection_with_R.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/R_test_for_connection_with_R.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,22 @@
+{
+ "keyboard_shortcut": "",
+ "name": "R: test for connection with R",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "var RConnectionSuccess = sv.rconn.testRAvailability();",
+ "sv.command.updateRStatus(RConnectionSuccess);",
+ "",
+ "var ltb = document.getElementById(\"leftTabBox\");",
+ "var rotp = document.getElementById(\"sciviews_robjects_tabpanel\");",
+ "var rot = document.getElementById(\"sciviews_robjects_tab\");",
+ "rotp.disabled = rot.disabled = !RConnectionSuccess;",
+ ""
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/connect.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/R_toggle_status.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/R_toggle_status.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/R_toggle_status.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,15 @@
+{
+ "keyboard_shortcut": "",
+ "name": "R: toggle status",
+ "language": "JavaScript",
+ "trigger_enabled": 0,
+ "rank": 100,
+ "trigger": "trigger_postopen",
+ "value": [
+ "sv.command.updateRStatus()"
+ ],
+ "version": "1.0.7",
+ "async": 0,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/bug_go.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/Restart_Komodo.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/Restart_Komodo.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/Restart_Komodo.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,35 @@
+{
+ "keyboard_shortcut": "",
+ "name": "Restart Komodo",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "const Cc = Components.classes;",
+ "const Ci = Components.interfaces;",
+ "",
+ "function restartApp() {",
+ " // Notify all windows that an application quit has been requested.",
+ " var os = Cc[\"@mozilla.org/observer-service;1\"].",
+ " getService(Ci.nsIObserverService);",
+ " var cancelQuit = Cc[\"@mozilla.org/supports-PRBool;1\"].",
+ " createInstance(Ci.nsISupportsPRBool);",
+ " os.notifyObservers(cancelQuit, \"quit-application-requested\", null);",
+ "",
+ " // Something aborted the quit process.",
+ " if (cancelQuit.data)",
+ " return;",
+ "",
+ " var as = Cc[\"@mozilla.org/toolkit/app-startup;1\"].",
+ " getService(Ci.nsIAppStartup);",
+ " as.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);",
+ "}",
+ "",
+ "restartApp();"
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/application_lightning.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/Smart_highlight.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/Smart_highlight.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/Smart_highlight.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,27 @@
+{
+ "keyboard_shortcut": "Ctrl+1",
+ "name": "Smart highlight",
+ "language": "JavaScript",
+ "trigger_enabled": 0,
+ "rank": 100,
+ "trigger": "trigger_postopen",
+ "value": [
+ "var findSvc = Components.classes[\"@activestate.com/koFindService;1\"]",
+ " .getService(Components.interfaces.koIFindService);",
+ "",
+ "findSvc.options.patternType = findSvc.options.FOT_SIMPLE;",
+ "",
+ "var context = Components.classes[\"@activestate.com/koFindContext;1\"]",
+ " .createInstance(Components.interfaces.koIFindContext);",
+ "context.type = context.FCT_CURRENT_DOC;",
+ "",
+ "findSvc.options.matchWord = true;",
+ "findSvc.options.displayInFindResults2 = true;",
+ "Find_FindAll(self, context, ko.interpolate.getWordUnderCursor(), null,",
+ "\t\t\t function() {});"
+ ],
+ "version": "1.0.7",
+ "async": 1,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/rainbow.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/Test_R_completion.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/Test_R_completion.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/Test_R_completion.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,20 @@
+{
+ "keyboard_shortcut": "",
+ "name": "Test: R completion",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "var svuSvc = Components.classes[\"@sciviews.org/svUtils;1\"].getService(Components.interfaces.svIUtils);",
+ "try {",
+ " svuSvc.complete(\"\")",
+ "} catch(e) {",
+ " sv.cmdout.append(e)",
+ "}"
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/bug.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/restartSocketServer.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/restartSocketServer.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/restartSocketServer.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,16 @@
+{
+ "keyboard_shortcut": "",
+ "name": "restartSocketServer",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "sv.rconn.restartSocketServer();",
+ ""
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/server_lightning.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/startSocketServer.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/startSocketServer.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/startSocketServer.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,16 @@
+{
+ "keyboard_shortcut": "",
+ "name": "startSocketServer",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "sv.cmdout.append(sv.rconn.startSocketServer());",
+ ""
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/server_go.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/.komodotools/Project/stopSocketServer.komodotool
===================================================================
--- komodo/SciViews-K-dev/.komodotools/Project/stopSocketServer.komodotool (rev 0)
+++ komodo/SciViews-K-dev/.komodotools/Project/stopSocketServer.komodotool 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,15 @@
+{
+ "keyboard_shortcut": "",
+ "name": "stopSocketServer",
+ "language": "JavaScript",
+ "trigger_enabled": false,
+ "value": [
+ "sv.rconn.stopSocketServer();"
+ ],
+ "trigger": "trigger_postopen",
+ "rank": 100,
+ "version": "1.0.7",
+ "async": false,
+ "type": "macro",
+ "icon": "chrome://famfamfamsilk/skin/icons/server_delete.png"
+}
\ No newline at end of file
Added: komodo/SciViews-K-dev/SciViews-K (dev).komodoproject
===================================================================
--- komodo/SciViews-K-dev/SciViews-K (dev).komodoproject (rev 0)
+++ komodo/SciViews-K-dev/SciViews-K (dev).komodoproject 2011-02-28 21:12:49 UTC (rev 357)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Komodo Project File - DO NOT EDIT -->
+<project id="3fe41e8b-7f5d-46b8-87bd-f6688d707fbd" kpf_version="5" name="SciViews-K (dev).komodoproject">
+</project>
Deleted: komodo/SciViews-K-dev/SciViews-K.komodoproject
===================================================================
--- komodo/SciViews-K-dev/SciViews-K.komodoproject 2011-02-28 11:58:01 UTC (rev 356)
+++ komodo/SciViews-K-dev/SciViews-K.komodoproject 2011-02-28 21:12:49 UTC (rev 357)
@@ -1,557 +0,0 @@
-<?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 = /\<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);
-}
-</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 = /\<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);
-}
-</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>
Deleted: komodo/SciViews-K-dev/SciViews-K.kpf
===================================================================
--- komodo/SciViews-K-dev/SciViews-K.kpf 2011-02-28 11:58:01 UTC (rev 356)
+++ komodo/SciViews-K-dev/SciViews-K.kpf 2011-02-28 21:12:49 UTC (rev 357)
@@ -1,824 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Komodo Project File - DO NOT EDIT -->
-<project id="6200c0ed-45ec-4f46-a159-284803d65c04" kpf_version="4" name="SciViews-K.kpf">
-<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>
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/sciviews -r 357
More information about the Sciviews-commits
mailing list