Description: Set default MIP_TABLE_PATH on debian.
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2011-11-23
Forwarded: no

Index: drslib-0.3.0a3/drslib/config.py
===================================================================
--- drslib-0.3.0a3.orig/drslib/config.py	2011-11-22 22:44:26.000000000 +0000
+++ drslib-0.3.0a3/drslib/config.py	2011-11-23 11:54:37.000000000 +0000
@@ -36,7 +36,11 @@
     try:
         table_path = config.get('tables', 'path')
     except:
-        raise Exception("Please configure your MIP table path using MIP_TABLE_PATH or a config file")
+        # On Debian, the user may have cmip5-cmor-tables installed. Fall back to these.
+        if os.path.exists('/usr/share/cmor'):
+           table_path ='/usr/share/cmor'
+        else:
+            raise Exception("Please configure your MIP table path using MIP_TABLE_PATH or a config file")
 
 try:
     table_path_csv = config.get('tables', 'path_csv')
