peek-python 25.0.22__tar.gz → 25.0.24__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: peek-python
3
- Version: 25.0.22
3
+ Version: 25.0.24
4
4
  Summary: peek - like print, but easy
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/peek
@@ -1359,8 +1359,8 @@ This functionality is particularly useful for entering an answer of an *Advent o
1359
1359
 
1360
1360
  ## Conditional stop of program
1361
1361
 
1362
- With `peek.stop` or `peek.stop()` a program will be stopped (by raising a SystemExit exception), provided peek.enabled is True.
1363
- If peek.enabled is False, the program will just continue.
1362
+ With `peek.stop` or `peek.stop()` a program will be stopped (by raising a `SystemExit` exception), provided `peek.enabled` is True.
1363
+ If `peek.enabled` is False, the program will just continue.
1364
1364
 
1365
1365
  For example:
1366
1366
  ```
@@ -1380,6 +1380,11 @@ stopped by peek.stop
1380
1380
 
1381
1381
  and then stop execution.
1382
1382
 
1383
+ > [!NOTE]
1384
+ >
1385
+ > Under Pythonista, `sys.exit()` will be called.
1386
+ > Under pyodide/xlwings lite, an `Exception` exception will be raised.
1387
+
1383
1388
  ## Interpreting the line number information
1384
1389
 
1385
1390
  When `show_line_number` is True or peek() is used without any parameters, the output will contain the line number like:
@@ -1342,8 +1342,8 @@ This functionality is particularly useful for entering an answer of an *Advent o
1342
1342
 
1343
1343
  ## Conditional stop of program
1344
1344
 
1345
- With `peek.stop` or `peek.stop()` a program will be stopped (by raising a SystemExit exception), provided peek.enabled is True.
1346
- If peek.enabled is False, the program will just continue.
1345
+ With `peek.stop` or `peek.stop()` a program will be stopped (by raising a `SystemExit` exception), provided `peek.enabled` is True.
1346
+ If `peek.enabled` is False, the program will just continue.
1347
1347
 
1348
1348
  For example:
1349
1349
  ```
@@ -1363,6 +1363,11 @@ stopped by peek.stop
1363
1363
 
1364
1364
  and then stop execution.
1365
1365
 
1366
+ > [!NOTE]
1367
+ >
1368
+ > Under Pythonista, `sys.exit()` will be called.
1369
+ > Under pyodide/xlwings lite, an `Exception` exception will be raised.
1370
+
1366
1371
  ## Interpreting the line number information
1367
1372
 
1368
1373
  When `show_line_number` is True or peek() is used without any parameters, the output will contain the line number like:
@@ -34,7 +34,7 @@ import pprint
34
34
  import builtins
35
35
  import shutil
36
36
 
37
- __version__ = "25.0.22"
37
+ __version__ = "25.0.24"
38
38
 
39
39
  from pathlib import Path
40
40
 
@@ -50,9 +50,9 @@ else:
50
50
  colorama.just_fix_windows_console()
51
51
 
52
52
  try:
53
- import tomlib
53
+ import tomllib
54
54
  except ModuleNotFoundError:
55
- import tomli as tomlib
55
+ import tomli as tomllib
56
56
 
57
57
 
58
58
  class _Peek:
@@ -275,7 +275,7 @@ class _Peek:
275
275
  _Peek.in_read_toml_message = f" in reading {toml_file} or environment variable(s)"
276
276
  with open(toml_file, "r") as f:
277
277
  config_as_str = f.read()
278
- result.update(tomlib.loads(config_as_str))
278
+ result.update(tomllib.loads(config_as_str))
279
279
  break
280
280
  return result
281
281
 
@@ -788,7 +788,13 @@ class _Peek:
788
788
  @property
789
789
  def stop(self):
790
790
  if self.enabled:
791
- raise SystemExit("stopped by peek.stop")
791
+ if Pyodide:
792
+ raise Exception("stopped by peek.stop")
793
+ elif Pythonista:
794
+ print("stopped by peek.stop")
795
+ sys.exit()
796
+ else:
797
+ raise SystemExit("stopped by peek.stop")
792
798
 
793
799
  def traceback(self):
794
800
  if self.show_traceback:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peek-python
3
- Version: 25.0.22
3
+ Version: 25.0.24
4
4
  Summary: peek - like print, but easy
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/peek
@@ -1359,8 +1359,8 @@ This functionality is particularly useful for entering an answer of an *Advent o
1359
1359
 
1360
1360
  ## Conditional stop of program
1361
1361
 
1362
- With `peek.stop` or `peek.stop()` a program will be stopped (by raising a SystemExit exception), provided peek.enabled is True.
1363
- If peek.enabled is False, the program will just continue.
1362
+ With `peek.stop` or `peek.stop()` a program will be stopped (by raising a `SystemExit` exception), provided `peek.enabled` is True.
1363
+ If `peek.enabled` is False, the program will just continue.
1364
1364
 
1365
1365
  For example:
1366
1366
  ```
@@ -1380,6 +1380,11 @@ stopped by peek.stop
1380
1380
 
1381
1381
  and then stop execution.
1382
1382
 
1383
+ > [!NOTE]
1384
+ >
1385
+ > Under Pythonista, `sys.exit()` will be called.
1386
+ > Under pyodide/xlwings lite, an `Exception` exception will be raised.
1387
+
1383
1388
  ## Interpreting the line number information
1384
1389
 
1385
1390
  When `show_line_number` is True or peek() is used without any parameters, the output will contain the line number like:
@@ -10,7 +10,7 @@ authors = [
10
10
  { name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com" },
11
11
  ]
12
12
  description = "peek - like print, but easy"
13
- version = "25.0.22"
13
+ version = "25.0.24"
14
14
  readme = "README.md"
15
15
  requires-python = ">=3.9"
16
16
  dependencies = [
File without changes