1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Author: Alastair McKinstry <mckinstry@debian.org>
Description: Ensure pyferret can run without Environmental variables set
Last-Updated: 2015-05-11
Forwarded: no
Index: pyferret-7.4.3/pyfermod/__init__.py
===================================================================
--- pyferret-7.4.3.orig/pyfermod/__init__.py
+++ pyferret-7.4.3/pyfermod/__init__.py
@@ -33,6 +33,7 @@ and syntax.
from __future__ import print_function
+
import sys
import os
import atexit
@@ -42,6 +43,21 @@ except ImportError:
pass
import readline
+# In Debian, an application should be able to start without environmental
+# variables needing to be set. So set them here.
+if os.environ.get('FER_GO') is None:
+ os.environ['FER_GO'] = '/usr/share/ferret-vis/jnls/go'
+if os.environ.get('FER_DATA') is None:
+ os.environ['FER_DATA'] = '/usr/share/ferret-vis/data'
+if os.environ.get('FER_DESCR') is None:
+ os.environ['FER_DESCR'] = '/usr/share/ferret-vis/descr'
+if os.environ.get('FER_GRIDS') is None:
+ os.environ['FER_GRIDS'] = '/usr/share/ferret-vis/grids'
+if os.environ.get('FER_MODEL_RUNS') is None:
+ os.environ['FER_MODEL_RUNS'] = '/usr/share/ferret-vis/model_runs'
+if os.environ.get('FER_LIBS') is None:
+ os.environ['FER_LIBS'] = '/usr/lib/ferret-vis/efmem:/usr/lib/ferret-vis/external_functions'
+
from pyferret import libpyferret
# also import everything (not starting with an underscore) from libpyferret
# so constants in that module are seen as part of this module
|