jp (blog/edit): added --no-publish argument.
This commit is contained in:
parent
8812915d4e
commit
3d8ef1d625
1 changed files with 12 additions and 5 deletions
|
|
@ -466,6 +466,10 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
|
|||
action="store_true",
|
||||
help=_("launch a blog preview in parallel"),
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"--no-publish",
|
||||
help=_('add "publish: False" to metadata'),
|
||||
)
|
||||
|
||||
def buildMetadataFile(self, content_file_path, mb_data=None):
|
||||
"""Build a metadata file using json
|
||||
|
|
@ -506,6 +510,9 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
|
|||
# and override metadata with command-line arguments
|
||||
self.setMbDataFromArgs(mb_data)
|
||||
|
||||
if self.args.no_publish is not None:
|
||||
mb_data["publish"] = False
|
||||
|
||||
# then we create the file and write metadata there, as JSON dict
|
||||
# XXX: if we port jp one day on Windows, O_BINARY may need to be added here
|
||||
with os.fdopen(
|
||||
|
|
|
|||
Loading…
Reference in a new issue