#!/usr/bin/env python
"""Pygmy is a GTK+ client for the Music Player Daemon.
Inspired muchly by Brian Tarricone's Xfmedia.
Thanks go out to Magnus Bjernstad for his help.
"""

__author__ = "Andrew Conkling"
__email__ = "andrewski@fr.st"
__license__ = """
Pygmy, a GTK+ client for the Music Player Daemon
Copyright 2005 Andrew Conkling <andrewski@fr.st>

This file is part of Pygmy.

Pygmy 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 2 of the License, or
(at your option) any later version.

Pygmy 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 Pygmy; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

import pygmy
import hotshot
import hotshot.stats

if __name__ == "__main__":
    prof = hotshot.Profile('pygmy.prof')
    player = pygmy.PlayerUI()
    try:
        prof.runcall(player.main)
    except KeyboardInterrupt:
        pass

    print 'Loading profiler data...'
    stats = hotshot.stats.load('pygmy.prof')
    stats.strip_dirs()
    stats.sort_stats('time', 'calls')
    stats.print_stats(20)
