Skip to content

Commit

Permalink
PEP8 and pylint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Peisach committed Sep 2, 2024
1 parent 04be615 commit 0426a68
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ minversion = 3.4.0
skip_missing_interpreters = true
skipsdist = false

[pytest]
python_files = "*PyTest.py"

[testenv]
passenv = CONFIG_SUPPORT_TOKEN_ENV,OE_LICENSE
allowlist_externals = echo
Expand Down Expand Up @@ -80,7 +77,6 @@ commands =
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_2} --pattern "{[local_settings]test_pattern}"
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_3} --pattern "{[local_settings]test_pattern}"
{envpython} -m unittest discover -v --start-directory {[local_settings]test_path_4} --pattern "{[local_settings]test_pattern}"
{envpython} -m pytest -v {[local_settings]test_path_1} --tb=short
echo "Completed {envname}"

#
Expand Down
1 change: 1 addition & 0 deletions wwpdb/apps/ann_tasks_v2/pcm/PcmCCDEditorForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from wwpdb.utils.dp.RcsbDpUtility import RcsbDpUtility
from wwpdb.io.locator.PathInfo import PathInfo


class PcmCCDEditorForm(object):
"""
The CoordEditorForm class generates coordinate editor form.
Expand Down
6 changes: 3 additions & 3 deletions wwpdb/apps/ann_tasks_v2/utils/GetCovalentBond.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,20 @@ def __processCloseContactContent(self, jsonObj):
atom += "(" + tupL[5] + ")"
#
tablerow += "<td>" + tupL[16] + "</td><td>" + tupL[0] + "</td><td>" + tupL[1] + "</td><td>" + tupL[2] + tupL[3] + "</td><td>" \
+ atom + "</td><td>" + tupL[6] + "</td>"
+ atom + "</td><td>" + tupL[6] + "</td>"
atom = tupL[11]
if tupL[12]:
atom += "(" + tupL[12] + ")"
#
tablerow += "<td>" + tupL[7] + "</td><td>" + tupL[8] + "</td><td>" + tupL[9] + tupL[10] + "</td><td>" + atom + "</td><td>" \
+ tupL[13] + "</td><td>" + tupL[14] + "</td>"
+ tupL[13] + "</td><td>" + tupL[14] + "</td>"
#
tupL[6] = tupL[6].replace("_", "-")
tupL[13] = tupL[13].replace("_", "-")
bond_id = "covalent_bond_" + str(count)
#
tablerow += "<td>" + tupL[15] + '&nbsp; &nbsp; &nbsp; &nbsp; <input type="checkbox" id="' + bond_id + '" name="' + bond_id \
+ '" value="' + "_".join(tupL[:16]) + '"/></td>'
+ '" value="' + "_".join(tupL[:16]) + '"/></td>'
#
tablerow += "</tr>\n"
count += 1
Expand Down
27 changes: 15 additions & 12 deletions wwpdb/apps/ann_tasks_v2/utils/PointSuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@
__license__ = "Creative Commons Attribution 3.0 Unported"
__version__ = "V0.07"

import json,os,sys,traceback
import os
import sys
import traceback

from wwpdb.utils.dp.RcsbDpUtility import RcsbDpUtility

try:
from mmcif.io.IoAdapterCore import IoAdapterCore as IoAdapter
except:
except ImportError:
from mmcif.io.IoAdapterPy import IoAdapterPy as IoAdapter
#


class PointSuite(object):
""" PointSuite class encapsulates running the programs defined in the suite.
"""
Expand All @@ -43,11 +46,11 @@ def __setup(self):
def importMats(self, inputMatFilePath, logPath):
""" Run PointSuite's "importmats" program
"""
exportList = [ os.path.join(self.__sessionPath, "import.biomt"), os.path.join(self.__sessionPath, "import.cif"), \
os.path.join(self.__sessionPath, "import.matrix") ]
exportList = [os.path.join(self.__sessionPath, "import.biomt"), os.path.join(self.__sessionPath, "import.cif"),
os.path.join(self.__sessionPath, "import.matrix")]
#
allFileList = [ os.path.join(self.__sessionPath, "import.biomt"), os.path.join(self.__sessionPath, "import.cif"), \
os.path.join(self.__sessionPath, "import.matrix"), logPath ]
allFileList = [os.path.join(self.__sessionPath, "import.biomt"), os.path.join(self.__sessionPath, "import.cif"),
os.path.join(self.__sessionPath, "import.matrix"), logPath]
#
for filePath in allFileList:
if os.access(filePath, os.F_OK):
Expand Down Expand Up @@ -75,7 +78,7 @@ def importMats(self, inputMatFilePath, logPath):
tmpMatricesCifPath = os.path.join(self.__sessionPath, "tmp-import.cif")
ofh = open(tmpMatricesCifPath, "w")
ofh.write("data_matrices\n#\n%s\n" % data)
ofh.close()
ofh.close()
#
try:
ioObj = IoAdapter()
Expand All @@ -96,7 +99,7 @@ def findFrame(self, modelCifPath, biomtFilePath, logPath):
"""
frameCifPath = os.path.join(self.__sessionPath, "findframe.cif")
#
for filePath in ( frameCifPath, logPath ):
for filePath in (frameCifPath, logPath):
if os.access(filePath, os.F_OK):
os.remove(filePath)
#
Expand All @@ -109,12 +112,12 @@ def findFrame(self, modelCifPath, biomtFilePath, logPath):
dp.expLog(dstPath=logPath, appendMode=False)
dp.cleanup()

