-
Notifications
You must be signed in to change notification settings - Fork 2
WIP: Use Directory subclasses instead of DirTypes enum #6
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
base: master
Are you sure you want to change the base?
Conversation
cgfs.py
Outdated
| assig_dir.insert(AssignmentSettingsFile(cgapi, assig['id'])) | ||
| assig_dir.insert( | ||
| RubricEditorFile( | ||
| cgapi, assig['id'], self.rubric_append_only |
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 will not work.
cgfs.py
Outdated
| class AssignmentDirectory(Directory): | ||
| def load_submissions(self, latest_only): | ||
| try: | ||
| submissions = cgapi.get_submissions(self.id) |
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.
I would propose to stop using this global variable for new code.
| self.stat[key] = value | ||
|
|
||
|
|
||
| class Directory(BaseFile): |
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.
Should FixedDirectory also inherit from this class?
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.
I couldn't find a class named FixedDirectory?
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.
Sorry I meant TempDirectory.
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.
It already does...
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.
Hmm...
d4db8e1 to
29063e5
Compare
Description
Make subclasses of the
Directoryclass to be used instead of theDirTypesenum.The new classes are:
RootDirectory,CourseDirectory,AssignmentDirectory,SubmissionDirectoryandRegularDirectory, named after the corresponding values of the enum.Also moves some functionality specific to those directories to the new classes, e.g. loading submissions is now in the
AssignmentDirectoryclass.Still WIP as I haven't been able to test it yet, but wanted to get it out there to get some initial feedback on it.