comparison sat_frontends/jp/cmd_blog.py @ 2969:eafea3bcf111

jp (blog/preview): fixed call to getCurrentFile
author Goffi <goffi@goffi.org>
date Thu, 27 Jun 2019 20:24:14 +0200
parents 6c264c224614
children cf0dda0d4cda
comparison
equal deleted inserted replaced
2968:4979d1079127 2969:eafea3bcf111
620 ) = self.getItemPath() 620 ) = self.getItemPath()
621 621
622 self.edit(content_file_path, content_file_obj, mb_data=mb_data) 622 self.edit(content_file_path, content_file_obj, mb_data=mb_data)
623 623
624 624
625 class Preview(base.CommandBase): 625 class Preview(base.CommandBase, common.BaseEdit):
626 # TODO: need to be rewritten with template output 626 # TODO: need to be rewritten with template output
627 627
628 def __init__(self, host): 628 def __init__(self, host):
629 base.CommandBase.__init__( 629 base.CommandBase.__init__(
630 self, host, "preview", use_verbose=True, help=_(u"preview a blog content") 630 self, host, "preview", use_verbose=True, help=_(u"preview a blog content")
631 ) 631 )
632 common.BaseEdit.__init__(self, self.host, BLOG_TMP_DIR, use_metadata=True)
632 633
633 def add_parser_options(self): 634 def add_parser_options(self):
634 self.parser.add_argument( 635 self.parser.add_argument(
635 "--inotify", 636 "--inotify",
636 type=str, 637 type=str,
749 else: 750 else:
750 update_cb = self.updatePreviewExt 751 update_cb = self.updatePreviewExt
751 752
752 # which file do we need to edit? 753 # which file do we need to edit?
753 if self.args.file == "current": 754 if self.args.file == "current":
754 self.content_file_path = self.getCurrentFile(sat_conf, self.profile) 755 self.content_file_path = self.getCurrentFile(self.profile)
755 else: 756 else:
756 self.content_file_path = os.path.abspath(self.args.file) 757 self.content_file_path = os.path.abspath(self.args.file)
757 758
758 self.syntax = guessSyntaxFromPath(self.host, sat_conf, self.content_file_path) 759 self.syntax = guessSyntaxFromPath(self.host, sat_conf, self.content_file_path)
759 760