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

Allow fileglobs in the dont_load list #1794

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianepperson
Copy link

@ianepperson ianepperson commented Jan 27, 2023

Permits file globbing definitions in the dont_load list by creating a list subclass called PathList which inspects file globs too. When this change is applied, a user can use *, ? and even [seq] to fine tune the dont_load list.

This change uses the Python standard library file globbing (not regex), and thus does not effect existing functionality - the special glob characters (*, ?, [, ]) are not permitted within a Python identifier.

SHELL_PLUS_DONT_LOAD = [
    "my_app.Tagulous_*",  # Don't load any of the Tagulous models defined in my_app
    "*.Tagulous_*",  # Don't load any of the Tagulous models in any app
    "my_app.model[ABC]",  # Don't load modelA, modelB nor modelC
    "my_app.model?",  # Don't load any of the above, plus any other modelD, modelE
]

I'm using the Tagulous plugin which creates additional models every time I add a tag field. Each of these models is prefixed with my_app.Tagulous_ and fails to load in shell_plus. I keep adding to the DONT_LOAD list, and I'd rather do that once.

SHELL_PLUS_DONT_LOAD = [
    "my_app.Tagulous_*",
]

@ianepperson
Copy link
Author

Can I get a maintainer to approve running the workflows to ensure this works as advertised?

@trbs
Copy link
Member

trbs commented Jun 5, 2023

Can you rebase this PR ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants