Skip to content
Permalink
Browse files

Fix one more occurence and incorrect if/else order

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 6, 2016
1 parent 24dc3ae commit 87286f1788653cf164f125a8f7f6b41be94321a6
Showing with 9 additions and 6 deletions.
  1. +9 −6 nikola/plugins/command/import_wordpress.py
@@ -466,12 +466,12 @@ def import_attachment(self, item, wordpress_namespace):
path = urlparse(url).path
dst_path = os.path.join(*([self.output_folder, 'files'] + list(path.split('/'))))
if self.no_downloads:
LOGGER.info("Skipping downloading {0} => {1}".format(url, dst_path))
else:
dst_dir = os.path.dirname(dst_path)
utils.makedirs(dst_dir)
LOGGER.info("Downloading {0} => {1}".format(url, dst_path))
self.download_url_content_to_file(url, dst_path)
else:
LOGGER.info("Skipping downloading {0} => {1}".format(url, dst_path))
dst_url = '/'.join(dst_path.split(os.sep)[2:])
links[link] = '/' + dst_url
links[url] = '/' + dst_url
@@ -567,10 +567,13 @@ def add(our_key, wp_key, is_int=False, ignore_zero=False, is_float=False):

path = urlparse(url).path
dst_path = os.path.join(*([self.output_folder, 'files'] + list(path.split('/'))))
dst_dir = os.path.dirname(dst_path)
utils.makedirs(dst_dir)
LOGGER.info("Downloading {0} => {1}".format(url, dst_path))
self.download_url_content_to_file(url, dst_path)
if self.no_downloads:
LOGGER.info("Skipping downloading {0} => {1}".format(url, dst_path))
else:
dst_dir = os.path.dirname(dst_path)
utils.makedirs(dst_dir)
LOGGER.info("Downloading {0} => {1}".format(url, dst_path))
self.download_url_content_to_file(url, dst_path)
dst_url = '/'.join(dst_path.split(os.sep)[2:])
links[url] = '/' + dst_url

0 comments on commit 87286f1

Please sign in to comment.
You can’t perform that action at this time.