#!/usr/bin/python

"""
    winpdb

    A wrapper for winpdb.py

    Copyright (C) 2005-2007 Nir Aides

    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 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; if not, write to the Free Software Foundation, Inc., 
    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    
"""



import sys
import os



STR_VERSIONS_ERROR_TITLE = 'Winpdb Error'
STR_VERSIONS_ERROR_MSG = """Winpdb is being run with the wrong version of Python.
Winpdb path: %s
Python path: %s""" % (os.path.abspath(__file__), os.path.abspath(sys.executable))



if os.name == 'nt':
    path1 = os.path.abspath(os.path.dirname(sys.executable)).lower()
    path2 = os.path.abspath(os.path.dirname(__file__)).lower()

    if not path2.startswith(path1):
        print >> sys.__stderr__, STR_VERSIONS_ERROR_MSG
        
        try:
            import Tkinter
            import tkMessageBox

            Tkinter.Tk().wm_withdraw()
            tkMessageBox.showerror(STR_VERSIONS_ERROR_TITLE, STR_VERSIONS_ERROR_MSG)

        except:
            pass

        sys.exit(1)



import winpdb



winpdb.main()




