Skip to content

Commit

Permalink
Merge pull request #15 from Senzing/issue-14.dockter.1
Browse files Browse the repository at this point in the history
#14 Fix PEP-8 issues
  • Loading branch information
jaeadams authored Apr 5, 2022
2 parents 3d9d3bd + d22b694 commit 7e94af3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 33 deletions.
13 changes: 13 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>g2configtables</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
63 changes: 30 additions & 33 deletions G2ConfigTables.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#--python imports
# --python imports
import optparse
import sys
import os
import json

#======================
class G2ConfigTables:
#======================

# ======================
class G2ConfigTables:

#----------------------------------------
def __init__(self,configJson):
# ----------------------------------------
def __init__(self, configJson):
self.configJsonDoc = configJson


#----------------------------------------
#-- g2 specific calls
#----------------------------------------
# ----------------------------------------
# -- g2 specific calls
# ----------------------------------------

#----------------------------------------
# ----------------------------------------
def loadConfig(self, tableName):
cfgDict = {}
cfgDataRoot = json.loads(self.configJsonDoc)
Expand All @@ -27,36 +25,35 @@ def loadConfig(self, tableName):
for rowNode in tableNode:
cfgNodeEntry = {}
if tableName.upper() == 'CFG_DSRC':
cfgNodeEntry['ID'] = rowNode['DSRC_ID'];
cfgNodeEntry['DSRC_CODE'] = rowNode['DSRC_CODE'];
cfgNodeEntry['ID'] = rowNode['DSRC_ID']
cfgNodeEntry['DSRC_CODE'] = rowNode['DSRC_CODE']
cfgDict[cfgNodeEntry['DSRC_CODE']] = cfgNodeEntry
elif tableName.upper() == 'CFG_ETYPE':
cfgNodeEntry['ID'] = rowNode['ETYPE_ID'];
cfgNodeEntry['ETYPE_CODE'] = rowNode['ETYPE_CODE'];
cfgNodeEntry['ID'] = rowNode['ETYPE_ID']
cfgNodeEntry['ETYPE_CODE'] = rowNode['ETYPE_CODE']
cfgDict[cfgNodeEntry['ETYPE_CODE']] = cfgNodeEntry
elif tableName.upper() == 'CFG_FTYPE':
cfgNodeEntry['ID'] = rowNode['FTYPE_ID'];
cfgNodeEntry['FTYPE_CODE'] = rowNode['FTYPE_CODE'];
cfgNodeEntry['FTYPE_FREQ'] = rowNode['FTYPE_FREQ'];
cfgNodeEntry['FTYPE_EXCL'] = rowNode['FTYPE_EXCL'];
cfgNodeEntry['FTYPE_STAB'] = rowNode['FTYPE_STAB'];
cfgNodeEntry['DERIVED'] = rowNode['DERIVED'];
cfgNodeEntry['ID'] = rowNode['FTYPE_ID']
cfgNodeEntry['FTYPE_CODE'] = rowNode['FTYPE_CODE']
cfgNodeEntry['FTYPE_FREQ'] = rowNode['FTYPE_FREQ']
cfgNodeEntry['FTYPE_EXCL'] = rowNode['FTYPE_EXCL']
cfgNodeEntry['FTYPE_STAB'] = rowNode['FTYPE_STAB']
cfgNodeEntry['DERIVED'] = rowNode['DERIVED']
cfgDict[cfgNodeEntry['FTYPE_CODE']] = cfgNodeEntry
elif tableName.upper() == 'CFG_ERRULE':
cfgNodeEntry['ID'] = rowNode['ERRULE_ID'];
cfgNodeEntry['ERRULE_CODE'] = rowNode['ERRULE_CODE'];
cfgNodeEntry['REF_SCORE'] = rowNode['REF_SCORE'];
cfgNodeEntry['RTYPE_ID'] = rowNode['RTYPE_ID'];
cfgNodeEntry['ID'] = rowNode['ERRULE_ID']
cfgNodeEntry['ERRULE_CODE'] = rowNode['ERRULE_CODE']
cfgNodeEntry['REF_SCORE'] = rowNode['REF_SCORE']
cfgNodeEntry['RTYPE_ID'] = rowNode['RTYPE_ID']
cfgDict[cfgNodeEntry['ID']] = cfgNodeEntry
elif tableName.upper() == 'CFG_ATTR':
cfgNodeEntry['ATTR_ID'] = rowNode['ATTR_ID'];
cfgNodeEntry['ATTR_CODE'] = rowNode['ATTR_CODE'];
cfgNodeEntry['ATTR_CLASS'] = rowNode['ATTR_CLASS'];
cfgNodeEntry['FTYPE_CODE'] = rowNode['FTYPE_CODE'];
cfgNodeEntry['FELEM_CODE'] = rowNode['FELEM_CODE'];
cfgNodeEntry['FELEM_REQ'] = rowNode['FELEM_REQ'];
cfgNodeEntry['ATTR_ID'] = rowNode['ATTR_ID']
cfgNodeEntry['ATTR_CODE'] = rowNode['ATTR_CODE']
cfgNodeEntry['ATTR_CLASS'] = rowNode['ATTR_CLASS']
cfgNodeEntry['FTYPE_CODE'] = rowNode['FTYPE_CODE']
cfgNodeEntry['FELEM_CODE'] = rowNode['FELEM_CODE']
cfgNodeEntry['FELEM_REQ'] = rowNode['FELEM_REQ']
cfgDict[cfgNodeEntry['ATTR_CODE']] = cfgNodeEntry
else:
return None
return None
return cfgDict

0 comments on commit 7e94af3

Please sign in to comment.