diff sat_frontends/jp/cmd_blog.py @ 3177:f4914ce9d47d

jp (blog/edit): added `--no-publish` argument.
author Goffi <goffi@goffi.org>
date Tue, 18 Feb 2020 18:17:18 +0100
parents 559a625a236b
children 46f0b388eeea
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_blog.py	Tue Feb 18 18:17:18 2020 +0100
+++ b/sat_frontends/jp/cmd_blog.py	Tue Feb 18 18:17:18 2020 +0100
@@ -466,6 +466,10 @@
             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 @@
         # 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(