mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
move python check into libanki
This commit is contained in:
parent
7de4552b0e
commit
0eb56c27f9
1 changed files with 1 additions and 8 deletions
9
anki
9
anki
|
@ -1,10 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if sys.version_info[0] > 2:
|
|
||||||
raise Exception("Anki should be run with python2.x.")
|
|
||||||
try:
|
try:
|
||||||
modDir=os.path.dirname(os.path.realpath(__file__))
|
modDir=os.path.dirname(os.path.realpath(__file__))
|
||||||
runningDir=os.path.split(modDir)[0]
|
runningDir=os.path.split(modDir)[0]
|
||||||
|
@ -12,15 +9,11 @@ if __name__ == "__main__":
|
||||||
# py2exe
|
# py2exe
|
||||||
runningDir=os.path.dirname(sys.argv[0])
|
runningDir=os.path.dirname(sys.argv[0])
|
||||||
modDir=runningDir
|
modDir=runningDir
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(modDir, "libanki"))
|
sys.path.insert(0, os.path.join(modDir, "libanki"))
|
||||||
sys.path.insert(0, os.path.join(os.path.join(modDir, ".."), "libanki"))
|
sys.path.insert(0, os.path.join(os.path.join(modDir, ".."), "libanki"))
|
||||||
|
|
||||||
import aqt
|
import aqt
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import aqt.forms
|
import aqt.forms
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception("You need to run tools/build_ui.sh in order for anki to work.")
|
raise Exception("Please read README.development.")
|
||||||
|
|
||||||
aqt.run()
|
aqt.run()
|
||||||
|
|
Loading…
Reference in a new issue