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

Loading of Unimacro Scripts #28

Open
dougransom opened this issue Nov 10, 2022 · 1 comment
Open

Loading of Unimacro Scripts #28

dougransom opened this issue Nov 10, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dougransom
Copy link
Member

It strikes me as odd that Unimacro Scripts like _folders.py etc. are stored in the users unimacro/ActiveGrammars. I could see this maybe (but not likely) if a user were developing a script.

Also, how are scripts currently upgraded if new ones show up from a unimacro or other package upgrade?

Now that Unimacro is python package, the configuration file could (if we make changes) just list the unimacro scripts that are enabled. Then the unimacro script loader loads them with the equivalent of an import statement. In most cases, it will load them out of an installed python package. If i have my own script _doug.py i make sure it is installed as a python package or in the python path somewhere.

For example, in the config file

[enabled] 
 unimacro/_brackets
 unimacro/_folders
dougscripts/_doug

[disabled]
just some scripts we might want to renabled some day...

The unimacro loader just performs

import unimacro/_brackets
import unimacro/_folders
import dougscripts/_doug

the next time I do a pip upgrade, my unimacro scripts are probably all updated to the latest.

@dougransom dougransom added the enhancement New feature or request label Nov 10, 2022
@quintijn
Copy link
Collaborator

I have a python script check_unimacro_grammars.py which should do just this. Only smoke tested, but I think it basically works. https://github.com/dictation-toolbox/unimacro/blob/master/src/unimacro/check_unimacro_grammars.py

Will work on the documentation of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants