comparison frontends/src/jp/cmd_blog.py @ 1968:eca59bc4e6c6

jp (blog): fixed syntax detection when extension is .txt
author Goffi <goffi@goffi.org>
date Fri, 24 Jun 2016 22:32:58 +0200
parents b603a3d516d3
children 5fbe09b9b568
comparison
equal deleted inserted replaced
1957:8226f9539580 1968:eca59bc4e6c6
145 """ 145 """
146 # we first try to guess syntax with extension 146 # we first try to guess syntax with extension
147 ext = os.path.splitext(path)[1][1:] # we get extension without the '.' 147 ext = os.path.splitext(path)[1][1:] # we get extension without the '.'
148 if ext: 148 if ext:
149 for k,v in SYNTAX_EXT.iteritems(): 149 for k,v in SYNTAX_EXT.iteritems():
150 if ext == v: 150 if k and ext == v:
151 return k 151 return k
152 152
153 # if not found, we use current syntax 153 # if not found, we use current syntax
154 return self.host.bridge.getParamA("Syntax", "Composition", "value", self.profile) 154 return self.host.bridge.getParamA("Syntax", "Composition", "value", self.profile)
155 155