Skip to content

Commit

Permalink
Merge branch 'master' into upload60mb
Browse files Browse the repository at this point in the history
  • Loading branch information
sharevb authored Sep 6, 2024
2 parents 1e6914e + 0cbd9b4 commit c6317f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions transferwee.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _prepare_session() -> Optional[requests.Session]:
logger.debug(f"Setting x-csrf-token header to {m.group(1)}")
s.headers.update({"x-csrf-token": m.group(1)})
else:
logger.debug(f"Could not find any csrf-token")
logger.debug("Could not find any csrf-token")

return s

Expand Down Expand Up @@ -471,7 +471,7 @@ def _storm_finalize(
# error_code 'BLOCKS_STILL_EXPECTED'. Retry in that and any
# non-200 cases.
logger.debug(
f"Request against "
"Request against "
+ f"{_storm_urls(authorization)['WETRANSFER_STORM_BATCH']} "
+ f"returned {r.status_code}, retrying in {2 ** i} seconds"
)
Expand Down Expand Up @@ -560,19 +560,19 @@ def upload(
"""

# Check that all files exists
logger.debug(f"Checking that all files exists")
logger.debug("Checking that all files exists")
for f in files:
if not os.path.exists(f):
raise FileNotFoundError(f)

# Check that there are no duplicates filenames
# (despite possible different dirname())
logger.debug(f"Checking for no duplicate filenames")
logger.debug("Checking for no duplicate filenames")
filenames = [os.path.basename(f) for f in files]
if len(files) != len(set(filenames)):
raise FileExistsError("Duplicate filenames")

logger.debug(f"Preparing to upload")
logger.debug("Preparing to upload")
transfer = None
s = _prepare_session()
if not s:
Expand Down Expand Up @@ -606,7 +606,7 @@ def upload(
],
)
logger.debug(f"Get transfer id {transfer['id']}")
logger.debug(f"Doing preflight storm")
logger.debug("Doing preflight storm")
_storm_preflight(transfer["storm_upload_token"], files)
logger.debug(f"Preparing storm block upload")
prepare_data = _storm_prepare(transfer["storm_upload_token"], files)
Expand Down

0 comments on commit c6317f1

Please sign in to comment.