← Back to team overview

sikuli-driver team mailing list archive

[Bug 966536] Re: Sikuli can't find a match on a second screen/monitor when calling a function in an included module

 

** Tags removed: multimonitor
** Tags added: fkt-region

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/966536

Title:
  Sikuli can't find a match on a second screen/monitor when calling a
  function in an included module

Status in Sikuli:
  In Progress

Bug description:
  Sikuli-X 1.0rc2
  Windows 7 Ultimate 64 bit.

  Sikuli can't find a match on a second screen/monitor when calling a
  function in an included module.

  I have a couple functions:
  from sikuli.Sikuli import *

  myScriptPath = "D:\\ICProjects\\sikuli\\testPOS.sikuli"
  if not myScriptPath in sys.path:
  	sys.path.append(myScriptPath)

  scr1 = Screen(0)

  def initScreen(nScreen):
  	global scr1
  	scr1 = Screen(nScreen)
  	return scr1

  def showSelectedScreen():
  	global scr1
  	scr1.highlight()

  def ShowInfo():
  	global scr1
  	scr1.click(IMG)

  They all work and find the IMG on the second monitor when they are
  called in the local script.

  However when I try to call them from a master script that includes
  them it won't find the image. It will still show the same highlight on
  the second screen though. (On my system screen 0 highlights the second
  monitor, but I did try 1 as well)

  from sikuli.Sikuli import *
  #import os

  myScriptPath = "D:\\ICProjects\\sikuli\\testML.sikuli"
  if not myScriptPath in sys.path:
  	sys.path.append(myScriptPath)

  import testPOS
  reload(sys.modules["testPOS"])

  scrML = testPOS.initScreen(0)
  testPOS.showSelectedScreen()
  testPOS.ShowInfo()

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/966536/+subscriptions


References