[1.1.0] Jython-2.7-rc3: Subclassing Region: with __init__ the java level constructors not used with super()__init__(), leaving Region "empty" --- workaround
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Confirmed
|
High
|
RaiMan |
Bug Description
********* workaround
setup a subclass of Region this way:
class MyRegion(Region):
def __init__(self, x=1, y=1, w=1, h=1):
-------
Installed nightly sikulixsetup-
Here is the simple code:
# begin code =======
import org.sikuli.
from sikuli import *
def highlight_
if rejun != None:
for i in range(cycles):
class SLRegion(Region):
def __init__(self, x=1, y=1, w=1, h=1):
rejun = Region(
highlight_
rejun = SLRegion(
highlight_
# =======
The first call to highlight_
The second call fails with Null Pointer...
# begin Sikuli_IDE Log Message Window Output ==============
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[0,0 0x0]@Screen null E:Y, T:3.0 for 1.0 secs
[error] script [ deletelater ] stopped with error in line 18
[error] java.lang.
[error] --- Traceback --- error source first line: module ( function ) statement 7: main ( highlight_flash ) rejun.highlight
[error] --- Traceback --- end --------------
# end Sikuli_IDE Log Message Window Output ==============
and here is what it tells me when I run the same code in Eclipse...
# begin Eclipse Luna Error Output ==============
console: Failed to install '': java.nio.
pydev debugger: starting (pid: 10232)
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[100,100 100x100]@S(0)[0,0 1280x1024] E:Y, T:3.0 for 1.0 secs
[log] highlight R[0,0 0x0]@Screen null E:Y, T:3.0 for 1.0 secs
Traceback (most recent call last):
File "C:\usrbin\
globals = debugger.
File "C:\usrbin\
pydev_
File "C:\sl\
highlight_
File "C:\sl\
rejun.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
java.lang.
# end Eclipse Luna Error Output ==============
Changed in sikuli: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → 1.1.0 |