#!/usr/bin/env python

# Copyright (C) 2005 Osmo Salomaa
#
# This file is part of Gaupol.
#
# Gaupol 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.
#
# Gaupol 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 Gaupol; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


"""Print dependency versions."""


import sys


print 'Python version:',
print '%d.%d.%d' % sys.version_info[:3]

print 'GTK version:',
try:
    import gtk
    print '%d.%d.%d' % gtk.gtk_version
except ImportError:
    print 'Not found'

print 'PyGTK version:',
try:
    import gtk
    print '%d.%d.%d' % gtk.pygtk_version
except ImportError:
    print 'Not found'

print 'PyEnchant version:',
try:
    import enchant
    print enchant.__version__
except ImportError:
    try:
        import pkg_resources
        try:
            pkg_resources.require('pyenchant')
        except pkg_resources.DistributionNotFound:
            print 'Not found'
        else:
            import enchant
            print enchant.__version__
    except ImportError:
        print 'Not found'
except enchant.Error, message:
    print message
