comparison frontends/src/jp/cmd_blog.py @ 1919:d3354c80bd1f

core (tools): moved common to a separate package, and put data method in a data_format module
author Goffi <goffi@goffi.org>
date Tue, 22 Mar 2016 22:46:04 +0100
parents c38bcc0343b6
children b111f6589da4
comparison
equal deleted inserted replaced
1918:01d56efd488b 1919:d3354c80bd1f
30 import time 30 import time
31 import tempfile 31 import tempfile
32 import subprocess 32 import subprocess
33 import shlex 33 import shlex
34 import glob 34 import glob
35 from sat.tools import common 35 from sat.tools.common import data_format
36 36
37 __commands__ = ["Blog"] 37 __commands__ = ["Blog"]
38 38
39 # extensions to use with known syntaxes 39 # extensions to use with known syntaxes
40 SYNTAX_EXT = { 40 SYNTAX_EXT = {
185 except KeyError: 185 except KeyError:
186 pass 186 pass
187 # and override metadata with command-line arguments 187 # and override metadata with command-line arguments
188 mb_data['allow_comments'] = C.boolConst(not self.args.no_comment) 188 mb_data['allow_comments'] = C.boolConst(not self.args.no_comment)
189 if self.args.tag: 189 if self.args.tag:
190 common.iter2dict('tag', self.args.tag, mb_data) 190 data_format.iter2dict('tag', self.args.tag, mb_data)
191 if self.args.title is not None: 191 if self.args.title is not None:
192 mb_data['title'] = self.args.title 192 mb_data['title'] = self.args.title
193 193
194 # then we create the file and write metadata there, as JSON dict 194 # then we create the file and write metadata there, as JSON dict
195 # XXX: if we port jp one day on Windows, O_BINARY may need to be added here 195 # XXX: if we port jp one day on Windows, O_BINARY may need to be added here