refactor(main.py): move grade directory creation to the point of use
This commit is contained in:
9
main.py
9
main.py
@@ -76,11 +76,6 @@ class MediaGrader:
|
|||||||
self.window_width = 800
|
self.window_width = 800
|
||||||
self.window_height = 600
|
self.window_height = 600
|
||||||
|
|
||||||
# Create grade directories
|
|
||||||
for i in range(1, 6):
|
|
||||||
grade_dir = self.directory / str(i)
|
|
||||||
grade_dir.mkdir(exist_ok=True)
|
|
||||||
|
|
||||||
def find_media_files(self) -> List[Path]:
|
def find_media_files(self) -> List[Path]:
|
||||||
"""Find all media files recursively in the directory"""
|
"""Find all media files recursively in the directory"""
|
||||||
media_files = []
|
media_files = []
|
||||||
@@ -353,6 +348,10 @@ class MediaGrader:
|
|||||||
|
|
||||||
current_file = self.media_files[self.current_index]
|
current_file = self.media_files[self.current_index]
|
||||||
grade_dir = self.directory / str(grade)
|
grade_dir = self.directory / str(grade)
|
||||||
|
|
||||||
|
# Create grade directory if it doesn't exist
|
||||||
|
grade_dir.mkdir(exist_ok=True)
|
||||||
|
|
||||||
destination = grade_dir / current_file.name
|
destination = grade_dir / current_file.name
|
||||||
|
|
||||||
counter = 1
|
counter = 1
|
||||||
|
Reference in New Issue
Block a user