myshell-py 0.4.0__tar.gz → 0.4.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.
Files changed (70) hide show
  1. {myshell_py-0.4.0 → myshell_py-0.4.1}/PKG-INFO +1 -1
  2. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/sched.py +7 -1
  3. {myshell_py-0.4.0 → myshell_py-0.4.1}/pyproject.toml +1 -1
  4. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_coreutils.py +2 -1
  5. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_sched.py +1 -1
  6. {myshell_py-0.4.0 → myshell_py-0.4.1}/.gitignore +0 -0
  7. {myshell_py-0.4.0 → myshell_py-0.4.1}/README.md +0 -0
  8. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/__init__.py +0 -0
  9. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/__main__.py +0 -0
  10. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/aliases.py +0 -0
  11. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/arith.py +0 -0
  12. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/builtins.py +0 -0
  13. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/cli.py +0 -0
  14. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/compat.py +0 -0
  15. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/completion.py +0 -0
  16. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/coreutils.py +0 -0
  17. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/editor.py +0 -0
  18. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/errors.py +0 -0
  19. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/executor.py +0 -0
  20. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/expand.py +0 -0
  21. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/guide.py +0 -0
  22. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/heredoc.py +0 -0
  23. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/highlight.py +0 -0
  24. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/history.py +0 -0
  25. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/jobs.py +0 -0
  26. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/lexer.py +0 -0
  27. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/more_builtins.py +0 -0
  28. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/parser.py +0 -0
  29. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/paths.py +0 -0
  30. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/procs.py +0 -0
  31. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/progress.py +0 -0
  32. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/prompt.py +0 -0
  33. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/quiz.py +0 -0
  34. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/state.py +0 -0
  35. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/textedit.py +0 -0
  36. {myshell_py-0.4.0 → myshell_py-0.4.1}/myshell/theme.py +0 -0
  37. {myshell_py-0.4.0 → myshell_py-0.4.1}/pytest.ini +0 -0
  38. {myshell_py-0.4.0 → myshell_py-0.4.1}/requirements.txt +0 -0
  39. {myshell_py-0.4.0 → myshell_py-0.4.1}/shell.py +0 -0
  40. {myshell_py-0.4.0 → myshell_py-0.4.1}/src/myshell/__init__.py +0 -0
  41. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/conftest.py +0 -0
  42. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_aliases.py +0 -0
  43. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_arith.py +0 -0
  44. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_builtins.py +0 -0
  45. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_cli.py +0 -0
  46. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_completion.py +0 -0
  47. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_editor.py +0 -0
  48. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_expand.py +0 -0
  49. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_expansion_e2e.py +0 -0
  50. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_guide.py +0 -0
  51. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_heredoc.py +0 -0
  52. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_highlight.py +0 -0
  53. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_history.py +0 -0
  54. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_history_fallback.py +0 -0
  55. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_if.py +0 -0
  56. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_interactive.py +0 -0
  57. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_jobs.py +0 -0
  58. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_language.py +0 -0
  59. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_lexer.py +0 -0
  60. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_loops.py +0 -0
  61. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_more_builtins.py +0 -0
  62. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_parser.py +0 -0
  63. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_pipelines.py +0 -0
  64. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_procs.py +0 -0
  65. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_prompt.py +0 -0
  66. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_quiz_progress.py +0 -0
  67. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_redirects.py +0 -0
  68. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_startup.py +0 -0
  69. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_textedit.py +0 -0
  70. {myshell_py-0.4.0 → myshell_py-0.4.1}/tests/test_theme.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: myshell-py
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: A Unix-style shell written in Python, with a built-in guide.
5
5
  License: MIT
6
6
  Keywords: education,shell,terminal
@@ -531,8 +531,14 @@ def _cron_log(args: List[str], stdout: TextIO, stderr: TextIO) -> int:
531
531
  if args and args[0] == "--clear":
532
532
  try:
533
533
  os.remove(log_file())
534
- except OSError:
534
+ except FileNotFoundError:
535
535
  pass
536
+ except OSError:
537
+ try:
538
+ open(log_file(), "w").close() # Windows: a running task still holds the file
539
+ except OSError:
540
+ print("cron log: could not clear the log", file=stderr)
541
+ return 1
536
542
  print("cron log cleared", file=stdout)
537
543
  return 0
538
544
  count = 20
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "myshell-py"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "A Unix-style shell written in Python, with a built-in guide."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -23,7 +23,8 @@ def write(path, text):
23
23
 
24
24
 
25
25
  def test_the_table_has_every_command():
26
- assert set(PORTABLE) == set("ls cat head tr sleep mkdir rm cp mv touch wc grep".split())
26
+ core = set("ls cat head tr sleep mkdir rm cp mv touch wc grep".split())
27
+ assert core <= set(PORTABLE) # ps, top and nano join the table when builtins loads
27
28
 
28
29
 
29
30
  class TestLs:
@@ -166,7 +166,7 @@ def test_real_task_writes_the_log(state, dirs, monkeypatch):
166
166
  code, out, _ = run(sched.builtin_cron, state, ["log"])
167
167
  assert "from-cron-task" in out
168
168
  assert run(sched.builtin_cron, state, ["log", "--clear"])[0] == 0
169
- assert not log.exists()
169
+ assert not log.exists() or log.read_text() == ""
170
170
 
171
171
 
172
172
  def test_shell_commands(sh):
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes