Feature: selective export
I would like to propose a feature/change as follows.
The Show Project Folders button causes a long hang and is only one level deep.
I would like to propose some form of nesting/exclusion.
Perhaps if you only select a single project then the option for excluding folders comes up?
The use case is that we sometime have "archive" folders in our projects that we don't need to export.
The hang could be improved if there was for example one dropdown for project selection, then if you enable Show Project Folders, we populate a second dropdown with the folders for only the selected projects. That would still iterate over all the folders at level 1 in the selected projects, but at least not for all projects. There isn't (AFAIK) a tree UI widget so that was also a motivator for going one level deep
If you know ahead of time you're always going to exclude a fixed list, then it might be simpler to have an ignore file like .gitignore. That would be simpler too than building more UI. For an ignore, we still have to iterate over all folders in the selected projects, but that would happen at run time instead of in the UI.
If you know ahead of time you're always going to exclude a fixed list, then it might be simpler to have an ignore file like .gitignore.
I think this is a great approach! Looks like this package could do the heavy lifting for us: https://github.com/thehanimo/py-gitignore.
I'm reluctant to rely on any dependencies because I'm not sure how much a pain it is to get them working with fusion. Do you know? Maybe something simple with fnmatch would suffice
Agreed, fnmatch should do the job.
Do you want to have a separate file or an entry in the last_settings.json. Maybe:
"ignore_directories": [
"*.archive"
]
I'd lean separate file to keep just the UI settings in last_settings.json. Separate file feels overkill for a single pattern but saves the headache of editing multiple patterns in a single tiny text box and having a separator character. I am thinking the logic in the code will concat {project}/{dir} (and nested {project}/dir1/{dir}) and test against each pattern. Having the project as a leading "folder" is maybe useful? Or unnecessary?
Okay, seperate file it is.
Do you have a preference for the filename? Maybe .exportignore?
Maybe extra_settings.json? and have {"ignore_patterns": []} in there. That way any more settings can go in there in the future without a new file. And while the leading dot is conventional in eg gitignore I don't think it is that useful here; and I think can be confusing on windows
Sounds good. I have a bit much on my plate at the moment. But I will try get to this when I can.
Your script is great. Thank you . The only thing that could greatly improve its functionality would be a deeper directory listing