lint: various non-semantic fixes
This commit is contained in:
parent
273dcb2a8a
commit
7a731f6999
2 changed files with 10 additions and 10 deletions
|
@ -25,13 +25,13 @@ class BRN:
|
|||
global_namespace: str = field(default_factory=global_namespace)
|
||||
|
||||
@classmethod
|
||||
def from_str(cls, s: str) -> BRN:
|
||||
parts = s.split(":")
|
||||
def from_str(cls, string: str) -> BRN:
|
||||
parts = string.split(":")
|
||||
if len(parts) != 6 or parts[0].lower() != "brn" or not is_integer(parts[2]):
|
||||
raise TypeError(f"Expected a valid BRN but got {repr(s)} (invalid parts).")
|
||||
raise TypeError(f"Expected a valid BRN but got {repr(string)} (invalid parts).")
|
||||
resource_parts = parts[5].split("/")
|
||||
if len(resource_parts) != 2:
|
||||
raise TypeError(f"Expected a valid BRN but got {repr(s)} (invalid resource parts).")
|
||||
raise TypeError(f"Expected a valid BRN but got {repr(string)} (invalid resource parts).")
|
||||
return cls(
|
||||
global_namespace=parts[1],
|
||||
group_id=int(parts[2]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue