diff GCMS/library_lookup.py @ 22:f0c6feab06e7

fixed import match_library
author linda.bakker@wur.nl <linda.bakker@wur.nl>
date Wed, 03 Jun 2015 11:54:12 +0200
parents f70b2c169e3a
children
line wrap: on
line diff
--- a/GCMS/library_lookup.py	Wed May 06 08:06:53 2015 +0200
+++ b/GCMS/library_lookup.py	Wed Jun 03 11:54:12 2015 +0200
@@ -1,11 +1,20 @@
 '''
 Logic for searching a Retention Index database file given output from NIST
 '''
-import match_library
+import os
+import sys
+import inspect
 import re
-import sys
 import csv
 
+
+#a not so perfect solution to import parent dir file match_library
+currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+parentdir = os.path.dirname(currentdir)
+sys.path.append(parentdir)
+import match_library
+
+
 __author__ = "Marcel Kempenaar"
 __contact__ = "brs@nbic.nl"
 __copyright__ = "Copyright, 2012, Netherlands Bioinformatics Centre"
@@ -303,7 +312,7 @@
 def main():
     '''
     Library Lookup main function
-    '''
+    '''   
     library_file = sys.argv[1]
     nist_tabular_filename = sys.argv[2]
     ctype = sys.argv[3]