Skip to content

Conversation

@Spacerat
Copy link
Contributor

This is an enabling PR for the test-bench branch, but is also an improvement in its own right. It makes the following changes:

  • All S3 logic for saving/reading of files attached to SourceFile and ResourceVariant models is factored out into a single S3File class which retains all previous functionality.
  • Before there was SourceFiles.save_file(text) and ResourceVariants.save_file(stream). Now, S3File.save_text(text) replaces the SourceFile's version, and all usage is renamed accordingly.
  • Support for line folding and last-modified behaviour is factored out of SourceFile and into ScriptFile. This is purely an enabling change for test-bench, where TestFile will inherit from ScriptFile.
  • All support previously in files.py for AWS_ENABLED==False is now contained in a small set of functions in S3File, which will make them easy to remove if we ever want to.

@pebble-heroku pebble-heroku temporarily deployed to cloudpebble-sp-pr-297 April 11, 2016 21:03 Inactive
@Spacerat Spacerat mentioned this pull request Apr 11, 2016
@Spacerat Spacerat force-pushed the feature/file-model-refactor branch from 0bd8d7d to b4ccef5 Compare April 11, 2016 21:40
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-297 April 11, 2016 21:40 Inactive
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-297 April 11, 2016 22:37 Inactive
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-297 April 12, 2016 00:33 Inactive
Joseph Atkins-Turkish added 2 commits June 7, 2016 11:37
# Conflicts:
#	ide/api/project.py
#	ide/api/source.py
#	ide/models/files.py
#	ide/tasks/archive.py
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-297 June 7, 2016 18:38 Inactive
from ide.models.s3file import S3File


class ScriptFile(S3File):
Copy link
Member

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.

Copy link
Contributor Author

@Spacerat Spacerat Jun 22, 2016

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

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@Spacerat
Copy link
Contributor Author

OK, I renamed ScriptFile to TextFile

@Spacerat Spacerat mentioned this pull request Jun 27, 2016
@Katharine Katharine merged commit 80e6d9f into master Jul 5, 2016
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.

4 participants