[sikuli] 217/385: hope it merges

Gilles Filippini pini at moszumanska.debian.org
Sun Jun 29 19:26:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.

commit 7a5cf33bc8b515a98b642c71116dffe6bb1e98e3
Author: Raimund Hocke <info at its-me-raiman.de>
Date:   Mon Feb 17 17:52:12 2014 +0100

    hope it merges
---
 IDE/src/main/java/org/sikuli/ide/SikuliIDE.java | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
index 8412f62..d1f525c 100755
--- a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
+++ b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
@@ -1955,7 +1955,7 @@ public class SikuliIDE extends JFrame {
 				public void run() {
 					EditorPane codePane = SikuliIDE.getInstance().getCurrentCodePane();
 					File tmpFile;
-					tmpFile = FileManager.createTempFile("py");
+					tmpFile = FileManager.createTempFile(Settings.EndingTypes.get(codePane.getSikuliContentType()));
 					if (tmpFile == null) {
 						return;
 					}
@@ -1968,7 +1968,7 @@ public class SikuliIDE extends JFrame {
 						//SikuliIDE.getInstance().setVisible(false);
 						_console.clear();
 						resetErrorMark();
-						runPython(tmpFile);
+						runScript(tmpFile, codePane);
 					} catch (Exception e) {
 					} finally {
 						SikuliIDE.getInstance().setIsRunningScript(false);
@@ -1981,19 +1981,23 @@ public class SikuliIDE extends JFrame {
 			_runningThread.start();
 		}
 
-		protected void runPython(File f) throws Exception {
+		private void runScript(File sfile, EditorPane pane) throws Exception {
 			File path = new File(SikuliIDE.getInstance().getCurrentBundlePath());
 			File parent = path.getParentFile();
 			//TODO implement alternative script types
-			IScriptRunner srunner = SikuliX.getScriptRunner("jython", null, Settings.getArgs());
+			String runnerType = null;
+			String cType = pane.getContentType();
+			runnerType = cType.equals(Settings.CPYTHON) ? Settings.RPYTHON : Settings.RRUBY;
+			IScriptRunner srunner = SikuliX.getScriptRunner(
+							runnerType, null, Settings.getArgs());
 			if (srunner == null) {
-				Debug.error("Could not load the Jython script runner");
+				Debug.error("Could not load a script runner for: %s (%s)", cType, runnerType);
 				return;
 			}
-			addPythonCode(srunner);
+			addScriptCode(srunner);
 			try {
 				ImagePath.resetBundlePath(path.getAbsolutePath());
-				int ret = srunner.runScript(f, path,
+				int ret = srunner.runScript(sfile, path,
 								Settings.getArgs(),
 								new String[]{parent.getAbsolutePath(),
 									_mainPane.getTitleAt(_mainPane.getSelectedIndex())});
@@ -2005,7 +2009,7 @@ public class SikuliIDE extends JFrame {
 			}
 		}
 
-		protected void addPythonCode(IScriptRunner srunner) {
+		protected void addScriptCode(IScriptRunner srunner) {
 		}
 
 		public void stopRunning() {
@@ -2055,7 +2059,7 @@ public class SikuliIDE extends JFrame {
 		}
 
 		@Override
-		protected void addPythonCode(IScriptRunner srunner) {
+		protected void addScriptCode(IScriptRunner srunner) {
 			srunner.execBefore(null);
 			srunner.execBefore(new String[]{"setShowActions(True)"});
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git



More information about the pkg-java-commits mailing list