whoops! forgot -p for json and xml.

This commit is contained in:
brent s 2018-09-27 14:40:47 -04:00
parent e1eefebf9d
commit fa2fda8054

View File

@ -96,6 +96,9 @@ class PkgIndexer(object):


def _gen_json(self): def _gen_json(self):
import json import json
if self.args['plain']:
self.report = json.dumps([p['name'] for p in self.pkgs], indent = 4)
else:
self.report = json.dumps(self.pkgs, default = str, indent = 4) self.report = json.dumps(self.pkgs, default = str, indent = 4)
return() return()


@ -106,6 +109,9 @@ class PkgIndexer(object):
_attrib = copy.deepcopy(p) _attrib = copy.deepcopy(p)
for i in ('built', 'installed', 'sizerpm', 'sizedisk'): for i in ('built', 'installed', 'sizerpm', 'sizedisk'):
_attrib[i] = str(_attrib[i]) _attrib[i] = str(_attrib[i])
if self.args['plain']:
_pkg = etree.Element('package', attrib = {'name': p['name']})
else:
_pkg = etree.Element('package', attrib = _attrib) _pkg = etree.Element('package', attrib = _attrib)
_xml.append(_pkg) _xml.append(_pkg)
#del(_attrib['name']) # I started to make it a more complex, nested structure... is that necessary? #del(_attrib['name']) # I started to make it a more complex, nested structure... is that necessary?