comparison src/plugins/plugin_blog_import.py @ 1844:489b968b3723

plugin blog_import_dokuwiki: also uses the generic image uploader from blog_import (when media_repo is empty and OPT_UPLOAD_IMAGES is True)
author souliane <souliane@mailoo.org>
date Thu, 04 Feb 2016 18:56:53 +0100
parents cdecf553e051
children 569c48e4cf0d
comparison
equal deleted inserted replaced
1843:a51355982f11 1844:489b968b3723
279 parsed_host = urlparse.urlsplit(opt_host) 279 parsed_host = urlparse.urlsplit(opt_host)
280 opt_host = urlparse.urlunsplit((parsed_host.scheme or 'http', parsed_host.netloc or parsed_host.path, '', '', '')) 280 opt_host = urlparse.urlunsplit((parsed_host.scheme or 'http', parsed_host.netloc or parsed_host.path, '', '', ''))
281 281
282 tmp_dir = tempfile.mkdtemp() 282 tmp_dir = tempfile.mkdtemp()
283 try: 283 try:
284 # TODO: would be nice to also update the hyperlinks to these images, e.g. when you have <a href="{url}"><img src="{url}"></a>
284 for img_elt in xml_tools.findAll(top_elt, ['img']): 285 for img_elt in xml_tools.findAll(top_elt, ['img']):
285 yield self.imgFilters(client, img_elt, options, opt_host, tmp_dir) 286 yield self.imgFilters(client, img_elt, options, opt_host, tmp_dir)
286 finally: 287 finally:
287 os.rmdir(tmp_dir) # XXX: tmp_dir should be empty, or something went wrong 288 os.rmdir(tmp_dir) # XXX: tmp_dir should be empty, or something went wrong
288 289