forked from lukasmonk/lucaschess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lucas.py
65 lines (46 loc) · 1.4 KB
/
Lucas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# ==============================================================================
# Author : Lucas Monge, lukasmonk@gmail.com
# Web : http://www-lucaschess.rhcloud.com
# Blog : http://lucaschess.blogspot.com/
# Licence : GPL
# ==============================================================================
import os
import sys
reload(sys)
sys.setdefaultencoding("latin-1")
sys.path.append(os.curdir)
import sip
sip.setapi('QDate', 2)
sip.setapi('QDateTime', 2)
sip.setapi('QString', 2)
sip.setapi('QTextStream', 2)
sip.setapi('QTime', 2)
sip.setapi('QUrl', 2)
sip.setapi('QVariant', 2)
import Code.Traducir as Traducir
Traducir.install()
current_dir = os.path.dirname(sys.argv[0])
if current_dir:
os.chdir(current_dir)
nArgs = len(sys.argv)
if nArgs == 1:
import Code.Init
Code.Init.init()
elif nArgs >= 2:
arg = sys.argv[1].lower()
if arg.endswith(".pgn") or arg.endswith(".pks") \
or arg.endswith(".lcg") or arg.endswith(".lcf") \
or arg == "-play" or arg.endswith(".bmt"):
import Code.Init
Code.Init.init()
elif arg == "-sound":
import Code.RunSound
Code.RunSound.run(sys.argv[2])
elif arg == "-kibitzer":
import Code.RunKibitzer
Code.RunKibitzer.run(sys.argv[2])
elif arg == "-voyager":
import Code.RunVoyager
Code.RunVoyager.run(sys.argv[2])