mailRe: relax in Windows


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on September 01, 2006 - 13:39:
> > I greped the scripts looking for more importing features and I got:
> >
> > processes.py:                     from os import kill, popen3, system
> >
> > relax:                            from os import F_OK, access, getpid,
> > putenv
> >
> > io.py:                            from os import devnull
> >
> > io.py:                            from os import F_OK, access, makedirs,
> > remove, stat
> >
> > sconstruct:                       from os import F_OK, access, chdir,
> > getcwd, lstat, path, remove, rmdir, sep, symlink, system, walk
> >
> > generic_fns/dasha.py:             from os import F_OK, access, chdir,
> > getcwd, system
> >
> > generic_fns/grace.py:             from os import system
> >
> > generic_fns/molmol.py:            from os import popen
> >
> > generic_fns/palmer.py:            from os import F_OK, P_WAIT, access,
> > chdir, chmod, getcwd, listdir, remove, spawnlp, system
> >
> > generic_fns/pdb.py:               from os import F_OK, access
> >
> > generic_fns/selection.py:         from os import F_OK, access
> >
> > prompt/interpreter.py:            from os import F_OK, access
> >
> > sample_scripts/full_analysis.py:  from os import getcwd, listdir
> >
> >
> >
> > For me it is kind of weird the phython did not complain about the
> > importing from os in the file relax (the second grep entry).
>
> The only problematic imports that I can see are 'kill' and 'devnull'.
> The rest should all work under Windows.  'symlink' may be an issue as
> well but that is located in the 'sconstruct' script which isn't part
> of the program.


A couple of others will cause problems:

The os.lstat import in sconstruct laso won't work under windows. It
might be possible to replace it with os.stat, but I'm not sure if this
will work. In any case the sconstruct script is only required for
compiling the curve-fitting code, so is entirely optional.

We should probably import with 'try:' statements (where necessary) so that compilation is possible in Windows. I'm a bit disappointed that the supposedly 'portable' os module doesn't fail silently or provide dummy functions for Windows!

os.spawnlp in palmer.py will fail under windows. A simple os.spawnl will
work as a replacement, but this requires an exact path to Modelfree
(spawnlp uses PATH to find the executable, spawnl doesn't). Again, this
functionality is fairly peripheral - it is just an interface with
Palmer's Modelfree software. Simply removing the offending import should
work unless you particularly want to work with Modelfree.

This 'spawnlp' one will cause a fatal ImportError on Windows. However as Modelfree4 only runs on UNIX systems then another 'try:' statement is sufficient. I'll make the changes to the 1.2 line in the repository. Don't worry about this Daniel, all you have to do is as Chris said. Deleting the entire 'from os import ....' from the file 'generic_fns/palmer.py' will fix the problem. Once relax is happily up and running on MS Windows I'll tie up some loose ends and make a 1.2.7 release of relax.

Edward



Related Messages


Powered by MHonArc, Updated Fri Sep 01 14:00:15 2006