#! /usr/bin/env python ## -*- coding: iso-8859-1 -*- ## ## vim:ts=4:et:nowrap ## ##---------------------------------------------------------------------------## ## ## PySol -- a Python Solitaire game ## ## Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer ## All Rights Reserved. ## ## This program 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. ## ## This program 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; see the file COPYING. ## If not, write to the Free Software Foundation, Inc., ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## ## Markus F.X.J. Oberhumer ## ## http://www.oberhumer.com/pysol ## ##---------------------------------------------------------------------------## import sys, os if os.name == 'nt' and not os.environ.has_key('LANG'): try: import locale l = locale.getdefaultlocale() os.environ['LANG'] = l[0] except: pass ##locale.setlocale(locale.LC_ALL, '') import gettext ##locale_dir = 'locale' locale_dir = None if os.path.isdir(sys.path[0]): d = os.path.join(sys.path[0], 'locale') else: # i.e. library.zip d = os.path.join(os.path.dirname(sys.path[0]), 'locale') if os.path.exists(d) and os.path.isdir(d): locale_dir = d ##if locale_dir: locale_dir = os.path.normpath(locale_dir) gettext.install('pysol', locale_dir, unicode=True) ## init toolkit import pysollib.settings if '--tile' in sys.argv: #pysollib.settings.TOOLKIT = 'gtk' pysollib.settings.USE_TILE = True sys.argv.remove('--tile') elif '--gtk' in sys.argv: pysollib.settings.TOOLKIT = 'gtk' sys.argv.remove('--gtk') from pysollib.main import main #import pychecker.checker sys.exit(main(sys.argv))