otter-service-stdalone 0.1.5__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: otter_service_stdalone
3
- Version: 0.1.5
3
+ Version: 0.1.8
4
4
  Summary: Grading Service for Instructors using Otter Grader
5
5
  Home-page: https://github.com/sean-morris/otter-service-stdalone
6
6
  Author: Sean Morris
@@ -0,0 +1 @@
1
+ __version__ = "0.1.8"
@@ -8,10 +8,21 @@ from otter_service_stdalone import fs_logging as log
8
8
  from zipfile import ZipFile, ZIP_DEFLATED
9
9
  import asyncio
10
10
  import async_timeout
11
+ import shutil
11
12
 
12
13
  __UPLOADS__ = "/tmp/uploads"
13
14
 
14
15
 
16
+ def copySubDirNotebooksToParentDir(parent_dir):
17
+ for root, dirs, files in os.walk(parent_dir):
18
+ for directory in dirs:
19
+ print(f"Subdirectory: {os.path.join(root, directory)}")
20
+ dir_path = os.path.join(root, directory)
21
+ for f in os.listdir(dir_path):
22
+ if os.path.isfile(f):
23
+ shutil.move(f, parent_dir)
24
+
25
+
15
26
  class GradeNotebooks():
16
27
  async def grade(self, p, notebooks_zip):
17
28
  try:
@@ -19,6 +30,8 @@ class GradeNotebooks():
19
30
  with ZipFile(notebooks_zip, 'r') as zObject:
20
31
  zObject.extractall(path=zip_folder)
21
32
 
33
+ copySubDirNotebooksToParentDir(zip_folder)
34
+
22
35
  command = [
23
36
  'otter', 'grade',
24
37
  '-a', p,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: otter-service-stdalone
3
- Version: 0.1.5
3
+ Version: 0.1.8
4
4
  Summary: Grading Service for Instructors using Otter Grader
5
5
  Home-page: https://github.com/sean-morris/otter-service-stdalone
6
6
  Author: Sean Morris
@@ -1 +0,0 @@
1
- __version__ = "0.1.5"