mirror of
https://github.com/LCPQ/EMSL_Basis_Set_Exchange_Local
synced 2025-01-03 18:16:01 +01:00
Add setup.py
This commit is contained in:
parent
6048e9a4a5
commit
2e3c5bac09
17
EMSL_api.py
17
EMSL_api.py
@ -20,16 +20,19 @@ Options:
|
|||||||
<db_path> is the path to the SQLite3 file containing the Basis sets.
|
<db_path> is the path to the SQLite3 file containing the Basis sets.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('./src/')
|
|
||||||
|
|
||||||
from docopt import docopt
|
try:
|
||||||
from EMSL_utility import EMSL_dump
|
from docopt import docopt
|
||||||
from EMSL_utility import format_dict
|
from EMSL_utility import EMSL_dump
|
||||||
from EMSL_utility import EMSL_local
|
from EMSL_utility import format_dict
|
||||||
|
from EMSL_utility import EMSL_local
|
||||||
|
|
||||||
|
except:
|
||||||
|
print "Run setup.py then source EMSL_api.rc"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
40
setup.py
Executable file
40
setup.py
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
ins = False
|
||||||
|
|
||||||
|
d = {'y': True,
|
||||||
|
'n': False}
|
||||||
|
|
||||||
|
try:
|
||||||
|
import requests
|
||||||
|
except:
|
||||||
|
print "You need requests for dowload the basis, without you still can read a existing DB"
|
||||||
|
|
||||||
|
while True:
|
||||||
|
choice = raw_input('Do you want to install it ? [Y/N]')
|
||||||
|
try:
|
||||||
|
ins = d[choice.lower()]
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
print "not a valid choice"
|
||||||
|
|
||||||
|
|
||||||
|
if ins:
|
||||||
|
try:
|
||||||
|
import pip
|
||||||
|
pip.main(['install', "requests"])
|
||||||
|
except:
|
||||||
|
print "You need pip, (http://pip.readthedocs.org/en/latest/installing.html)"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
path = os.path.split(os.path.abspath(sys.argv[0]))[0]
|
||||||
|
|
||||||
|
with open(path + "/EMSL_api.rc", "w") as f:
|
||||||
|
f.write("export EMSL_API_ROOT=%s" % path + "\n")
|
||||||
|
f.write("export PYTHONPATH=${PYTHONPATH}:${EMSL_API_ROOT}/src" + "\n")
|
||||||
|
|
||||||
|
print "Source EMSL_api.rc, pls"
|
Loading…
Reference in New Issue
Block a user