-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from reef-technologies/download_to_stdout
Download to stdout
- Loading branch information
Showing
22 changed files
with
517 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
###################################################################### | ||
# | ||
# File: b2sdk/_internal/__init__.py | ||
# | ||
# Copyright 2023 Backblaze Inc. All Rights Reserved. | ||
# | ||
# License https://www.backblaze.com/using_b2_code.html | ||
# | ||
###################################################################### | ||
""" | ||
b2sdk._internal package contains internal modules, and should not be used directly. | ||
Please use chosen apiver package instead, e.g. b2sdk.v2 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
###################################################################### | ||
# | ||
# File: b2sdk/_internal/utils/__init__.py | ||
# | ||
# Copyright 2023 Backblaze Inc. All Rights Reserved. | ||
# | ||
# License https://www.backblaze.com/using_b2_code.html | ||
# | ||
###################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
###################################################################### | ||
# | ||
# File: b2sdk/_internal/utils/filesystem.py | ||
# | ||
# Copyright 2023 Backblaze Inc. All Rights Reserved. | ||
# | ||
# License https://www.backblaze.com/using_b2_code.html | ||
# | ||
###################################################################### | ||
import pathlib | ||
import platform | ||
import stat | ||
|
||
_IS_WINDOWS = platform.system() == "Windows" | ||
|
||
|
||
def points_to_fifo(path: pathlib.Path) -> bool: | ||
"""Check if the path points to a fifo.""" | ||
path = path.resolve() | ||
try: | ||
|
||
return stat.S_ISFIFO(path.stat().st_mode) | ||
except OSError: | ||
return False | ||
|
||
|
||
_STDOUT_FILENAME = "CON" if _IS_WINDOWS else "/dev/stdout" | ||
STDOUT_FILEPATH = pathlib.Path(_STDOUT_FILENAME) | ||
|
||
|
||
def points_to_stdout(path: pathlib.Path) -> bool: | ||
"""Check if the path points to stdout.""" | ||
try: | ||
return path == STDOUT_FILEPATH or path.resolve() == STDOUT_FILEPATH | ||
except OSError: | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.