-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
26 lines (20 loc) · 766 Bytes
/
Copy pathutils.py
File metadata and controls
26 lines (20 loc) · 766 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
from typing import List, Dict, Any
class Ref:
def __init__(self, *subscripts: tuple[str]) -> None:
self.subscripts = list(subscripts)
def __eq__(self, value: object) -> bool:
if not isinstance(value, Ref):
return False
return self.subscripts == value.subscripts
def __str__(self) -> str:
return "/".join(self.subscripts)
class DIError:
def __init__(self, message: str, supplementaryData: dict = None) -> None:
self.message = message
try:
self.source = message[:message.index(":")]
except:
self.source = None
self.supplementaryData = supplementaryData
def __str__(self) -> str:
return self.message