# HG changeset patch # User Goffi # Date 1557075035 -7200 # Node ID efb915a20d5d44b34282df441552205865055c45 # Parent 781b5b6a33ee8f33dc28b71e3b3d19d2a16d0d2e jp (blog/set): fixed missing current_syntax diff -r 781b5b6a33ee -r efb915a20d5d sat_frontends/jp/cmd_blog.py --- a/sat_frontends/jp/cmd_blog.py Sun May 05 18:50:32 2019 +0200 +++ b/sat_frontends/jp/cmd_blog.py Sun May 05 18:50:35 2019 +0200 @@ -43,6 +43,8 @@ SYNTAX_XHTML = u"xhtml" # extensions to use with known syntaxes SYNTAX_EXT = { + # FIXME: default syntax doesn't sounds needed, there should always be a syntax set + # by the plugin. "": "txt", # used when the syntax is not found SYNTAX_XHTML: "xhtml", "markdown": "md", @@ -105,6 +107,14 @@ class BlogPublishCommon(object): """handle common option for publising commands (Set and Edit)""" + @property + def current_syntax(self): + if self._current_syntax is None: + self._current_syntax = self.host.bridge.getParamA( + "Syntax", "Composition", "value", self.profile + ) + return self._current_syntax + def add_parser_options(self): self.parser.add_argument( "-T", "--title", type=base.unicode_decoder, help=_(u"title of the item") @@ -180,6 +190,7 @@ self.host.quit(C.EXIT_OK) def start(self): + self._current_syntax = self.args.syntax self.pubsub_item = self.args.item mb_data = {} self.setMbDataFromArgs(mb_data) @@ -432,14 +443,6 @@ BlogPublishCommon.__init__(self) common.BaseEdit.__init__(self, self.host, BLOG_TMP_DIR, use_metadata=True) - @property - def current_syntax(self): - if self._current_syntax is None: - self._current_syntax = self.host.bridge.getParamA( - "Syntax", "Composition", "value", self.profile - ) - return self._current_syntax - def add_parser_options(self): BlogPublishCommon.add_parser_options(self) self.parser.add_argument(