@@ -466,12 +466,12 @@ def import_attachment(self, item, wordpress_namespace):
466
466
path = urlparse (url ).path
467
467
dst_path = os .path .join (* ([self .output_folder , 'files' ] + list (path .split ('/' ))))
468
468
if self .no_downloads :
469
+ LOGGER .info ("Skipping downloading {0} => {1}" .format (url , dst_path ))
470
+ else :
469
471
dst_dir = os .path .dirname (dst_path )
470
472
utils .makedirs (dst_dir )
471
473
LOGGER .info ("Downloading {0} => {1}" .format (url , dst_path ))
472
474
self .download_url_content_to_file (url , dst_path )
473
- else :
474
- LOGGER .info ("Skipping downloading {0} => {1}" .format (url , dst_path ))
475
475
dst_url = '/' .join (dst_path .split (os .sep )[2 :])
476
476
links [link ] = '/' + dst_url
477
477
links [url ] = '/' + dst_url
@@ -567,10 +567,13 @@ def add(our_key, wp_key, is_int=False, ignore_zero=False, is_float=False):
567
567
568
568
path = urlparse (url ).path
569
569
dst_path = os .path .join (* ([self .output_folder , 'files' ] + list (path .split ('/' ))))
570
- dst_dir = os .path .dirname (dst_path )
571
- utils .makedirs (dst_dir )
572
- LOGGER .info ("Downloading {0} => {1}" .format (url , dst_path ))
573
- self .download_url_content_to_file (url , dst_path )
570
+ if self .no_downloads :
571
+ LOGGER .info ("Skipping downloading {0} => {1}" .format (url , dst_path ))
572
+ else :
573
+ dst_dir = os .path .dirname (dst_path )
574
+ utils .makedirs (dst_dir )
575
+ LOGGER .info ("Downloading {0} => {1}" .format (url , dst_path ))
576
+ self .download_url_content_to_file (url , dst_path )
574
577
dst_url = '/' .join (dst_path .split (os .sep )[2 :])
575
578
links [url ] = '/' + dst_url
576
579
0 commit comments