示例#1
0
文件: cli.py 项目: kvarq/kvarq
def summarize(args):

    js = JsonSummary()
    for fname in args.json:
        lo.info('processing ' + fname)
        js.add(fname)

    js.dump()
示例#2
0
文件: explorer.py 项目: kvarq/kvarq
        def do_export():

            js = JsonSummary()

            for jpath in self.jpaths:

                if bj.canceled:
                    break

                bj.message = 'extracting from ' + os.path.basename(jpath)

                try:
                    js.add(jpath)
                    stats['n'] += 1
                except Exception as e:
                    lo.error('could not load %s : %s'%(jpath, e))
                    continue

            try:
                js.dump(file(fname, 'w'))
            except IOError as e:
                lo.error('could not write to file %s : %s' % (fname, e))