Closed tchx84 closed 4 years ago
Thanks. Tested. Can the problem be fixed by not ignoring files when exporting packages?
Thanks. Tested. Can the problem be fixed by not ignoring files when exporting packages?
You mean doing both things? Because I think we should still use valid names for new sources.
I see. What's the criteria for valid names? Is there a validator? At the moment, this patch only changes the default name for new files. Files can be renamed to an invalid name.
No spaces and the proper extension is a good start. I am open to suggestions, that don't require the user to guess how files should be named or that changes file names without the user knowing about the change..
I found something interesting here https://github.com/sugarlabs/Pippy/blob/37b6d22c03c55badd482207f18afcd9b6769524d/notebook.py#L325
Maybe there's a way we can use it here, with the UX restrictions I mentioned.
Yes, I'm familiar with that, as I had a lot of work to fix things for collaboration. https://github.com/sugarlabs/Pippy/commit/178abe174ee1b84a832bd694b8364cc1e7b90b89.
Changing naming again may also break collaboration between old and new versions.
I'm also worried about any lesson plans.
If it is only distutils that needs the names valid, can't we rename just before running distutils in export? Or show a message asking for names to be changed?
By the way, many of the example files are untyped too.
Yes, I'm familiar with that, as I had a lot of work to fix things for collaboration. 178abe1.
Changing naming again may also break collaboration between old and new versions.
That's a valid concern.
I'm also worried about any lesson plans.
If it is only distutils that needs the names valid, can't we rename just before running distutils in export? Or show a message asking for names to be changed?
We could, I am just not sure would be a good UX since the rename happens without user knowing (e.g. later they wouldn't be able to import with the same they knew).
Maybe rename on export and then show a notification if one of these files got renamed ?
By the way, many of the example files are untyped too.
Maybe just refuse export with an Alert if the names aren't valid? It's not like exporting is common.
@quozl that should do! At least it's giving the user a suggestion.
Thanks!
New source files are added with spaces and without the dot py extension, and therefore are ignored when exporting packages. Better to use a valid name in the first place.