Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sikuli Fix #463,#468 #472

Merged
merged 3 commits into from
May 2, 2019
Merged

Sikuli Fix #463,#468 #472

merged 3 commits into from
May 2, 2019

Conversation

seekM
Copy link
Contributor

@seekM seekM commented Apr 26, 2019

Fix #463 by reloading sikuli.py and #468 whose root cause was that the grammar for controlling Sikuli was overriden instead of extended. In the process of the fix I restructured sikuli.py a bit. What's not so elegant is that when a profile change occurs the old grammar isn't unloaded. However, at the moment I can't think of real disadvantages this could constitute in practice. I couldn't make the refresh sick you Lee command work, but replaced it by terminate sick server and launch sick server. It's only one more command and achieves the same thing.

Note that this doesn't fix #464. As described in this issue: Whenever you expect something to happen which isn't happening (e.g. the Sikuli server window stays black or doesn't change, a command isn't executed which should work) focus the Sikuli server window and press a key. Don't get confused by the error messages wich appear in both windows.

I tested this PR by doing the following:

  • Open one profile
  • Call one of your custom commands presented in the Sikuli server window which works (e.g. one which clicks on the Windows symbol)
  • Call one of your custom commands which doesn't work (e.g. because the image to look for is not visible)
  • Launch Sikuli's IDE by voice: launch sick IDE
  • Terminate the Sikuli server: terminate sick server
  • Create new Sikuli scripts
  • Launch the Sikuli server: launch sick server
  • Test the new commands
  • Terminate the server, remove the new commands, start the server, check that the removed commands don't work anymore
  • Switch your user profile, repeat the steps above

@LexiconCode LexiconCode changed the base branch from master to develop April 26, 2019 21:50
@seekM seekM closed this Apr 26, 2019
@LexiconCode LexiconCode reopened this Apr 26, 2019
@LexiconCode LexiconCode added Bug Unexpected behavior from existing features. Sikulix Issues related to Sikulix labels Apr 26, 2019
@LexiconCode LexiconCode changed the title Fix #463,#468 Sikuli Fix #463,#468 Apr 26, 2019
@LexiconCode
Copy link
Member

A very simple refresh command you could simply use the dragonflies playback action. Basically tying together the two commands "launch sick server" and "terminate sick server".

Example

from dragonfly import Playback
        'minimize':
            R(Playback([(["minimize", "window"], 0.0)]), rdescript="Minimize Window"),

Thus far everything has worked as expected so great work!

@seekM
Copy link
Contributor Author

seekM commented Apr 27, 2019

I just tried this Playback approach but ran into a problem similar to the one I encountered when I tried to implement this command: When you experience #464 with terminate sick server (i.e. you'd have to hit a key in the Sikuli server window such that the command proceeds) but don't press the key in time before launch sick server is started, an additional Sikuli server windows in created but closed immediately due to a failure. Then you a press a key in the old Sikuli server window which then is closed too. This leads to a state in which I wasn't always able to launch a new Sikuli server. Therefore I recommend to terminate and start manually and make sure that the server is terminated successfully before starting a new one.

@LexiconCode
Copy link
Member

So this implementation seems to work on my end but let me know what you think. The pause in between the functions of ensures that there is enough time between between terminating and starting the server.

'refresh sick': Function(terminate_sick_command) + Pause("100") + Function(bootstrap_start_server_proxy),

@seekM
Copy link
Contributor Author

seekM commented May 1, 2019

I think two seconds isn't long enough to realize that the server isn't terminating properly and that you have to press a key before the new server is started. This is especially true if you haven't kept in mind that this might happen and are suprised by this. I think it should be at least Pause("600") (six seconds).

@LexiconCode
Copy link
Member

Sounds good, I'll see if I can find a more reliable method to terminate the server as it seems to be the crux of the issue.

@LexiconCode
Copy link
Member

I'll add rdescripts and merge for now and we can leave it as is until another pull request.

added rdescript to Sikulix commands
@LexiconCode LexiconCode merged commit 875fc37 into dictation-toolbox:develop May 2, 2019
@seekM seekM deleted the sikuli branch May 6, 2019 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unexpected behavior from existing features. Sikulix Issues related to Sikulix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants