generated from jCloud/repository-template
style: ensure trailing commas in multi-line statements
This commit is contained in:
30 files changed
+1778
-1774
No files matched your search
@@ -16,7 +16,7 @@ from __future__ import annotations
|
||||
from ...exceptions import (
|
||||
InvalidNamespaceError,
|
||||
NamespaceNotFoundError,
|
||||
NamespaceExistsError
|
||||
NamespaceExistsError,
|
||||
)
|
||||
from ...utils import assert_that_is_instance
|
||||
from typing import Union, TypeAlias, Dict, List
|
||||
@@ -24,7 +24,7 @@ from typing import Union, TypeAlias, Dict, List
|
||||
__all__ = [
|
||||
'PythonNamespace',
|
||||
'PythonPackageNamespace',
|
||||
'PythonModuleNamespace'
|
||||
'PythonModuleNamespace',
|
||||
]
|
||||
|
||||
class PythonNamespace:
|
||||
@@ -40,7 +40,7 @@ class PythonNamespace:
|
||||
if not name.strip():
|
||||
raise InvalidNamespaceError(
|
||||
'invalid namespace',
|
||||
namespace_identifier = name
|
||||
namespace_identifier = name,
|
||||
)
|
||||
|
||||
self.name = name
|
||||
@@ -52,8 +52,8 @@ PythonPackageNamespaceDictType: TypeAlias = Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
'PythonPackageNamespaceDictType'
|
||||
]
|
||||
'PythonPackageNamespaceDictType',
|
||||
],
|
||||
]
|
||||
|
||||
class PythonPackageNamespace(PythonNamespace):
|
||||
@@ -69,7 +69,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
sub_namespaces: List[PythonNamespace]
|
||||
sub_namespaces: List[PythonNamespace],
|
||||
) -> None:
|
||||
assert_that_is_instance(sub_namespaces, list)
|
||||
|
||||
@@ -113,7 +113,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
|
||||
def _sub_namespaces_names(
|
||||
self,
|
||||
package: PythonPackageNamespace
|
||||
package: PythonPackageNamespace,
|
||||
) -> PythonPackageNamespaceDictType:
|
||||
'''
|
||||
Returns the names of all sub-namespaces of the specified package
|
||||
@@ -177,7 +177,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
|
||||
raise NamespaceNotFoundError(
|
||||
'no such namespace',
|
||||
namespace_identifier = name
|
||||
namespace_identifier = name,
|
||||
)
|
||||
|
||||
def add(self, namespace: PythonNamespace) -> None:
|
||||
@@ -195,7 +195,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
self.__getitem__(namespace.name)
|
||||
raise NamespaceExistsError(
|
||||
'namespace already exists',
|
||||
namespace_identifier = namespace.name
|
||||
namespace_identifier = namespace.name,
|
||||
)
|
||||
except NamespaceNotFoundError:
|
||||
self._sub_namespaces.append(namespace)
|
||||
|
||||
Reference in new issue
Block a user