ygrader 1.2.0__tar.gz → 1.2.1__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.4
2
2
  Name: ygrader
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
@@ -4,7 +4,7 @@ setup(
4
4
  name="ygrader",
5
5
  packages=["ygrader"],
6
6
  package_data={"ygrader": ["*.ahk"]},
7
- version="1.2.0",
7
+ version="1.2.1",
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",
@@ -174,13 +174,22 @@ def open_file_in_vscode(file_path):
174
174
 
175
175
  file_path = pathlib.Path(file_path)
176
176
 
177
+ # Verify file exists before trying to open
178
+ if not file_path.exists():
179
+ error(f"File does not exist: {file_path}")
180
+
181
+ print(f"Opening {file_path} in VS Code...")
182
+
177
183
  # Open in VS Code (will steal focus)
178
- with subprocess.Popen(
184
+ result = subprocess.run(
179
185
  ["code", "--reuse-window", file_path],
180
186
  stdout=subprocess.DEVNULL,
181
187
  stderr=subprocess.DEVNULL,
182
- ):
183
- pass
188
+ check=False,
189
+ )
190
+ if result.returncode != 0:
191
+ error(f"VS Code exited with code {result.returncode}")
192
+
184
193
  # Give VS Code a moment to open, then send Ctrl+` to toggle terminal focus
185
194
  time.sleep(0.5)
186
195
 
@@ -194,7 +203,13 @@ def open_file_in_vscode(file_path):
194
203
  )
195
204
 
196
205
  if autohotkey_path.exists():
197
- subprocess.run([str(autohotkey_path), str(ahk_file)], check=False)
206
+ result = subprocess.run([str(autohotkey_path), str(ahk_file)], check=False)
207
+ if result.returncode != 0:
208
+ if not _FOCUS_WARNING_PRINTED:
209
+ warning(
210
+ f"AutoHotkey failed to send hotkey (exit code {result.returncode}). Check that AutoHotkey v2 is properly installed."
211
+ )
212
+ _FOCUS_WARNING_PRINTED = True
198
213
  else:
199
214
  if not _FOCUS_WARNING_PRINTED:
200
215
  warning(
@@ -210,7 +225,13 @@ def open_file_in_vscode(file_path):
210
225
  stderr=subprocess.DEVNULL,
211
226
  check=True,
212
227
  )
213
- subprocess.run(["xdotool", "key", "ctrl+grave"], check=False)
228
+ result = subprocess.run(["xdotool", "key", "ctrl+grave"], check=False)
229
+ if result.returncode != 0:
230
+ if not _FOCUS_WARNING_PRINTED:
231
+ warning(
232
+ f"xdotool failed to send hotkey (exit code {result.returncode}). Check that xdotool is properly installed."
233
+ )
234
+ _FOCUS_WARNING_PRINTED = True
214
235
  except subprocess.CalledProcessError:
215
236
  if not _FOCUS_WARNING_PRINTED:
216
237
  warning(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ygrader
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
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