ygrader 2.6.1__tar.gz → 2.6.3__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.
- {ygrader-2.6.1/ygrader.egg-info → ygrader-2.6.3}/PKG-INFO +1 -1
- {ygrader-2.6.1 → ygrader-2.6.3}/setup.py +1 -1
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/deductions.py +3 -1
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/grading_item.py +5 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/utils.py +5 -2
- {ygrader-2.6.1 → ygrader-2.6.3/ygrader.egg-info}/PKG-INFO +1 -1
- {ygrader-2.6.1 → ygrader-2.6.3}/LICENSE +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/setup.cfg +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/test/test_interactive.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/test/test_unittest.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/__init__.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/feedback.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/grader.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/grades_csv.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/grading_item_config.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/remote.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/score_input.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/send_ctrl_backtick.ahk +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/student_repos.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader/upstream_merger.py +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader.egg-info/SOURCES.txt +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader.egg-info/dependency_links.txt +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader.egg-info/requires.txt +0 -0
- {ygrader-2.6.1 → ygrader-2.6.3}/ygrader.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ setup(
|
|
|
4
4
|
name="ygrader",
|
|
5
5
|
packages=["ygrader"],
|
|
6
6
|
package_data={"ygrader": ["*.ahk"]},
|
|
7
|
-
version="2.6.
|
|
7
|
+
version="2.6.3",
|
|
8
8
|
description="Grading scripts used in BYU's Electrical and Computer Engineering Department",
|
|
9
9
|
author="Jeff Goeders",
|
|
10
10
|
author_email="jeff.goeders@gmail.com",
|
|
@@ -178,11 +178,13 @@ class StudentDeductions:
|
|
|
178
178
|
|
|
179
179
|
Args:
|
|
180
180
|
message: The deduction message/description
|
|
181
|
-
points: Points to deduct (
|
|
181
|
+
points: Points to deduct (must be non-negative)
|
|
182
182
|
|
|
183
183
|
Returns:
|
|
184
184
|
The ID assigned to this deduction type
|
|
185
185
|
"""
|
|
186
|
+
if points < 0:
|
|
187
|
+
raise ValueError(f"Deduction points must be non-negative, got {points}")
|
|
186
188
|
# Find the next available ID (start at 1, reserve 0 for clear command)
|
|
187
189
|
if self.deduction_types:
|
|
188
190
|
next_id = max(self.deduction_types.keys()) + 1
|
|
@@ -211,6 +211,11 @@ class GradeItem:
|
|
|
211
211
|
# Callback returned deductions to apply automatically
|
|
212
212
|
if isinstance(callback_result, list):
|
|
213
213
|
for deduction_desc, deduction_points in callback_result:
|
|
214
|
+
if deduction_points < 0:
|
|
215
|
+
raise ValueError(
|
|
216
|
+
f"Deduction points must be non-negative, got {deduction_points} "
|
|
217
|
+
f"for '{deduction_desc}'"
|
|
218
|
+
)
|
|
214
219
|
# Find or create the deduction type
|
|
215
220
|
deduction_id = (
|
|
216
221
|
self.student_deductions.find_or_create_deduction_type(
|
|
@@ -162,13 +162,16 @@ def is_wsl():
|
|
|
162
162
|
_FOCUS_WARNING_PRINTED = False
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
def open_file_in_vscode(file_path):
|
|
165
|
+
def open_file_in_vscode(file_path, sleep_time=1.0):
|
|
166
166
|
"""Open a file in VS Code and return focus to terminal.
|
|
167
167
|
|
|
168
168
|
Parameters
|
|
169
169
|
----------
|
|
170
170
|
file_path: pathlib.Path or str
|
|
171
171
|
Path to the file to open in VS Code
|
|
172
|
+
sleep_time: float, optional
|
|
173
|
+
Time in seconds to wait for VS Code to open before returning focus to terminal.
|
|
174
|
+
Default is 1.0 seconds.
|
|
172
175
|
"""
|
|
173
176
|
global _FOCUS_WARNING_PRINTED # pylint: disable=global-statement
|
|
174
177
|
|
|
@@ -191,7 +194,7 @@ def open_file_in_vscode(file_path):
|
|
|
191
194
|
error(f"VS Code exited with code {result.returncode}")
|
|
192
195
|
|
|
193
196
|
# Give VS Code a moment to open, then send Ctrl+` to toggle terminal focus
|
|
194
|
-
time.sleep(
|
|
197
|
+
time.sleep(sleep_time)
|
|
195
198
|
|
|
196
199
|
# Use AutoHotkey on WSL, osascript on macOS, xdotool on Linux
|
|
197
200
|
if is_wsl():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|