aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/tools.py18
-rwxr-xr-xwqflask/utility/webqtlUtil.py16
2 files changed, 18 insertions, 16 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 1a5c19d9..6e35f00a 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -49,3 +49,21 @@ def pylmm_command(default=None):
path = get_setting('PYLMM_PATH',default,guess,get_valid_path)
pylmm_command = 'python '+path+'/pylmm_gn2/lmm.py'
return path,pylmm_command
+
+def plink_command(default=None):
+ """
+ Return the path to the repository and the python command to call
+ """
+ def get_valid_path(path):
+ """Test for a valid repository"""
+ if path:
+ sys.stderr.write("Trying PLINK_PATH in "+path+"\n")
+ if path and os.path.isfile(path+'/plink'):
+ return path
+ else:
+ None
+
+ guess = os.environ.get('HOME')+'/plink'
+ path = get_setting('PLINK_PATH',default,guess,get_valid_path)
+ plink_command = path+'/plink'
+ return path,plink_command \ No newline at end of file
diff --git a/wqflask/utility/webqtlUtil.py b/wqflask/utility/webqtlUtil.py
index ab746228..f842dde0 100755
--- a/wqflask/utility/webqtlUtil.py
+++ b/wqflask/utility/webqtlUtil.py
@@ -881,22 +881,6 @@ def cmpGenoPos(A,B):
except:
return 0
-#XZhou: Must use "BINARY" to enable case sensitive comparison.
-def authUser(name,password,db, encrypt=None):
- try:
- if encrypt:
- query = 'SELECT privilege, id,name,password, grpName FROM User WHERE name= BINARY \'%s\' and password= BINARY \'%s\'' % (name,password)
- else:
- query = 'SELECT privilege, id,name,password, grpName FROM User WHERE name= BINARY \'%s\' and password= BINARY SHA(\'%s\')' % (name,password)
- db.execute(query)
- records = db.fetchone()
- if not records:
- raise ValueError
- return records#(privilege,id,name,password,grpName)
- except:
- return (None, None, None, None, None)
-
-
def hasAccessToConfidentialPhenotypeTrait(privilege, userName, authorized_users):
access_to_confidential_phenotype_trait = 0
if webqtlConfig.USERDICT[privilege] > webqtlConfig.USERDICT['user']: