From b61b0f58d443f5906494c2ff86828fcfa783ecb4 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 18 Jan 2016 20:09:00 -0800 Subject: [PATCH 1/7] default --output to content Currrently the default output folder is output, and this conflicts with the usage of the output folder as the output from pelican. Instead the imported posts should go into the content folder. --- pelican/tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 204ab7b0..84026e31 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -789,9 +789,9 @@ def main(): parser.add_argument( '-o', '--output', dest='output', default='output', help='Output path') - parser.add_argument( - '-m', '--markup', dest='markup', default='rst', - help='Output markup format (supports rst & markdown)') + parser.add_argument('-o', '--output', dest='output', default='content', + help=('Where to output the generated markup files. If not specified, a ' + 'directory will be created, named "content" in the current path.')) parser.add_argument( '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') From 3c2228f593529a00e8b4aa12035156f7a2c1abb2 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 18 Jan 2016 20:12:07 -0800 Subject: [PATCH 2/7] --output defaults to content Added the new -h output and updated the examples. --- docs/importer.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/importer.rst b/docs/importer.rst index 83f4e112..f1303b4c 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -63,7 +63,9 @@ Optional arguments --tumblr Tumblr API (default: False) --feed Feed to parse (default: False) -o OUTPUT, --output OUTPUT - Output path (default: output) + Where to output the generated markup files. If not + specified, a directory will be created, named + "content" in the current path. (default: content) -m MARKUP, --markup MARKUP Output markup format (supports rst & markdown) (default: rst) @@ -92,19 +94,19 @@ Examples For WordPress:: - $ pelican-import --wpfile -o ~/output ~/posts.xml + $ pelican-import --wpfile ~/posts.xml For Dotclear:: - $ pelican-import --dotclear -o ~/output ~/backup.txt + $ pelican-import --dotclear -o ~/markup-files ~/backup.txt for Posterous:: - $ pelican-import --posterous -o ~/output --email= --password= + $ pelican-import --posterous -o ~/content --email= --password= For Tumblr:: - $ pelican-import --tumblr -o ~/output --blogname= + $ pelican-import --tumblr -o ~/content --blogname= Tests ===== From 973ae8b6d16d6ba2c1f3ddbb9ec092c99af3666e Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 18 Jan 2016 20:43:16 -0800 Subject: [PATCH 3/7] Update pelican_import.py --- pelican/tools/pelican_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 84026e31..81bbc672 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -790,8 +790,9 @@ def main(): '-o', '--output', dest='output', default='output', help='Output path') parser.add_argument('-o', '--output', dest='output', default='content', - help=('Where to output the generated markup files. If not specified, a ' - 'directory will be created, named "content" in the current path.')) + help=('Where to output the generated markup files. If not specified, ' + 'a directory will be created, named "content" in the current ' + 'path.')) parser.add_argument( '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') From c58406f71cce67f820842eca810563dd786f1e9a Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 19 Jan 2016 11:30:28 -0800 Subject: [PATCH 4/7] minor whitespace fix --- pelican/tools/pelican_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 81bbc672..8e3db4c2 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -791,8 +791,8 @@ def main(): help='Output path') parser.add_argument('-o', '--output', dest='output', default='content', help=('Where to output the generated markup files. If not specified, ' - 'a directory will be created, named "content" in the current ' - 'path.')) + 'a directory will be created, named "content" in the current ' + 'path.')) parser.add_argument( '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') From a907fbadc877d5acc55633e77d6d6193b46867a0 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 19 Jan 2016 11:39:24 -0800 Subject: [PATCH 5/7] minor whitespace fix --- pelican/tools/pelican_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 8e3db4c2..d16bff38 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -789,7 +789,8 @@ def main(): parser.add_argument( '-o', '--output', dest='output', default='output', help='Output path') - parser.add_argument('-o', '--output', dest='output', default='content', + parser.add_argument( + '-o', '--output', dest='output', default='content', help=('Where to output the generated markup files. If not specified, ' 'a directory will be created, named "content" in the current ' 'path.')) From fbff4cc8bb1fc37ff0628f042c21a8a954dccd98 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 20 Jan 2016 13:25:53 -0800 Subject: [PATCH 6/7] add --markup back to the file Added --markup back and removed duplicate --output --- pelican/tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index d16bff38..5315a408 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -786,14 +786,14 @@ def main(): parser.add_argument( '--feed', action='store_true', dest='feed', help='Feed to parse') - parser.add_argument( - '-o', '--output', dest='output', default='output', - help='Output path') parser.add_argument( '-o', '--output', dest='output', default='content', help=('Where to output the generated markup files. If not specified, ' 'a directory will be created, named "content" in the current ' 'path.')) + parser.add_argument( + '-m', '--markup', dest='markup', default='rst', + help='Output markup format (supports rst & markdown)') parser.add_argument( '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') From 46f03589359ab74a7d667aef5bb2a2c33d00135d Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 20 Jan 2016 13:25:53 -0800 Subject: [PATCH 7/7] add --markup back to the file Added --markup back and removed duplicate --output --- pelican/tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index d16bff38..5315a408 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -786,14 +786,14 @@ def main(): parser.add_argument( '--feed', action='store_true', dest='feed', help='Feed to parse') - parser.add_argument( - '-o', '--output', dest='output', default='output', - help='Output path') parser.add_argument( '-o', '--output', dest='output', default='content', help=('Where to output the generated markup files. If not specified, ' 'a directory will be created, named "content" in the current ' 'path.')) + parser.add_argument( + '-m', '--markup', dest='markup', default='rst', + help='Output markup format (supports rst & markdown)') parser.add_argument( '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name')