WinColl 0.9.6__py3-none-any.whl

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.
wincoll/splat.png ADDED
Binary file
wincoll/title.png ADDED
Binary file
@@ -0,0 +1,29 @@
1
+ """
2
+ Warning and error routines.
3
+ Copyright (c) Reuben Thomas 2023.
4
+ Released under the GPL version 3, or (at your option) any later version.
5
+ """
6
+
7
+ import sys
8
+ from warnings import warn
9
+ from typing import Callable, Optional, Union, Type, NoReturn, TextIO
10
+
11
+
12
+ # Error messages
13
+ def simple_warning(prog: str) -> Callable[..., None]:
14
+ def _warning( # pylint: disable=too-many-arguments
15
+ message: Union[Warning, str],
16
+ category: Type[Warning], # pylint: disable=unused-argument
17
+ filename: str, # pylint: disable=unused-argument
18
+ lineno: int, # pylint: disable=unused-argument
19
+ file: Optional[TextIO] = sys.stderr,
20
+ line: Optional[str] = None, # pylint: disable=unused-argument
21
+ ) -> None:
22
+ print(f"{prog}: {message}", file=file or sys.stderr)
23
+
24
+ return _warning
25
+
26
+
27
+ def die(msg: str, code: Optional[int] = 1) -> NoReturn:
28
+ warn(msg)
29
+ sys.exit(code)