Skip to content

Commit

Permalink
Miscellaneous cleanup from #260 and #262
Browse files Browse the repository at this point in the history
  • Loading branch information
c0llab0rat0r authored and ntninja committed Apr 17, 2021
1 parent 89737bd commit 6524062
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 3 additions & 1 deletion ipfshttpclient/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
VERSION_BLACKLIST = []
VERSION_MAXIMUM = "0.9.0"

from . import base
from . import bitswap
from . import block
from . import bootstrap
Expand Down Expand Up @@ -90,7 +91,7 @@ def connect(
headers: http.headers_t = {},
timeout: http.timeout_t = 120,

# Backward-compat
# Backward-compatibility
username: ty.Optional[str] = None,
password: ty.Optional[str] = None
):
Expand All @@ -109,6 +110,7 @@ def connect(
All parameters are identical to those passed to the constructor of the
:class:`~ipfshttpclient.Client` class.
"""

# Create client instance
client = Client(
addr, base,
Expand Down
2 changes: 0 additions & 2 deletions ipfshttpclient/filescanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
else: #PY36-
re_pattern_t = re_pattern_type = type(re.compile(""))


# Windows does not have os.O_DIRECTORY
O_DIRECTORY: int = getattr(os, "O_DIRECTORY", 0)


# Neither Windows nor MacOS have os.fwalk even through Python 3.9
HAVE_FWALK: bool = hasattr(os, "fwalk")
HAVE_FWALK_BYTES = HAVE_FWALK and sys.version_info >= (3, 7)
Expand Down
6 changes: 3 additions & 3 deletions ipfshttpclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
PREFER_HTTPX = (os.environ.get("PY_IPFS_HTTP_CLIENT_PREFER_HTTPX", "no").lower()
not in ("0", "f", "false", "n", "no"))
if PREFER_HTTPX: # pragma: http-backend=httpx
try: #PY36+
try:
from . import http_httpx as _backend
except (ImportError, SyntaxError): #PY35
except ImportError:
from . import http_requests as _backend # type: ignore[no-redef]
else: # pragma: http-backend=requests
try:
from . import http_requests as _backend # type: ignore[no-redef]
except ImportError: # pragma: no cover
from . import http_httpx as _backend

ClientSync = _backend.ClientSync
ClientSync = _backend.ClientSync
2 changes: 1 addition & 1 deletion ipfshttpclient/http_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def download(
args
Positional parameters to be sent along with the HTTP request
opts
Query string paramters to be sent along with the HTTP request
Query string parameters to be sent along with the HTTP request
compress
Whether the downloaded file should be GZip compressed by the
daemon before being sent to the client
Expand Down
1 change: 1 addition & 0 deletions ipfshttpclient/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def __init__(self, directory: ty.Union[ty.AnyStr, utils.PathLike[ty.AnyStr], int

# Figure out the absolute path of the directory added
self.abspath = None

if not isinstance(directory, int):
self.abspath = os.path.abspath(directory)

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ classifiers = [

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

0 comments on commit 6524062

Please sign in to comment.