Skip to content

Loading of Unimacro Scripts #28

Open
@dougransom

Description

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.

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions