3
3
"""
4
4
from io import BytesIO
5
5
import minio # https://docs.minio.io/docs/python-client-api-reference
6
+ import urllib3
6
7
import warnings
7
8
import uuid
8
9
from pathlib import Path
@@ -13,9 +14,28 @@ class Folder:
13
14
"""
14
15
A Folder instance manipulates a flat folder of objects within an S3-compatible object store
15
16
"""
16
- def __init__ (self , endpoint , bucket , access_key , secret_key , * , secure = False , ** _ ):
17
- self .client = minio .Minio (endpoint , access_key = access_key , secret_key = secret_key ,
18
- secure = secure )
17
+ def __init__ (self , endpoint , bucket , access_key , secret_key , * , secure = False , proxy_server = None , ** _ ):
18
+ # proxy_server: string, like "https://PROXYSERVER:PROXYPORT/"
19
+ # self.client = minio.Minio(endpoint, access_key=access_key, secret_key=secret_key,
20
+ # secure=secure)
21
+ # TODO implement proxy_server argument
22
+ http_client = urllib3 .ProxyManager (
23
+ "http://www-cache.gwdg.de:3128" ,
24
+ timeout = urllib3 .Timeout .DEFAULT_TIMEOUT ,
25
+ cert_reqs = "CERT_REQUIRED" ,
26
+ retries = urllib3 .Retry (
27
+ total = 5 ,
28
+ backoff_factor = 0.2 ,
29
+ status_forcelist = [500 , 502 , 503 , 504 ],
30
+ )
31
+ )
32
+ self .client = minio .Minio (
33
+ endpoint ,
34
+ access_key = access_key ,
35
+ secret_key = secret_key ,
36
+ secure = secure ,
37
+ http_client = http_client ,
38
+ )
19
39
self .bucket = bucket
20
40
if not self .client .bucket_exists (bucket ):
21
41
raise errors .BucketInaccessible ('Inaccessible s3 bucket %s' % bucket ) from None
0 commit comments