forked from ni/nilrt-snac
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
28 lines (20 loc) · 785 Bytes
/
__init__.py
File metadata and controls
28 lines (20 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""nilrt-snac."""
import logging
import pathlib
from enum import IntEnum
__version__ = "3.0.0"
SNAC_DATA_DIR = pathlib.Path(__file__).resolve().parents[3] / "share" / "nilrt-snac"
logger = logging.getLogger(__package__)
logger.addHandler(logging.NullHandler())
class Errors(IntEnum): # noqa: D101 - Missing docstring in public class (auto-generated noqa)
EX_OK = 0
EX_ERROR = 1
EX_USAGE = 2
EX_BAD_ENVIRONMENT = 128
EX_CHECK_FAILURE = 129
class SNACError(Exception): # noqa: D101 - Missing docstring in public class (auto-generated noqa)
def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa)
self, message, return_code=Errors.EX_ERROR
):
super().__init__(message)
self.return_code = return_code