def makeAssembly(self, modelCifPath, transmtFilePath, logPath):
def makeAssembly(self, modelCifPath, transmtFilePath, logPath):
""" Run PointSuite's "makeassembly" program
"""
assemblyCifPath = os.path.join(self.__sessionPath, "assembly.cif")
#
for filePath in ( assemblyCifPath, logPath ):
for filePath in (assemblyCifPath, logPath):
if os.access(filePath, os.F_OK):
os.remove(filePath)
#
Expand All @@ -132,7 +135,7 @@ def mergeAssemblyInfo(self, inModelCifPath, assemblyCifPath, outModelCifPath, lo
"""
modifiedAssemblyCifPath = os.path.join(self.__sessionPath, "assembly-with-data-block.cif")
#
for filePath in ( outModelCifPath, modifiedAssemblyCifPath, logPath ):
for filePath in (outModelCifPath, modifiedAssemblyCifPath, logPath):
if os.access(filePath, os.F_OK):
os.remove(filePath)
#
Expand All @@ -146,7 +149,7 @@ def mergeAssemblyInfo(self, inModelCifPath, assemblyCifPath, outModelCifPath, lo
#
ofh = open(modifiedAssemblyCifPath, "w")
ofh.write("data_assembly\n#\n%s\n" % data)
ofh.close()
ofh.close()
#
dp = RcsbDpUtility(tmpPath=self.__sessionPath, siteId=self.__siteId, verbose=self.__verbose, log=self.__lfh)
dp.imp(inModelCifPath)
Expand Down
16 changes: 8 additions & 8 deletions wwpdb/apps/ann_tasks_v2/webapp/CommonTasksWebAppWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3743,7 +3743,7 @@ def _uploadBiomtFileOp(self):
rC.setError(errMsg="No file uploaded")
return rC
#
originalUploadFileName = wuu.getUploadFileName(fileTag="file")
# originalUploadFileName = wuu.getUploadFileName(fileTag="file")
#
entryId = self._reqObj.getValue("entryid")
entryFileName = self._reqObj.getValue("entryfilename")
Expand All @@ -3760,8 +3760,8 @@ def _uploadBiomtFileOp(self):
findframeLogPath = os.path.join(self._sessionPath, "findframe.log")
makeassemblyLogPath = os.path.join(self._sessionPath, "makeassembly.log")
mergeLogPath = os.path.join(self._sessionPath, "merge.log")
for filePath in ( sessionInputFilePath, importBiomtPath, importCifPath, importMatrixPath, frameCifPath, transmtCifPath, \
assemblyCifPath, updatedModelCifPath, importmatsLogPath, findframeLogPath, makeassemblyLogPath, mergeLogPath ):
for filePath in (sessionInputFilePath, importBiomtPath, importCifPath, importMatrixPath, frameCifPath, transmtCifPath,
assemblyCifPath, updatedModelCifPath, importmatsLogPath, findframeLogPath, makeassemblyLogPath, mergeLogPath):
if os.access(filePath, os.F_OK):
os.remove(filePath)
#
Expand All @@ -3781,16 +3781,16 @@ def _uploadBiomtFileOp(self):
if os.access(transmtCifPath, os.R_OK):
pts.makeAssembly(os.path.join(self._sessionPath, entryFileName), transmtCifPath, makeassemblyLogPath)
#
#
#
# ifh = open(sessionInputFilePath, "r")
# data = ifh.read()
# ifh.close()
# #
# text = 'Uploaded "' + originalUploadFileName + '" file:\n' + data
text = ""
#
for fileTup in ( ( "import.biomt", importBiomtPath ), ( "import.cif", importCifPath ), \
( "import.matrix", importMatrixPath ), ( "assembly.cif", assemblyCifPath ) ):
for fileTup in (("import.biomt", importBiomtPath), ("import.cif", importCifPath),
("import.matrix", importMatrixPath), ("assembly.cif", assemblyCifPath)):
if not os.access(fileTup[1], os.R_OK):
continue
#
Expand All @@ -3801,7 +3801,7 @@ def _uploadBiomtFileOp(self):
if text:
text += "\n\n"
#
text += '"' + fileTup[0] + '" file:\n' + data
text += '"' + fileTup[0] + '" file:\n' + data
#
successfulFlag = False
if os.access(assemblyCifPath, os.R_OK):
Expand All @@ -3826,7 +3826,7 @@ def _uploadBiomtFileOp(self):
rC.set("summary", summary_text)
#
log_text = ""
for filePath in ( importmatsLogPath, findframeLogPath, makeassemblyLogPath, mergeLogPath ):
for filePath in (importmatsLogPath, findframeLogPath, makeassemblyLogPath, mergeLogPath):
if not os.access(filePath, os.F_OK):
continue
#
Expand Down

0 comments on commit 0426a68

Please sign in to comment.