Fix a couple of type issues
This commit is contained in:
parent
5a048f7ae8
commit
daa920c845
2 changed files with 4 additions and 4 deletions
|
|
@ -69,7 +69,7 @@ class BuildsDb:
|
||||||
return None
|
return None
|
||||||
return self._build_from_row(row)
|
return self._build_from_row(row)
|
||||||
|
|
||||||
def remove(self, name: str) -> None:
|
def remove(self, name: str) -> bool:
|
||||||
if self.get(name) is None:
|
if self.get(name) is None:
|
||||||
return False # no change
|
return False # no change
|
||||||
with self._con:
|
with self._con:
|
||||||
|
|
@ -77,7 +77,7 @@ class BuildsDb:
|
||||||
_logger.info("Noticed removal of %s", name)
|
_logger.info("Noticed removal of %s", name)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def add(self, build: Build) -> None:
|
def add(self, build: Build) -> bool:
|
||||||
prev_build = self.get(build.name)
|
prev_build = self.get(build.name)
|
||||||
if prev_build == build:
|
if prev_build == build:
|
||||||
return False # no change
|
return False # no change
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ class Build(BaseModel):
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"{self.slug} ({self.name})"
|
return f"{self.slug} ({self.name})"
|
||||||
|
|
||||||
def __eq__(self, other: "Build") -> bool:
|
def __eq__(self, other: object) -> bool:
|
||||||
if other is None:
|
if not isinstance(other, Build):
|
||||||
return False
|
return False
|
||||||
if self.name != other.name:
|
if self.name != other.name:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue