diff options
author | Alexander_Kabui | 2024-04-25 19:45:00 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-16 12:52:59 +0300 |
commit | 7aa31cf63e17efe194e501bc37068a2207ab8f38 (patch) | |
tree | a352ddbeed7c503b56082b573c4c092a87c8d78c | |
parent | ae8a12f752281096ee5755679b0b29d834afa3b1 (diff) | |
download | genenetwork3-7aa31cf63e17efe194e501bc37068a2207ab8f38.tar.gz |
Pep8 formatting for response file.
-rw-r--r-- | gn3/llms/response.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gn3/llms/response.py b/gn3/llms/response.py index 11cbd94..93320e9 100644 --- a/gn3/llms/response.py +++ b/gn3/llms/response.py @@ -1,11 +1,10 @@ # pylint: skip-file -import string import json import os -basedir = os.path.abspath(os.path.dirname(__file__)) +basedir = os.path.abspath(os.path.dirname(__file__)) class DocIDs(): @@ -26,21 +25,20 @@ class DocIDs(): return result else: raise Exception("\n{0} -- File does not exist\n".format(file_path)) - + def formatDocIDs(self, values): for _key, _val in values.items(): if isinstance(_val, list): for theObject in _val: docName = self.formatDocumentName(theObject['filename']) - docID = theObject['id'] + docID = theObject['id'] self.doc_ids.update({docID: docName}) - - def formatDocumentName(self, val): - result = val.removesuffix('.pdf') - result = result.removesuffix('.txt') - result = result.replace('_', ' ') - return result + def formatDocumentName(self, val): + result = val.removesuffix('.pdf') + result = result.removesuffix('.txt') + result = result.replace('_', ' ') + return result def getInfo(self, doc_id): if doc_id in self.doc_ids.keys(): @@ -48,6 +46,7 @@ class DocIDs(): else: return doc_id + class RespContext(): def __init__(self, context): self.cntxt = context @@ -66,10 +65,9 @@ class RespContext(): def createAccordionFromJson(theContext): result = '' # loop thru json array - ndx = 0 for docID, summaryLst in theContext.items(): # item is a key with a list comboTxt = '' for entry in summaryLst: comboTxt += '\t' + entry['text'] - return result
\ No newline at end of file + return result |