-
Notifications
You must be signed in to change notification settings - Fork 83
Refactor S3 model logic into abstract base classes #297
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
Conversation
0bd8d7d to
b4ccef5
Compare
# Conflicts: # ide/api/project.py # ide/api/source.py # ide/models/files.py # ide/tasks/archive.py
ide/models/scriptfile.py
Outdated
| from ide.models.s3file import S3File | ||
|
|
||
|
|
||
| class ScriptFile(S3File): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bizarre name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The motivation is that it is the superclass of both SourceFile and TestFile (monkeyscripts) in the test bench branch. I don't mind changing the name if you can think of something more suitable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the comment is wrong. It should say "ScriptFiles add support to S3Files for last-modified timestamps and code folding". Which makes me think that TextFile is a reasonable alternative name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
|
OK, I renamed ScriptFile to TextFile |
This is an enabling PR for the test-bench branch, but is also an improvement in its own right. It makes the following changes:
SourceFiles.save_file(text)andResourceVariants.save_file(stream). Now,S3File.save_text(text)replaces the SourceFile's version, and all usage is renamed accordingly.files.pyforAWS_ENABLED==Falseis now contained in a small set of functions in S3File, which will make them easy to remove if we ever want to.