#!/usr/bin/python2.4 
# -*- python -*-
#
# Copyright (C) 2005, 2006 Mekensleep
#
# Mekensleep
# 24 rue vieille du temple
# 75004 Paris
#       licensing@mekensleep.com
#
# 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; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <loic@gnu.org>
#
from os import environ
environ['GTK2_RC_FILES'] = "/usr/share/poker-network/poker2d/Aero/gtkrc"

import getopt
import sys
sys.path.insert(0, "..")

from pokerclient2d.poker2d import run

def usage():
    print """
poker2d [-h|--help] [settings.xml [config.xml]]
"""

def main():
    try:
        opts, args = getopt.getopt(sys.argv[1:], "h", ["help" ])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
    launcher = False
    for o, a in opts:
        if o in ("-h", "--help"):
            usage()
            sys.exit()

    config_file = None
    settings_file = None
    if len(args) > 0:
        settings_file = args[0]
    if len(args) > 1:
        config_file = args[1]

    run("/usr/share/poker-network/poker2d", settings_file, config_file)

main()
