← Back to team overview

sikuli-driver team mailing list archive

[Question #214125]: Last part of script not running when called from another script.

 

New question #214125 on Sikuli:
https://answers.launchpad.net/sikuli/+question/214125

I have 2 scripts I have written and both contain functions.

the first script contains a function called create_calendar_entry()

i am calling that function in another script called ts_expanded_functions().

if i run the script with create_calendar_entry() it runs perfect and the very end of that script contains this:

   assert exists(Pattern("Meeting.png").similar(0.97))
   wait(.5)
   type(Key.F4, KeyModifier.CTRL)

basically after it asserts an image is in the dialog window, it says to close the window with Ctrl F4 and it works perfectly on its own.


as soon as i go to my other script  ts_expanded_functions() and put in:

CreateCalendarEntry.create_calendar_entry() where i want to call it and run that script, my dialog from the CreateCalendarEntry.create_calendar_entry() is left open when it should have closed.


it makes no sense, its like its ignoring the very end of that function.

if i comment out type(Key.F4, KeyModifier.CTRL) with #type(Key.F4, KeyModifier.CTRL) in CreateCalendarEntry.create_calendar_entry() and then go to ts_expanded_functions() and add that same line like this:


def ts_expanded_functions():
    CreateCalendarEntry.create_calendar_entry() 
    wait(.5)
    type(Key.F4, KeyModifier.CTRL)



it works fine.


any ideas as to why the close command will not work at the end of a called function but work in the main  function i am running?


thanks in advance

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.