comparison frontends/src/jp/cmd_blog.py @ 2280:4bc9a2c2d6c9

jp (pubsub, common): fixed last item edition (keep item id instead of creating a new one)
author Goffi <goffi@goffi.org>
date Wed, 28 Jun 2017 20:28:24 +0200
parents 5f0dbf42aa9c
children 4fd010f29f99
comparison
equal deleted inserted replaced
2279:e2f96cd1887b 2280:4bc9a2c2d6c9
334 return mb_data, meta_file_path 334 return mb_data, meta_file_path
335 335
336 def edit(self, content_file_path, content_file_obj, 336 def edit(self, content_file_path, content_file_obj,
337 mb_data=None): 337 mb_data=None):
338 """Edit the file contening the content using editor, and publish it""" 338 """Edit the file contening the content using editor, and publish it"""
339 if mb_data is not None:
340 self.pubsub_item = mb_data['id']
341 # we first create metadata file 339 # we first create metadata file
342 meta_ori, meta_file_path = self.buildMetadataFile(content_file_path, mb_data) 340 meta_ori, meta_file_path = self.buildMetadataFile(content_file_path, mb_data)
343 341
344 # do we need a preview ? 342 # do we need a preview ?
345 if self.args.preview: 343 if self.args.preview:
375 content = mb_data['content'] 373 content = mb_data['content']
376 if content: 374 if content:
377 content = self.host.bridge.syntaxConvert(content, 'text', 'XHTML', False, self.profile) 375 content = self.host.bridge.syntaxConvert(content, 'text', 'XHTML', False, self.profile)
378 if content and self.current_syntax != 'XHTML': 376 if content and self.current_syntax != 'XHTML':
379 content = self.host.bridge.syntaxConvert(content, 'XHTML', self.current_syntax, False, self.profile) 377 content = self.host.bridge.syntaxConvert(content, 'XHTML', self.current_syntax, False, self.profile)
380 return content, mb_data 378 return content, mb_data, mb_data['id']
381 379
382 def start(self): 380 def start(self):
383 # if there are user defined extension, we use them 381 # if there are user defined extension, we use them
384 SYNTAX_EXT.update(config.getConfig(self.sat_conf, 'jp', CONF_SYNTAX_EXT, {})) 382 SYNTAX_EXT.update(config.getConfig(self.sat_conf, 'jp', CONF_SYNTAX_EXT, {}))
385 self.current_syntax = None 383 self.current_syntax = None