File: __init__.py

package info (click to toggle)
pymol 1.8.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,248 kB
  • ctags: 24,095
  • sloc: cpp: 474,635; python: 75,034; ansic: 22,888; sh: 236; makefile: 78; csh: 21
file content (50 lines) | stat: -rw-r--r-- 1,454 bytes parent folder | download | duplicates (3)
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
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"