apbs_tools.py (pymol-v1.8.6.0.tar.bz2) | : | apbs_tools.py (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 148 | skipping to change at line 148 | |||
INCLUDEWEBAPBS = False | INCLUDEWEBAPBS = False | |||
DEBUG = 0 | DEBUG = 0 | |||
APBS_DEFAULT=True | APBS_DEFAULT=True | |||
import tempfile | import tempfile | |||
import os,math,re | import os,math,re | |||
import string | import string | |||
import sys | ||||
try: | if sys.version_info[0] < 3: | |||
import Tkinter | import Tkinter | |||
from Tkinter import * | from Tkinter import * | |||
except ImportError: | else: | |||
import tkinter as Tkinter | import tkinter as Tkinter | |||
from tkinter import * | from tkinter import * | |||
import Pmw | import Pmw | |||
import distutils.spawn # used for find_executable | import distutils.spawn # used for find_executable | |||
import traceback | import traceback | |||
import pymol | import pymol | |||
# | # | |||
# Global config variables | # Global config variables | |||
skipping to change at line 175 | skipping to change at line 176 | |||
# APBS_BINARY_LOCATION = '/opt/bin/' | # APBS_BINARY_LOCATION = '/opt/bin/' | |||
# | # | |||
APBS_BINARY_LOCATION = None # corresponding environment variable: APBS_BINARY_DI R | APBS_BINARY_LOCATION = None # corresponding environment variable: APBS_BINARY_DI R | |||
APBS_WEB_LOCATION = None # corresponding environment variable: APBS_WEB_DIR | APBS_WEB_LOCATION = None # corresponding environment variable: APBS_WEB_DIR | |||
APBS_PSIZE_LOCATION = None # corresponding environment variable: APBS_PSIZE_DIR | APBS_PSIZE_LOCATION = None # corresponding environment variable: APBS_PSIZE_DIR | |||
APBS_PDB2PQR_LOCATION = None # corresponding environment variable: APBS_PDB2PQR_ DIR | APBS_PDB2PQR_LOCATION = None # corresponding environment variable: APBS_PDB2PQR_ DIR | |||
TEMPORARY_FILE_DIR = tempfile.gettempdir() # corresponding environment variable: TEMP | TEMPORARY_FILE_DIR = tempfile.gettempdir() # corresponding environment variable: TEMP | |||
apbs_plea = ("IMPORTANT REQUEST: If you have not already done so, please registe r\n" | apbs_plea = ("IMPORTANT REQUEST: If you have not already done so, please registe r\n" | |||
"your use of the open-source Adaptive Poisson-Boltzmann Solver (APB S) at\n" | "your use of the open-source Adaptive Poisson-Boltzmann Solver (APB S) at\n" | |||
"-> http://www.poissonboltzmann.org/apbs/downloads\n" | "-> http://www.poissonboltzmann.org/\n" | |||
"Such proof of usage is vital in securing funding for APBS developm ent!\n") | "Such proof of usage is vital in securing funding for APBS developm ent!\n") | |||
pdb2pqr_plea = ("IMPORTANT REQUEST: If you have not already done so, please regi ster\n" | pdb2pqr_plea = ("IMPORTANT REQUEST: If you have not already done so, please regi ster\n" | |||
"your use of the open-source PDB2PQR at\n" | "your use of the open-source PDB2PQR at\n" | |||
"-> http://www.poissonboltzmann.org/pdb2pqr/d\n" | "-> http://www.poissonboltzmann.org/\n" | |||
"Such proof of usage is vital in securing funding for PDB2PQR devel opment!\n") | "Such proof of usage is vital in securing funding for PDB2PQR devel opment!\n") | |||
global apbs_message, pdb2pqr_message | global apbs_message, pdb2pqr_message | |||
apbs_message = """You must have APBS installed on your system.""" | apbs_message = """You must have APBS installed on your system.""" | |||
pdb2pqr_message = """PDB2PQR can be used to generate .PQR files.""" | pdb2pqr_message = """PDB2PQR can be used to generate .PQR files.""" | |||
def get_default_location(name): | def get_default_location(name): | |||
""" | """ | |||
Given the name of an APBS-related binary, look in | Given the name of an APBS-related binary, look in | |||
* pymol path, | * pymol path, | |||
* freemol path, | * freemol path, | |||
skipping to change at line 1098 | skipping to change at line 1099 | |||
good = self._generatePymolPqrFile() | good = self._generatePymolPqrFile() | |||
if not good: | if not good: | |||
if DEBUG: | if DEBUG: | |||
print("Could not generate the PyMOL-basd PQR file. generate PyMOLPqrFile failed.") | print("Could not generate the PyMOL-basd PQR file. generate PyMOLPqrFile failed.") | |||
return False | return False | |||
if DEBUG: print("GENERATED") | if DEBUG: print("GENERATED") | |||
return True | return True | |||
def execute(self, result, refocus=True): | def execute(self, result, refocus=True): | |||
if result == 'Register APBS Use': | if result == 'Register APBS Use': | |||
import webbrowser | import webbrowser | |||
webbrowser.open("http://www.poissonboltzmann.org/docs/apbs-registrat ion/") | webbrowser.open("http://www.poissonboltzmann.org/") | |||
elif result == 'Register PDB2PQR Use': | elif result == 'Register PDB2PQR Use': | |||
import webbrowser | import webbrowser | |||
webbrowser.open("http://www.poissonboltzmann.org/docs/apbs-registrat ion/") | webbrowser.open("http://www.poissonboltzmann.org/") | |||
elif result == 'Run APBS': | elif result == 'Run APBS': | |||
good = self.generateApbsInputFile() | good = self.generateApbsInputFile() | |||
if not good: | if not good: | |||
if DEBUG: | if DEBUG: | |||
print("ERROR: Something went wrong trying to generate the AP BS input file.") | print("ERROR: Something went wrong trying to generate the AP BS input file.") | |||
return False | return False | |||
# START | # START | |||
good = self.generatePqrFile() | good = self.generatePqrFile() | |||
if not good: | if not good: | |||
return False | return False | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added |