PyKubeGrader 0.1.7__py3-none-any.whl → 0.1.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.1.7
3
+ Version: 0.1.9
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -1,5 +1,5 @@
1
1
  pykubegrader/__init__.py,sha256=AoAkdfIjDDZGWLlsIRENNq06L9h46kDGBIE8vRmsCfg,311
2
- pykubegrader/initialize.py,sha256=PACquuxFkvOKUx51Rv6_RVu1YnYXf9L_W3hmMY5IxMw,706
2
+ pykubegrader/initialize.py,sha256=xvaN4mepZn25x37YZhQj3UgqGq1PBc7yDGt9LBKgzAY,1105
3
3
  pykubegrader/telemetry.py,sha256=uuC4ZPLHYrAmKFBu3dJ3LGoEvQlT1LtOJjUldnfISEE,3343
4
4
  pykubegrader/utils.py,sha256=dKw6SyRYU3DWRgD3xER7wq-C9e1daWPkqr901LpcwiQ,642
5
5
  pykubegrader/validate.py,sha256=A6FxQrC76ulneRvC7PBHawTSBck6xe1qBGMgqhBXd9c,10682
@@ -16,9 +16,9 @@ pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-
16
16
  pykubegrader/widgets_base/multi_select.py,sha256=u50IOhYxC_S_gq31VnFPLdbNajk_SUWhaqlMSJxhqVQ,3439
17
17
  pykubegrader/widgets_base/reading.py,sha256=4uTLmlPzCwxVzufFhPjM7W19uMGguRb6y4eAV3x-zAc,5314
18
18
  pykubegrader/widgets_base/select.py,sha256=h1S5StcbX8S-Wiyga4fVDhPbVvRxffwaqyVbiiuInRs,2743
19
- PyKubeGrader-0.1.7.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
20
- PyKubeGrader-0.1.7.dist-info/METADATA,sha256=RI2GnJUkPg45Zp8aX8tqz4z_UCpj0bxiigt5QCfdGFI,2664
21
- PyKubeGrader-0.1.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
22
- PyKubeGrader-0.1.7.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
23
- PyKubeGrader-0.1.7.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
24
- PyKubeGrader-0.1.7.dist-info/RECORD,,
19
+ PyKubeGrader-0.1.9.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
20
+ PyKubeGrader-0.1.9.dist-info/METADATA,sha256=O3VMp6EJd-6QAC9L9aHyf54mySq5OiwpFG0x22Vd0p0,2664
21
+ PyKubeGrader-0.1.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
22
+ PyKubeGrader-0.1.9.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
23
+ PyKubeGrader-0.1.9.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
24
+ PyKubeGrader-0.1.9.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import os
2
3
 
3
4
  import panel as pn
4
5
  from IPython import get_ipython
@@ -16,13 +17,25 @@ def initialize_assignment(name: str) -> None:
16
17
  ipython.events.register("pre_run_cell", telemetry)
17
18
  except TypeError as e:
18
19
  print(f"Failed to register telemetry: {e}")
20
+ return
19
21
 
20
- pn.extension()
22
+ jhub_user = os.getenv("JUPYTERHUB_USER")
23
+ if jhub_user is None:
24
+ print("Setup unsuccessful. Are you on JupyterHub?")
25
+ return
21
26
 
22
27
  try:
23
28
  update_responses(key="assignment", value=name)
29
+ update_responses(key="jhub_user", value=jhub_user)
30
+
31
+ seed = hash(jhub_user) % 1000
32
+ update_responses(key="seed", value=seed)
24
33
  except (TypeError, json.JSONDecodeError) as e:
25
34
  print(f"Failed to initialize assignment: {e}")
26
35
  return
27
36
 
37
+ pn.extension(silent=True)
38
+
28
39
  print("Assignment successfully initialized")
40
+ print(f"Assignment: {name}")
41
+ print(f"Username: {jhub_user}")