@@ -453,11 +453,13 @@ def import_attachment(self, item, wordpress_namespace):
453
453
links [link ] = '/' + dst_url
454
454
links [url ] = '/' + dst_url
455
455
456
- return [path ] + self .download_additional_image_sizes (
456
+ result = {}
457
+ result ['files' ] = [path ] + self .download_additional_image_sizes (
457
458
item ,
458
459
wordpress_namespace ,
459
460
os .path .dirname (url )
460
461
)
462
+ return result
461
463
462
464
def download_additional_image_sizes (self , item , wordpress_namespace , source_path ):
463
465
if phpserialize is None :
@@ -835,12 +837,12 @@ def process_item_if_attachment(self, item):
835
837
wordpress_namespace , post_type , post_id , parent_id = self ._extract_item_info (item )
836
838
837
839
if post_type == 'attachment' :
838
- files = self .import_attachment (item , wordpress_namespace )
840
+ data = self .import_attachment (item , wordpress_namespace )
839
841
# If parent was found, store relation with imported files
840
842
if parent_id is not None and int (parent_id ) != 0 :
841
- self .attachments [int (parent_id )][post_id ] = files
843
+ self .attachments [int (parent_id )][post_id ] = data
842
844
else :
843
- LOGGER .warn ("Attachment #{0} ({1}) has no parent!" .format (post_id , files ))
845
+ LOGGER .warn ("Attachment #{0} ({1}) has no parent!" .format (post_id , data [ ' files' ] ))
844
846
845
847
def write_attachments_info (self , path , attachments ):
846
848
with io .open (path , "wb" ) as file :
0 commit comments