Package: openmolcas / 20.10-2

pymolcas_default_directories.patch Patch series | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
Index: openmolcas/Tools/pymolcas/molcas_wrapper.py
===================================================================
--- openmolcas.orig/Tools/pymolcas/molcas_wrapper.py
+++ openmolcas/Tools/pymolcas/molcas_wrapper.py
@@ -103,9 +103,7 @@ class Molcas_wrapper(object):
 
   def __init__(self, **kwargs):
     # Get Molcas istallation
-    self.molcas = abspath(get_utf8('MOLCAS', default=''))
-    if (self.molcas == ''):
-      raise MolcasException('"MOLCAS" is not defined')
+    self.molcas = '/usr/share/openmolcas'
     if (not isfile(join(self.molcas, '.molcashome'))):
       raise MolcasException('"{0}" is not a valid MOLCAS installation'.format(self.molcas))
     # Get location of sources (other than MOLCAS)
@@ -976,7 +974,7 @@ class Molcas_wrapper(object):
     '''Return the path of a program in sbin if it exists'''
     if (prog == basename(prog)):
       for path in [self.molcas] + self.sources:
-        filename = join(path, 'sbin', prog)
+        filename = join(path, 'bin', prog)
         if (isfile(filename) and access(filename, X_OK)):
           return filename
     return False
Index: openmolcas/Tools/pymolcas/pymolcas.py
===================================================================
--- openmolcas.orig/Tools/pymolcas/pymolcas.py
+++ openmolcas/Tools/pymolcas/pymolcas.py
@@ -93,11 +93,13 @@ def main(my_name):
   parser.usage = '{0} [options] [input_file | script ...]'.format(parser.prog)
   args = vars(parser.parse_args())
 
-  from molcas_aux import find_molcas, find_sources, attach_streams, dotmolcas
+  from molcas_aux import find_molcas, find_sources, attach_streams, dotmolcas, get_utf8, set_utf8
   from write_molcasrc import write_molcasrc
   from molcas_wrapper import Molcas_wrapper, MolcasException
 
   # Checking for version right at the beginning, in case MOLCAS cannot be found
+  if (get_utf8('MOLCAS', default='') == ''):
+    set_utf8('MOLCAS', '/usr/share/openmolcas')
   if (args['version']):
     print('python driver version = {0}'.format(Molcas_wrapper.version))
     print('(after the original perl EMIL interpreter of Valera Veryazov)')
@@ -131,7 +133,7 @@ def main(my_name):
     if (args['extra']):
       in_sbin = False
       for path in ['MOLCAS', 'OPENMOLCAS_SOURCE', 'MOLCAS_SOURCE']:
-        filetest = os.path.join(os.environ[path], 'sbin', args['filename'])
+        filetest = os.path.join(os.environ[path], 'bin', args['filename'])
         if (os.path.isfile(filetest) and os.access(filetest, os.X_OK)):
           in_sbin = True
       if (not in_sbin):