Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement #2262 #2292

Merged
merged 4 commits into from Mar 9, 2016
Merged

Implement #2262 #2292

merged 4 commits into from Mar 9, 2016

Conversation

ralsina
Copy link
Member

@ralsina ralsina commented Mar 8, 2016

Adds the --one-file option to the wordpress importer to make it use one-file posts.

@@ -827,7 +827,7 @@ def __init__(self, **config):
# Set persistent state facility
self.state = Persistor(os.path.join('state_data.json'))

# Set cache facility
# Set cache 0facility
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what’s a 0facility?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a "Roberto has really fat fingers"

"tags": ','.join(tags),
}
meta.update(other_meta)
if self.onefile:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not pass self.onefile as another argument to write_post, so that all importer plugins can use write_post for both single and non-single file output? Now all importer plugins which want to support both ways have to do such a rather long and tedious if-then-else statement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because compilers don't support saving in 2 files and I don't want to chase
that right now.

El mar., mar. 8, 2016 19:38, Felix Fontein notifications@github.com
escribió:

In nikola/plugins/command/import_wordpress.py
#2292 (comment):

  •                                title, meta_slug, post_date, description, tags, **other_meta)
    
  •            self.write_content(
    
  •                os.path.join(self.output_folder,
    
  •                             out_folder, out_content_filename),
    
  •                content,
    
  •                rewrite_html)
    
  •            meta = {
    
  •                "title": title,
    
  •                "slug": meta_slug,
    
  •                "date": post_date,
    
  •                "description": description,
    
  •                "tags": ','.join(tags),
    
  •            }
    
  •            meta.update(other_meta)
    
  •            if self.onefile:
    

Why not pass self.onefile as another argument to write_post, so that all
importer plugins can use write_post for both single and non-single file
output? Now all importer plugins which want to support both ways have to do
such a rather complex if-then-else statement.


Reply to this email directly or view it on GitHub
https://github.com/getnikola/nikola/pull/2292/files#r55441307.

@ralsina
Copy link
Member Author

ralsina commented Mar 9, 2016

Duly noted the problem of classmethods and the need to make write_post support both 1 and 2-file saves but those problems are not really related to this branch. Merging.

ralsina added a commit that referenced this pull request Mar 9, 2016
@ralsina ralsina merged commit 4d6d725 into master Mar 9, 2016
@ralsina ralsina deleted the import_wordpress_single_file branch March 9, 2016 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants