Skip to content

Commit

Permalink
Merge pull request #27 from wwPDB/DAOTHER-9213
Browse files Browse the repository at this point in the history
Calling pcm script through RcsbDpUtils
  • Loading branch information
wmorellato authored Jul 2, 2024
2 parents b969a24 + b74652e commit 5b8b5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
14 changes: 6 additions & 8 deletions wwpdb/apps/ann_tasks_v2/pcm/PcmCCDEditorForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,10 @@ def __setup(self):
self.__csvPath = os.path.join(self.__sessionPath, self.__entryId + "_ccd_no_pcm_ann.csv")
self.__entryFile = None
#
# self.__listItemTemplate = (
# '<li><a id="%s" class="discontrol ui-corner-all" href="#">'
# + '<span class="ui-icon fltlft ui-icon-circle-arrow-e"></span> %s </a>\n'
# + '<div id="display_%s" style="display:none"></div>\n</li>\n'
# )
#
self.__tableTemplate = '<table id="table_%s" class="table table-condensed table-bordered table-striped">\n'
self.__tdTagTemplate = '<td style="border-style:none">%s</td>\n'
self.__editableTemplate = '<b class="%s" id="%s" style="display:inline">%s</b>'
logging.info("Processing entry %s", self.__entryId)

def setLogHandle(self, log=sys.stderr):
"""Reset the stream for logging output."""
Expand All @@ -58,6 +53,8 @@ def setLogHandle(self, log=sys.stderr):

def run(self):
"""Generate JSON format data"""
logging.info("Processing entry %s", self.__entryId)

if not self.__identifier:
return False
#
Expand All @@ -70,7 +67,7 @@ def run(self):
return False

def __runPcmCcdCheck(self):
"""Run X program"""
"""Run PCM script to check missing annotation"""
self.__entryFile = self.__reqObj.getValue("entryfilename")
entry_file_path = os.path.join(self.__sessionPath, self.__entryFile)

Expand All @@ -83,6 +80,7 @@ def __runPcmCcdCheck(self):
try:
dp = RcsbDpUtility(tmpPath=self.__sessionPath, siteId=self.__siteId, verbose=self.__verbose, log=self.__lfh)
dp.imp(entry_file_path)
dp.addInput(name="id", value=self.__entryId)
dp.op("annot-pcm-check-ccd-ann")
dp.exp(dstPath=self.__csvPath)
dp.expLog(os.path.join(self.__sessionPath, self.__entryId + "_ccd_no_pcm_ann.log"))
Expand Down Expand Up @@ -111,7 +109,7 @@ def __buildCCDFormHtml(self):
if not os.access(self.__csvPath, os.F_OK):
myD = {}
myD["statuscode"] = "failed"
myD["statustext"] = "Failed to build form for x"
myD["statustext"] = "Failed to build form for %s" % self.__entryId
return myD

htmlcontent = self.__tableTemplate % self.__identifier
Expand Down
7 changes: 0 additions & 7 deletions wwpdb/apps/ann_tasks_v2/webapp/CommonTasksWebAppWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,16 +1155,9 @@ def _pcmGetCCDFormOp(self):
myD["statuscode"] = "running"
#
else:
# entryId = self._reqObj.getValue("entryid")
# identifier = self._reqObj.getValue("display_identifier")
dU.set(workerObj=ccdEditorFormOp, workerMethod="run")
dU.runDetach()
myD["statuscode"] = "running"

# if (identifier == entryId) or identifier.startswith("chain_"):
# else:
# myD = ccdEditorFormOp.get()
#
#
rC = ResponseContent(reqObj=self._reqObj, verbose=self._verbose, log=self._lfh)
rC.setReturnFormat("json")
Expand Down

0 comments on commit 5b8b5b3

Please sign in to comment.