diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-17 04:24:18 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-17 04:24:18 -0400 |
commit | e66465369d3150cf4efcff8682c07197935ef3bc (patch) | |
tree | a8e332a8beef9736f91e4b91a912693eb9ff7aeb /mesonbuild/mintro.py | |
parent | faf114299bd6e2ac9c5569493d1974f2de41e13b (diff) | |
download | meson-e66465369d3150cf4efcff8682c07197935ef3bc.zip meson-e66465369d3150cf4efcff8682c07197935ef3bc.tar.gz meson-e66465369d3150cf4efcff8682c07197935ef3bc.tar.bz2 |
Use more direct dictionary literals.
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r-- | mesonbuild/mintro.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 88ea16e..525a41d 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -79,9 +79,7 @@ def list_installed(installdata): def list_targets(coredata, builddata, installdata): tlist = [] for (idname, target) in builddata.get_targets().items(): - t = {} - t['name'] = target.get_basename() - t['id'] = idname + t = {'name': target.get_basename(), 'id': idname} fname = target.get_filename() if isinstance(fname, list): fname = [os.path.join(target.subdir, x) for x in fname] @@ -132,9 +130,7 @@ def add_keys(optlist, options): keys.sort() for key in keys: opt = options[key] - optdict = {} - optdict['name'] = key - optdict['value'] = opt.value + optdict = {'name': key, 'value': opt.value} if isinstance(opt, coredata.UserStringOption): typestr = 'string' elif isinstance(opt, coredata.UserBooleanOption): @@ -190,9 +186,7 @@ def list_tests(testdata): print(json.dumps(result)) def list_projinfo(builddata): - result = {} - result['name'] = builddata.project_name - result['version'] = builddata.project_version + result = {'name': builddata.project_name, 'version': builddata.project_version} subprojects = [] for k, v in builddata.subprojects.items(): c = {'name': k, |