This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Lucas.py
59 lines (45 loc) · 1.41 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
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# ==============================================================================
# Author : Lucas Monge, [email protected]
# Web : http://lucaschess.pythonanywhere.com/
# Blog : http://lucaschess.blogspot.com
# Licence : GPL
# ==============================================================================
# stockfish 11
import os
import sip
from imp import reload
import sys
reload(sys)
sys.setdefaultencoding("latin-1")
sys.path.insert(0, os.curdir)
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)
current_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
if current_dir:
os.chdir(current_dir)
from Code import VarGen
sys.path.append(os.path.join(current_dir, "Code"))
sys.path.append(os.path.join(current_dir, VarGen.folder_engines, "_tools"))
import Code.Traducir as Traducir
Traducir.install()
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 == "-kibitzer":
import Code.RunKibitzer
Code.RunKibitzer.run(sys.argv[2])