comparison sat_frontends/jp/cmd_blog.py @ 3097:2a7dfe43b161

jp (blog): added --language to common publish argument
author Goffi <goffi@goffi.org>
date Fri, 20 Dec 2019 14:23:42 +0100
parents d9f328374473
children 9d0df638c8b4
comparison
equal deleted inserted replaced
3096:98015e4b346e 3097:2a7dfe43b161
140 "-t", 140 "-t",
141 "--tag", 141 "--tag",
142 action="append", 142 action="append",
143 help=_("tag (category) of your item"), 143 help=_("tag (category) of your item"),
144 ) 144 )
145 self.parser.add_argument(
146 "-l",
147 "--language",
148 help=_("language of the item (ISO 639 code)"),
149 )
145 150
146 comments_group = self.parser.add_mutually_exclusive_group() 151 comments_group = self.parser.add_mutually_exclusive_group()
147 comments_group.add_argument( 152 comments_group.add_argument(
148 "-C", "--comments", action="store_const", const=True, dest="comments", 153 "-C", "--comments", action="store_const", const=True, dest="comments",
149 help=_("enable comments (default: comments not enabled except if they " 154 help=_("enable comments (default: comments not enabled except if they "
180 mb_data["allow_comments"] = self.args.comments 185 mb_data["allow_comments"] = self.args.comments
181 if self.args.tag: 186 if self.args.tag:
182 mb_data['tags'] = self.args.tag 187 mb_data['tags'] = self.args.tag
183 if self.args.title is not None: 188 if self.args.title is not None:
184 mb_data["title"] = self.args.title 189 mb_data["title"] = self.args.title
190 if self.args.language is not None:
191 mb_data["language"] = self.args.language
185 192
186 193
187 class Set(base.CommandBase, BlogPublishCommon): 194 class Set(base.CommandBase, BlogPublishCommon):
188 def __init__(self, host): 195 def __init__(self, host):
189 base.CommandBase.__init__( 196 base.CommandBase.__init__(