mirror of
https://github.com/LCPQ/EMSL_Basis_Set_Exchange_Local
synced 2024-11-01 03:33:46 +01:00
PEP 8 format
This commit is contained in:
parent
2ca24930a4
commit
6347860b10
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import re
|
import re
|
||||||
import sys, os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
debug = True
|
||||||
|
|
||||||
debug=True
|
|
||||||
|
|
||||||
class EMSL_dump:
|
class EMSL_dump:
|
||||||
|
|
||||||
@ -32,10 +34,10 @@ class EMSL_dump:
|
|||||||
dbcache = 'db/cache'
|
dbcache = 'db/cache'
|
||||||
if not os.path.isfile(dbcache):
|
if not os.path.isfile(dbcache):
|
||||||
page = self.requests.get(url).text
|
page = self.requests.get(url).text
|
||||||
file=open(dbcache,'w')
|
file = open(dbcache, 'w')
|
||||||
pickle.dump(page,file)
|
pickle.dump(page, file)
|
||||||
else:
|
else:
|
||||||
file=open(dbcache,'r')
|
file = open(dbcache, 'r')
|
||||||
page = pickle.load(file)
|
page = pickle.load(file)
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
@ -121,7 +123,7 @@ class EMSL_dump:
|
|||||||
import Queue
|
import Queue
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
num_worker_threads=7
|
num_worker_threads = 7
|
||||||
q_in = Queue.Queue(num_worker_threads)
|
q_in = Queue.Queue(num_worker_threads)
|
||||||
q_out = Queue.Queue(num_worker_threads)
|
q_out = Queue.Queue(num_worker_threads)
|
||||||
|
|
||||||
@ -131,12 +133,13 @@ class EMSL_dump:
|
|||||||
while True:
|
while True:
|
||||||
[name, url, des, elts] = q_in.get()
|
[name, url, des, elts] = q_in.get()
|
||||||
url = self.create_url(url, name, elts)
|
url = self.create_url(url, name, elts)
|
||||||
q_out.put ( ([name, url, des, elts], self.requests.get(url).text) )
|
q_out.put(
|
||||||
|
([name, url, des, elts], self.requests.get(url).text))
|
||||||
q_in.task_done()
|
q_in.task_done()
|
||||||
|
|
||||||
def enqueue():
|
def enqueue():
|
||||||
for [name, url, des, elts] in list_basis_array:
|
for [name, url, des, elts] in list_basis_array:
|
||||||
q_in.put( ([name, url, des, elts]) )
|
q_in.put(([name, url, des, elts]))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
t = threading.Thread(target=enqueue)
|
t = threading.Thread(target=enqueue)
|
||||||
@ -226,23 +229,23 @@ class EMSL_local:
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
format_dict = \
|
format_dict = \
|
||||||
{
|
{
|
||||||
"g94": "Gaussian94" ,
|
"g94": "Gaussian94",
|
||||||
"gamess-us": "GAMESS-US" ,
|
"gamess-us": "GAMESS-US",
|
||||||
"gamess-uk": "GAMESS-UK" ,
|
"gamess-uk": "GAMESS-UK",
|
||||||
"turbomole": "Turbomole" ,
|
"turbomole": "Turbomole",
|
||||||
"tx93" : "TX93" ,
|
"tx93": "TX93",
|
||||||
"molpro" : "Molpro" ,
|
"molpro": "Molpro",
|
||||||
"molproint" : "MolproInt" ,
|
"molproint": "MolproInt",
|
||||||
"hondo" : "Hondo" ,
|
"hondo": "Hondo",
|
||||||
"supermolecule" : "SuperMolecule" ,
|
"supermolecule": "SuperMolecule",
|
||||||
"molcas" : "Molcas" ,
|
"molcas": "Molcas",
|
||||||
"hyperchem" : "HyperChem" ,
|
"hyperchem": "HyperChem",
|
||||||
"dalton" : "Dalton" ,
|
"dalton": "Dalton",
|
||||||
"demon-ks" : "deMon-KS" ,
|
"demon-ks": "deMon-KS",
|
||||||
"demon2k" : "deMon2k" ,
|
"demon2k": "deMon2k",
|
||||||
"aces2" : "AcesII" ,
|
"aces2": "AcesII",
|
||||||
}
|
}
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user