Skip to content

Commit d6148cb

Browse files
committed
Miscellaneous cleanup from ipfs-shipyard#260 and ipfs-shipyard#262
1 parent 6b35fe8 commit d6148cb

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

ipfshttpclient/client/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
VERSION_BLACKLIST = []
2222
VERSION_MAXIMUM = "0.9.0"
2323

24+
from . import base
2425
from . import bitswap
2526
from . import block
2627
from . import bootstrap
@@ -90,7 +91,7 @@ def connect(
9091
headers: http.headers_t = {},
9192
timeout: http.timeout_t = 120,
9293

93-
# Backward-compat
94+
# Backward-compatibility
9495
username: ty.Optional[str] = None,
9596
password: ty.Optional[str] = None
9697
):
@@ -109,6 +110,7 @@ def connect(
109110
All parameters are identical to those passed to the constructor of the
110111
:class:`~ipfshttpclient.Client` class.
111112
"""
113+
112114
# Create client instance
113115
client = Client(
114116
addr, base,

ipfshttpclient/filescanner.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
else: #PY36-
2121
re_pattern_t = re_pattern_type = type(re.compile(""))
2222

23-
2423
# Windows does not have os.O_DIRECTORY
2524
O_DIRECTORY: int = getattr(os, "O_DIRECTORY", 0)
2625

27-
2826
# Neither Windows nor MacOS have os.fwalk even through Python 3.9
2927
HAVE_FWALK: bool = hasattr(os, "fwalk")
3028
HAVE_FWALK_BYTES = HAVE_FWALK and sys.version_info >= (3, 7)

ipfshttpclient/http.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
PREFER_HTTPX = (os.environ.get("PY_IPFS_HTTP_CLIENT_PREFER_HTTPX", "no").lower()
2121
not in ("0", "f", "false", "n", "no"))
2222
if PREFER_HTTPX: # pragma: http-backend=httpx
23-
try: #PY36+
23+
try:
2424
from . import http_httpx as _backend
25-
except (ImportError, SyntaxError): #PY35
25+
except ImportError:
2626
from . import http_requests as _backend # type: ignore[no-redef]
2727
else: # pragma: http-backend=requests
2828
try:
2929
from . import http_requests as _backend # type: ignore[no-redef]
3030
except ImportError: # pragma: no cover
3131
from . import http_httpx as _backend
3232

33-
ClientSync = _backend.ClientSync
33+
ClientSync = _backend.ClientSync

ipfshttpclient/http_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def download(
639639
args
640640
Positional parameters to be sent along with the HTTP request
641641
opts
642-
Query string paramters to be sent along with the HTTP request
642+
Query string parameters to be sent along with the HTTP request
643643
compress
644644
Whether the downloaded file should be GZip compressed by the
645645
daemon before being sent to the client

ipfshttpclient/multipart.py

+1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ def __init__(self, directory: ty.Union[ty.AnyStr, utils.PathLike[ty.AnyStr], int
397397

398398
# Figure out the absolute path of the directory added
399399
self.abspath = None
400+
400401
if not isinstance(directory, int):
401402
self.abspath = os.path.abspath(directory)
402403

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@ classifiers = [
5151

5252
[tool.flit.metadata.urls]
5353
Documentation = "https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/docs/"
54-

0 commit comments

Comments
 (0)