PyKubeGrader 0.2.8__py3-none-any.whl → 0.2.9__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -12,7 +12,7 @@ pykubegrader/graders/late_assignments.py,sha256=_2-rA5RqO0BWY9WAQA_mbCxxPKTOiJOl
12
12
  pykubegrader/log_parser/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
13
13
  pykubegrader/log_parser/parse.ipynb,sha256=H1CUuqiUSE-tiZV1IS7VG6HAEvoopGd6i_5QM5CwoE0,12230
14
14
  pykubegrader/log_parser/parse.py,sha256=YCs_OCnoxQKsL55MjTZWXBBBsehJL8PIB9ANnC-aE44,7379
15
- pykubegrader/submit/submit_assignment.py,sha256=UHRwogSz7TpMUZSAyEbQIQut2WcC08ma2JEIEWaSUdM,2702
15
+ pykubegrader/submit/submit_assignment.py,sha256=-GaxZBFnZOcFYoWo_WcmLB0y7PQBRKnSlhUAhg3zwMs,3002
16
16
  pykubegrader/widgets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
17
17
  pykubegrader/widgets/multiple_choice.py,sha256=NjD3-uXSnibpUQ0mO3hRp_O-rynFyl0Dz6IXE4tnCRI,2078
18
18
  pykubegrader/widgets/reading_question.py,sha256=y30_swHwzH8LrT8deWTnxctAAmR8BSxTlXAqMgUrAT4,3031
@@ -25,9 +25,9 @@ pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-
25
25
  pykubegrader/widgets_base/multi_select.py,sha256=Cl0IN21wXLZuFu-zC65aS9tD4jMfzCRJ2DPjHao5_Ak,4044
26
26
  pykubegrader/widgets_base/reading.py,sha256=_vjUPynqmJe_R4vf-7hVhGnQR726S9GL6qT8bflBXBM,5383
27
27
  pykubegrader/widgets_base/select.py,sha256=Fw3uFNOIWo1a3CvlzSx23bvi6bSmA3TqutuRbhD4Dp8,2525
28
- PyKubeGrader-0.2.8.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
29
- PyKubeGrader-0.2.8.dist-info/METADATA,sha256=KDlsQ-0emWgalUlulH1-hifPtv1M7kzHulEJlcLDmtM,2778
30
- PyKubeGrader-0.2.8.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
- PyKubeGrader-0.2.8.dist-info/entry_points.txt,sha256=UPMdTT46fQwTYJWtrUwIWIbXbwyOPfNQgBFRa0frWzw,138
32
- PyKubeGrader-0.2.8.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
33
- PyKubeGrader-0.2.8.dist-info/RECORD,,
28
+ PyKubeGrader-0.2.9.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
29
+ PyKubeGrader-0.2.9.dist-info/METADATA,sha256=lZjDfx25WYOa1lLNTbejsN4WzBagrI_bqv1CWtkltUc,2778
30
+ PyKubeGrader-0.2.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
+ PyKubeGrader-0.2.9.dist-info/entry_points.txt,sha256=UPMdTT46fQwTYJWtrUwIWIbXbwyOPfNQgBFRa0frWzw,138
32
+ PyKubeGrader-0.2.9.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
33
+ PyKubeGrader-0.2.9.dist-info/RECORD,,
@@ -1,9 +1,9 @@
1
1
  import os
2
2
  import httpx
3
3
  import asyncio
4
-
5
4
  import nest_asyncio
6
5
 
6
+ # Apply nest_asyncio for environments like Jupyter
7
7
  nest_asyncio.apply()
8
8
 
9
9
 
@@ -64,7 +64,6 @@ async def call_score_assignment(
64
64
  raise RuntimeError(f"An unexpected error occurred: {e}")
65
65
 
66
66
 
67
- # Importable function
68
67
  def submit_assignment(
69
68
  assignment_title: str, file_path: str = ".output_reduced.log"
70
69
  ) -> None:
@@ -75,7 +74,17 @@ def submit_assignment(
75
74
  assignment_title (str): Title of the assignment.
76
75
  file_path (str): Path to the log file to upload.
77
76
  """
78
- response = asyncio.run(call_score_assignment(assignment_title, file_path))
77
+ # Get the current event loop or create one
78
+ try:
79
+ loop = asyncio.get_event_loop()
80
+ except RuntimeError:
81
+ loop = asyncio.new_event_loop()
82
+ asyncio.set_event_loop(loop)
83
+
84
+ # Run the async function in the event loop
85
+ response = loop.run_until_complete(
86
+ call_score_assignment(assignment_title, file_path)
87
+ )
79
88
  print("Server Response:", response.get("message", "No message in response"))
80
89
 
81
90