Skip to content
Permalink
Browse files

flake8

  • Loading branch information
ralsina committed Jun 11, 2015
1 parent d80bba2 commit 26faaddce9781553d0ada6dac84ab7bc94a1b5c7
Showing with 9 additions and 7 deletions.
  1. +9 −7 v7/import_gplus/import_gplus.py
@@ -25,18 +25,19 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import unicode_literals, print_function
import datetime
import json
import os
import time
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse # NOQA
from zipfile import ZipFile

import dateutil
import micawber
try:
import micawber
except ImportError:
micawber = None # NOQA

from nikola.plugin_categories import Command
from nikola import utils
@@ -65,6 +66,9 @@ def _execute(self, options, args):
print(self.help())
return

if micawber is None:
req_missing(['micawber'], 'import from Google+')

options['filename'] = args[0]
self.export_file = options['filename']
self.output_folder = options['output_folder']
@@ -75,7 +79,7 @@ def _execute(self, options, args):
gplus_names = [x for x in zipfile.namelist() if '/Google+ Stream/' in x]
self.context = self.populate_context(zipfile, gplus_names)
conf_template = self.generate_base_site()
self.write_configuration(self.get_configuration_output_path(), conf_template.render(**prepare_config(self.context)))
self.write_configuration(self.get_configuration_output_path(), conf_template.render(**prepare_config(self.context)))
self.import_posts(zipfile, gplus_names)

@staticmethod
@@ -132,9 +136,7 @@ def import_posts(self, zipfile, names):
content += '\n<div> {} </div>\n'.format(micawber.parse_text(obj["url"], providers))

tags = []
self.write_metadata(os.path.join(self.output_folder, out_folder,
slug + '.meta'),
title, slug, post_date, description, tags)
self.write_metadata(os.path.join(self.output_folder, out_folder, slug + '.meta'), title, slug, post_date, description, tags)
self.write_content(
os.path.join(self.output_folder, out_folder, slug + '.html'),
content)

0 comments on commit 26faadd

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