def print_version(opt, value, parser, *args, **kwargs): """Print the version number and exit.""" print_(constants.APPNAME + ' ' + constants.VERSION) sys.exit(0)
from mcomix.log import print_ # Check for PyGTK and PIL dependencies. try: import pygtk pygtk.require('2.0') import gtk assert gtk.gtk_version >= (2, 12, 0) assert gtk.pygtk_version >= (2, 12, 0) import gobject gobject.threads_init() except AssertionError: print_( _("You do not have the required versions of GTK+ and PyGTK installed.") ) print_( _('Installed GTK+ version is: %s') % \ '.'.join([str(n) for n in gtk.gtk_version]) ) print_( _('Required GTK+ version is: 2.12.0 or higher\n') ) print_( _('Installed PyGTK version is: %s') % \ '.'.join([str(n) for n in gtk.pygtk_version]) ) print_( _('Required PyGTK version is: 2.12.0 or higher') ) wait_and_exit() except ImportError: print_( _('Required PyGTK version is: 2.12.0 or higher') ) print_( _('No version of PyGTK was found on your system.') ) print_( _('This error might be caused by missing GTK+ libraries.') ) wait_and_exit() # Check PIL library
# Check for PyGTK and PIL dependencies. try: import pygtk pygtk.require('2.0') import gtk assert gtk.gtk_version >= (2, 12, 0) assert gtk.pygtk_version >= (2, 12, 0) import gobject gobject.threads_init() except AssertionError: print_( _("You do not have the required versions of GTK+ and PyGTK installed.") ) print_( _('Installed GTK+ version is: %s') % \ '.'.join([str(n) for n in gtk.gtk_version]) ) print_(_('Required GTK+ version is: 2.12.0 or higher\n')) print_( _('Installed PyGTK version is: %s') % \ '.'.join([str(n) for n in gtk.pygtk_version]) ) print_(_('Required PyGTK version is: 2.12.0 or higher')) wait_and_exit() except ImportError: print_(_('Required PyGTK version is: 2.12.0 or higher')) print_(_('No version of PyGTK was found on your system.')) print_(_('This error might be caused by missing GTK+ libraries.')) wait_and_exit()