[request] improvement for run command

Bug #1076372 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

In GUI mode the run(command) should show the console window.

In CLI mode the run(command) could optionally show the console window.

Either way, it should check the exit code and either return it or fail.

Without such improvement, it's just like submodule.call()

Tags: fkt-run
Revision history for this message
RaiMan (raimund-hocke) wrote :

based on https://github.com/sikuli/sikuli/issues/21

actually the run() command is implemented using java.lang.Runtime.getRuntime().exec(command string) and it returns the command output as a list of lines.
This is comparable to an implementation on the Jython level using os.popen() (or subprocess.popen() better).

In both cases these commands are run in a separate process and do not have a console window at all (just sysin, sysout and syserr).

Nevertheless: I have it on my list to improve it. And to optionally show the command output in a window seems to be a good idea.

Changed in sikuli:
status: New → In Progress
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → x1.0
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: x1.0 → none
tags: added: fit-run
tags: added: fkt-run
removed: fit-run
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Wishlist
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Wishlist → High
milestone: none → x1.1
Revision history for this message
eptgrant (ept-grant) wrote :

Hello,

I've made an alternative Run() method recently and I thought i'd share it.

I initially needed a different method as Sikuli was hanging when I was executing remote commands (psexec, winrs etc), as the external program would fail, and send the result back through the error pipe (which the old method wasn't handling).

Feel free to use it as you like.

Grant.

Revision history for this message
RaiMan (raimund-hocke) wrote :

Thanks for contribution.

I already fixed this with version 1.0.1, since I needed it myself internally ;-)

The run() now handles parameters with enclosing apostrophes correctly, as well as the usage of \<space> and returns:

<stdout line1>
<stdout line2>
<stdout line3>
...
*** error ***
<stderr line1>
<stderr line1>
<stderr line1>
...
<stderr exception message>

the error part is only appended if the err pipe has some content or the command execution forces an exception.

RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → 1.2.0
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 2.0.0 → 2.1.0
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.