diff options
author | Lei Yan | 2014-02-04 12:14:14 -0600 |
---|---|---|
committer | Lei Yan | 2014-02-04 12:14:14 -0600 |
commit | 839115abbdf1b7e90da1d4db7758a2f7f8f83037 (patch) | |
tree | 345cf6dc1f1e6545421e9111305826b3c5925a15 /wqflask/maintenance/dataset/utilities.py | |
parent | ad07fc167c4f35490fd59e687aac1f4291defcc2 (diff) | |
download | genenetwork2-839115abbdf1b7e90da1d4db7758a2f7f8f83037.tar.gz |
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset/utilities.py')
-rw-r--r-- | wqflask/maintenance/dataset/utilities.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wqflask/maintenance/dataset/utilities.py b/wqflask/maintenance/dataset/utilities.py index 453ee707..5ffa9047 100644 --- a/wqflask/maintenance/dataset/utilities.py +++ b/wqflask/maintenance/dataset/utilities.py @@ -1,4 +1,5 @@ import MySQLdb +import re def get_cursor(): host = 'localhost' @@ -7,4 +8,12 @@ def get_cursor(): db = 'db_webqtl' con = MySQLdb.Connect(db=db, host=host, user=user, passwd=passwd) cursor = con.cursor() - return cursor
\ No newline at end of file + return cursor + +def clearspaces(s): + if s: + s = re.sub('\s+', ' ', s) + s = s.strip() + return s + else: + return None |