Description
There have been multiple requests on the forum to support loading of script files in subdirectories (other the special directories apps
and modules
). That helps users organize their script files, rather everything being in flat top-level directory.
I'm summarizing my reply to one of these requests to get feedback before implementing it.
Questions:
- should pyscript automatically load scripts recursively in all other directories?
- ...or should we reserve a name like
local
, and everything below just that directory is recursively auto loaded? - should the directories that are recursively autoloaded be configurable?
My leaning would be to have one directory, eg, local
, which has recursively autoloading, and not make its name configurable. My reasoning is that we might add other top-level directories that support special behavior, so keeping the recursive loading to one directory for now would avoid future name collisions. For config, I prefer to keep things as simple as possible, but we could always make it configurable later (eg, a list of directories to recursively autoload, and the default is local
).
Another feature could be that script file names starting with #
are not autoloaded. So you can rename files to disable them (sort of like a comment in the file name). That's easier than moving them to some other directory (and then forgetting where you put it), or commenting out the entire contents of the file. Is that useful or too confusing?