Mercurial > libervia-backend
comparison frontends/src/jp/cmd_blog.py @ 1883:abb2f253188e
jp (blog): fixed syntax guessing on existing files
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 05 Mar 2016 18:00:12 +0100 |
parents | ed444e9aa078 |
children | edd8dc8df1b9 |
comparison
equal
deleted
inserted
replaced
1882:ed444e9aa078 | 1883:abb2f253188e |
---|---|
94 # we first try to guess syntax with extension | 94 # we first try to guess syntax with extension |
95 ext = os.path.splitext(path)[1][1:] # we get extension without the '.' | 95 ext = os.path.splitext(path)[1][1:] # we get extension without the '.' |
96 if ext: | 96 if ext: |
97 for k,v in SYNTAX_EXT.iteritems(): | 97 for k,v in SYNTAX_EXT.iteritems(): |
98 if ext == v: | 98 if ext == v: |
99 return v | 99 return k |
100 | 100 |
101 # if not found, we use current syntax | 101 # if not found, we use current syntax |
102 return self.host.bridge.getParamA("Syntax", "Composition", "value", self.profile) | 102 return self.host.bridge.getParamA("Syntax", "Composition", "value", self.profile) |
103 | 103 |
104 | 104 |