Skip to content

Commit

Permalink
Fix some pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Borgvall committed Jul 22, 2024
1 parent b5a99c0 commit 234b633
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bottles/backend/models/btrfssubvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create_bare_destination() -> DuplicateResult:
return DuplicateResult.NOTHING
case btrfsutil.ERROR_SNAP_CREATE_FAILED:
return create_bare_destination()
case other:
case _:
raise error
for internal_subvolume in _internal_subvolumes:
internal_source_path = os.path.join(source_path, internal_subvolume)
Expand Down Expand Up @@ -171,9 +171,9 @@ def read_active_snapshot_id(self) -> int:
try:
with open(self._active_snapshot_id_path(), "r") as file:
return int(file.read())
except OSError as error:
except OSError:
return -1

def create_snapshot(self, description: str) -> int:
snapshot_id = max(self._snapshots.keys(), default=-1) + 1
snapshot_path = self._snapshot_path2(snapshot_id, description)
Expand Down Expand Up @@ -232,7 +232,7 @@ def convert_states(self):

def is_initialized(self):
# Nothing to initialize
return true
return True

def re_initialize(self):
# Nothing to initialize
Expand All @@ -257,12 +257,11 @@ def list_states(self) -> Result:
data={"state_id": active_state_id, "states": self.convert_states()},
message="Retrieved list of states",
)

def set_state(
self, state_id: int, after: callable
) -> Result:
self._handle.set_state(state_id)
if after:
after()
return Result(True)

0 comments on commit 234b633

Please sign in to comment.