8
8
import tarfile
9
9
import time
10
10
import asyncio
11
+ import logging
11
12
12
13
import aiohttp .web
13
14
19
20
from .common import get_download_host
20
21
21
22
23
+ LOGGER = logging .getLogger (__name__ )
24
+ LOGGER .setLevel (logging .DEBUG )
25
+
26
+
22
27
# Unlike other classes, download uses python-requests for fetching objects
23
28
# to simplify threading. Thus, timing out is not the default behavior.
24
29
@@ -341,8 +346,10 @@ def _parse_archive_fs(
341
346
# Create TarInfo for the directory
342
347
if len (path ) > 1 :
343
348
if path [0 ] in ret_fs .keys ():
349
+ LOGGER .debug (f"Skipping path { path } as added." )
344
350
continue
345
351
352
+ LOGGER .debug (f"Adding directory for { path [0 ]} { path_prefix } " )
346
353
new_info = tarfile .TarInfo (
347
354
name = get_path_from_list (
348
355
[path [0 ] + "/" ],
@@ -363,6 +370,8 @@ def _parse_archive_fs(
363
370
):
364
371
dir_contents .append (i )
365
372
373
+ LOGGER .debug (f"Dir { path [0 ]} contents: { dir_contents } " )
374
+
366
375
ret_fs [path [0 ]] = {
367
376
"name" : get_path_from_list (
368
377
[path [0 ]],
@@ -382,6 +391,7 @@ def _parse_archive_fs(
382
391
# Path of == 1 implies a file
383
392
else :
384
393
# Create file TarInfo class
394
+ LOGGER .debug (f"Adding file { path } to { path_prefix } " )
385
395
new_info = tarfile .TarInfo (name = get_path_from_list (
386
396
path ,
387
397
path_prefix
@@ -412,9 +422,9 @@ def get_object_listing(
412
422
"X-Auth-Token" : self .auth .get_token ()
413
423
}
414
424
) as req :
415
- self .fs = self ._parse_archive_fs (
416
- i .split ("/" ) for i in req .text .rstrip ().lstrip ().split ("\n " )
417
- )
425
+ self .fs = self ._parse_archive_fs ([
426
+ i .split ("/" ) for i in req .text .lstrip ().rstrip ().split ("\n " )
427
+ ] )
418
428
419
429
def sync_folders (
420
430
self ,
0 commit comments