File: __init__.py

package info (click to toggle)
pymol 2.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,312 kB
  • sloc: cpp: 480,106; python: 79,860; ansic: 28,343; javascript: 6,792; sh: 47; makefile: 30; csh: 8
file content (49 lines) | stat: -rw-r--r-- 1,452 bytes parent folder | 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
from __future__ import print_function

import os
import shutil
import glob
import re
import string
import sys
import time
import socket  # for gethostname()
import getpass # for getuser()
import re

from chempy import feedback

# "do" is the preferred command for running tinker

def do(run_prefix):
    if feedback['bmin']:
        print(" "+str(__name__)+': launching %s...'%bmin_path)
        if hasattr(sys.stdout,"flush"):
            sys.stdout.flush()
    for a in [ ".m1", ".m2", ".log", ".out" ]:
        if os.path.exists(run_prefix + a):
            os.unlink(run_prefix + a)
    pth = "."
#   pth = os.getcwd()
#   pth = re.sub(r".*\/"+getpass.getuser()+"\/",'',pth)
#   cmd = "rsh "+socket.gethostname()+" "+bmin_path+" "+pth+"/"+run_prefix
    cmd = bmin_path+" "+pth+"/"+run_prefix
    print(cmd)
    os.system(cmd)
    while 1:
        if os.path.exists(run_prefix+".out"): break
        time.sleep(0.1)
    if feedback['bmin']:
        os.system("cat bmintmp.log")
        print(" "+str(__name__)+': bmin job complete. ')
        if hasattr(sys.stdout,"flush"):
            sys.stdout.flush()

if 'SCHRODINGER' in os.environ:
    base = os.environ['SCHRODINGER']
    bmin_path = base + '/bmin'
#   os.environ['MMSHARE_EXEC'] = '/apps/schrodinger/mmshare-v10028/bin/Linux-x86'
#   os.environ['MMOD_EXEC'] = '/apps/schrodinger/macromodel-v71008/bin/Linux-x86'
#   bmin_path = os.environ['MMOD_EXEC']+"/bmin"
else:
    bmin_path = "bmin"