8000 AutoKey must be restarted to recognize changes to internal module · Issue #747 · autokey/autokey · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
AutoKey must be restarted to recognize changes to internal module #747
Open
@Elliria

Description

@Elliria

Has this issue already been reported?

  • I have searched through the existing issues.

Is this a question rather than an issue?

  • This is not a question.

What type of issue is this?

Bug

Which Linux distribution did you use?

Kubuntu 22.04 LTS

Which AutoKey GUI did you use?

Both

Which AutoKey version did you use?

0.95.10

How did you install AutoKey?

My distribution's repository.

Can you briefly describe the issue?

If you make a change to an internall module file once AutoKey has already interacted with it, AutoKey won't see the change until AutoKey is closed and restarted, which can cause you to believe you made a mistake in your newly-added or edited code when it may actually be that AutoKey just hasn't noticed your change yet.

Can the issue be reproduced?

Always

What are the steps to reproduce the issue?

  1. Go into AutoKey's settings and choose a directory for AutoKey to use for internal modules.
  2. Create the MyModule.py file in that modules directory with these contents:
#!/usr/bin/env python3

# Create a variable with a string as its value:
MyVariable="one"

# Create a function that returns a string:
def MyFunction():
	return "two"
  1. Create an AutoKey script with these contents:
# Import the necessary library:
import MyModule

# Display the value of a variable from the imported module in a dialog:
dialog.info_dialog(message=MyModule.MyVariable)

# Display the value of a function from the imported module in a dialog:
dialog.info_dialog(message=MyModule.MyFunction())
  1. Run the AutoKey script.
  2. Observe the result. You will see a dialog with "one" in it followed by a dialog with "two" in it.
  3. Edit the MyModule.py file to change "two" to "three" in the last line of the script.
  4. Save the change to the MyModule.py file.
  5. Run the AutoKey script.
  6. Observe the result. You will see a dialog with "one" in it followed by a dialog with "two" in it.

What should have happened?

Since you changed "two" to "three" in steps 6 and 7 above, you should have seen a dialog with "one" in it followed by a dialog with "three" in it when you observed the changes in step 9 above.

What actually happened?

You saw a dialog with "one" in it followed by a dialog with "two" in it in step 9 above.

Do you have screenshots?

No response

Can you provide the output of the AutoKey command?

No response

Anything else?

Work-around:

Closing and restarting AutoKey (possibly also using pkill autokey before restarting AutoKey to make sure the process has ended) and running the AutoKey script again will cause AutoKey to properly display the current values of the variables in the internal module.

Note:

This only happens when importing a module that's in the directory that you have chosen for AutoKey to use for modules. If you use the steps I shared to run an imported external module from any directory and make a change to the external script, AutoKey will instantly recognize it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugscriptingIssues related to Scripts or the scripting API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0