mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-20 11:38:52 +00:00
Lint and mypy fixes.
This commit is contained in:
parent
ca0f311861
commit
c3a304e1cc
@ -586,7 +586,7 @@ class StorageClientImmutables(object):
|
||||
)
|
||||
|
||||
@inlineCallbacks
|
||||
def list_shares(self, storage_index): # type: (bytes,) -> Deferred[set[int]]
|
||||
def list_shares(self, storage_index: bytes) -> Deferred[set[int]]:
|
||||
"""
|
||||
Return the set of shares for a given storage index.
|
||||
"""
|
||||
|
@ -3,7 +3,7 @@ HTTP server for storage.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Dict, List, Set, Tuple, Any, Callable
|
||||
from typing import Dict, List, Set, Tuple, Any, Callable, Optional
|
||||
|
||||
from functools import wraps
|
||||
from base64 import b64decode
|
||||
@ -274,7 +274,7 @@ _SCHEMAS = {
|
||||
}
|
||||
|
||||
|
||||
def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes]:
|
||||
def read_range(request, read_data: Callable[[int, int], bytes]) -> Optional[bytes]:
|
||||
"""
|
||||
Parse the ``Range`` header, read appropriately, return as result.
|
||||
|
||||
@ -298,7 +298,7 @@ def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes]
|
||||
data = read_data(start, start + 65536)
|
||||
if not data:
|
||||
request.finish()
|
||||
return
|
||||
return None
|
||||
request.write(data)
|
||||
start += len(data)
|
||||
|
||||
|
@ -1105,7 +1105,7 @@ class SharedImmutableMutableTestsMixin:
|
||||
general_client: StorageClientGeneral
|
||||
client: Union[StorageClientImmutables, StorageClientMutables]
|
||||
clientFactory: Callable[
|
||||
StorageClient, Union[StorageClientImmutables, StorageClientMutables]
|
||||
[StorageClient], Union[StorageClientImmutables, StorageClientMutables]
|
||||
]
|
||||
|
||||
def upload(self, share_number: int, data_length=26) -> Tuple[bytes, bytes, bytes]:
|
||||
|
Loading…
Reference in New Issue
Block a user