Skip to content

Commit d191eab

Browse files
committed
Pass proxy argument to upload functions
Added the proxy parameter to calls to upload_files and upload_files_parallel in DVUploader to ensure proxy settings are used during uploads. Also improved import ordering for consistency.
1 parent ae60bf1 commit d191eab

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

dvuploader/dvuploader.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import asyncio
2-
from urllib.parse import urljoin
3-
import httpx
42
import os
5-
import rich
63
from typing import Dict, List, Optional
4+
from urllib.parse import urljoin
75

6+
import httpx
7+
import rich
88
from pydantic import BaseModel
9-
from rich.progress import Progress
10-
from rich.table import Table
119
from rich.console import Console
1210
from rich.panel import Panel
11+
from rich.progress import Progress
12+
from rich.table import Table
1313

1414
from dvuploader.directupload import (
1515
TICKET_ENDPOINT,
@@ -146,6 +146,7 @@ def upload(
146146
n_parallel_uploads=n_parallel_uploads,
147147
progress=progress,
148148
pbars=pbars,
149+
proxy=proxy,
149150
)
150151
)
151152
else:
@@ -159,6 +160,7 @@ def upload(
159160
pbars=pbars,
160161
progress=progress,
161162
n_parallel_uploads=n_parallel_uploads,
163+
proxy=proxy,
162164
)
163165
)
164166

@@ -249,11 +251,15 @@ def _check_duplicates(
249251
file._unchanged_data = self._check_hashes(file, ds_file)
250252
if file._unchanged_data:
251253
table.add_row(
252-
file.file_name, "[bright_cyan]Exists", "[bright_black]Replace Meta"
254+
file.file_name,
255+
"[bright_cyan]Exists",
256+
"[bright_black]Replace Meta",
253257
)
254258
else:
255259
table.add_row(
256-
file.file_name, "[bright_cyan]Exists", "[bright_black]Replace"
260+
file.file_name,
261+
"[bright_cyan]Exists",
262+
"[bright_black]Replace",
257263
)
258264
else:
259265
table.add_row(

0 commit comments

Comments
 (0)