comparison sat_frontends/jp/cmd_blog.py @ 3958:e2a5f2f5e57b

cli (blog/set): new `--sign` argument: rel 381
author Goffi <goffi@goffi.org>
date Fri, 28 Oct 2022 18:47:17 +0200
parents 5980ea188f87
children 570254d5a798
comparison
equal deleted inserted replaced
3957:b8ab6da58ac8 3958:e2a5f2f5e57b
175 ) 175 )
176 self.parser.add_argument( 176 self.parser.add_argument(
177 "-e", 177 "-e",
178 "--encrypt", 178 "--encrypt",
179 action="store_true", 179 action="store_true",
180 help=_("end-to-end encrypt the blog item") 180 help=_("end-to-end encrypt the blog post")
181 )
182 self.parser.add_argument(
183 "-X",
184 "--sign",
185 action="store_true",
186 help=_("cryptographically sign the blog post")
181 ) 187 )
182 188
183 async def setMbDataContent(self, content, mb_data): 189 async def setMbDataContent(self, content, mb_data):
184 if self.default_syntax_used: 190 if self.default_syntax_used:
185 # default syntax has been used 191 # default syntax has been used
204 mb_data["title"] = self.args.title 210 mb_data["title"] = self.args.title
205 if self.args.language is not None: 211 if self.args.language is not None:
206 mb_data["language"] = self.args.language 212 mb_data["language"] = self.args.language
207 if self.args.encrypt: 213 if self.args.encrypt:
208 mb_data["encrypted"] = True 214 mb_data["encrypted"] = True
215 if self.args.sign:
216 mb_data["signed"] = True
209 217
210 218
211 class Set(base.CommandBase, BlogPublishCommon): 219 class Set(base.CommandBase, BlogPublishCommon):
212 def __init__(self, host): 220 def __init__(self, host):
213 base.CommandBase.__init__( 221 base.CommandBase.__init__(