diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1e39a852bfa5f7700cf5a59a57eb2cfe5b041c..add1c71cd46a0a13887e5648e9c42ae5be634d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### * Support for Python 3.12 -* The `linkahead` module now opts into type checking and supports mypy. +* The `linkahead` module now opts into type checking and supports mypy. ### Changed ### diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 2dc8efa221b55ae35f2cf0549bed6a5a2c1f55c1..6e1d9e8fef5e4da6f277bf2302544ef4994e3efc 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -1045,7 +1045,7 @@ out: List[Entity] return p else: - raise ValueError("pattern argument should be Entity, int or str") + raise ValueError("`pattern` argument should be an Entity, int or str.") return None @@ -3966,7 +3966,7 @@ class Container(list): else: entity._checksum = None - # FIXME: The signature of Conatiner.insert is completely different than the superclass' + # FIXME: The signature of Container.insert is completely different than the superclass' # list.insert method. This may be a problem in the future, but is ignored for now. def insert( # type: ignore self, @@ -3981,20 +3981,23 @@ class Container(list): identified, retrieved, updated, and deleted via this ID until it has been deleted. - If the insertion fails, a LinkAheadException will be raised. The server will have returned at - least one error-message describing the reason why it failed in that case (call + If the insertion fails, a LinkAheadException will be raised. The server will have returned + at least one error-message describing the reason why it failed in that case (call <this_entity>.get_all_messages() in order to get these error-messages). - Some insertions might cause warning-messages on the server-side, but the entities are inserted - anyway. Set the flag 'strict' to True in order to force the server to take all warnings as errors. - This prevents the server from inserting this entity if any warning occurs. + Some insertions might cause warning-messages on the server-side, but the entities are + inserted anyway. Set the flag 'strict' to True in order to force the server to take all + warnings as errors. This prevents the server from inserting this entity if any warning + occurs. @param strict=False: Flag for strict mode. @param sync=True: synchronize this container with the response from the server. Otherwise, - this method returns a new container with the inserted entities and leaves this container untouched. - @param unique=True: Flag for unique mode. If set to True, the server will check if the name of the - entity is unique. If not, the server will return an error. + this method returns a new container with the inserted entities and leaves + this container untouched. + @param unique=True: Flag for unique mode. If set to True, the server will check if the name + of the entity is unique. If not, the server will return an error. @param flags=None: Additional flags for the server. + """ self.clear_server_messages() @@ -4264,9 +4267,7 @@ class ACI(): e.set("role", self.role) else: if self.username is None: - raise LinkAheadException( - "An ACI must have either a role or a username." - ) + raise LinkAheadException("An ACI must have either a role or a username.") e.set("username", self.username) if self.realm is not None: