#!/usr/bin/python3
# -*- coding: utf-8 -*-

# Copyright © 2013 marmuta <marmvta@gmail.com>
#
# This file is part of Onboard.
#
# Onboard is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Onboard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import sys
import time
import pypredict

def main():

    args = sys.argv[1:]
    for fn in args:
        model = pypredict.DynamicModel()

        t = time.time()
        model.load(fn)
        t = time.time() - t

        print("{:30} {:35} {:6.2f}MB {:5.2f}s" \
              .format(fn,
                      " ".join(["{}: {:7}".format(i+1, c) for i,c in enumerate(model.get_counts()[0])]),
                      sum(model.memory_size())/2**20,
                      t))

if __name__ == '__main__':
    main()

