Browse Source

debugging

master
Ulrich Carmesin 3 years ago
parent
commit
285bfba462
  1. 2
      test/test_compare.py
  2. 6
      utils/data_const.py
  3. 3
      utils/file_tool.py
  4. 16
      utils/match_tool.py

2
test/test_compare.py

@ -184,7 +184,7 @@ class MyTestCase(unittest.TestCase):
comp.conf = conf comp.conf = conf
matching = utils.match_tool.Matching(comp) matching = utils.match_tool.Matching(comp)
matching.htmltext = "" matching.htmltext = ""
matching.setData(tdata, utils.match_tool.MATCH_POSTCOND) matching.setData(tdata, M.MATCH_POSTCOND)
text = utils.match_tool.matchTree(matching) text = utils.match_tool.matchTree(matching)
print("\n-------------\n") print("\n-------------\n")
print(text) print(text)

6
utils/data_const.py

@ -26,3 +26,9 @@ CSV_NODETYPE_KEYS = "_keys"
ATTR_SRC_TYPE = "tdtyp" ATTR_SRC_TYPE = "tdtyp"
ATTR_SRC_DATA = "tdsrc" ATTR_SRC_DATA = "tdsrc"
ATTR_SRC_NAME = "tdname" ATTR_SRC_NAME = "tdname"
DEFAULT_DB_PARTITION = "n"
""" attribute if table is partitioned - partitions are parametrized """
DEFAULT_DB_CONN_JAR = "n"
""" attribute for connection-jar-file instead of connection by ip, port """

3
utils/file_tool.py

@ -13,6 +13,7 @@ import yaml
import basic.message import basic.message
import basic.program import basic.program
import utils.data_const as D
from pprint import pp from pprint import pp
import utils.tdata_tool import utils.tdata_tool
@ -170,7 +171,7 @@ def readFileDict(path, msg):
if not os.path.exists(path): if not os.path.exists(path):
return doc return doc
enc = detectFileEncode(path, msg) enc = detectFileEncode(path, msg)
if D.DFILE_TYPE_YML in path[-5:]: if D.DFILE_TYPE_YML in path[-4:]:
with open(path, 'r', encoding=enc) as file: with open(path, 'r', encoding=enc) as file:
doc = yaml.full_load(file) doc = yaml.full_load(file)
file.close() file.close()

16
utils/match_tool.py

@ -93,13 +93,13 @@ class Matching():
job.debug(verify, "getDiffHeader ") job.debug(verify, "getDiffHeader ")
htmltxt = "<!DOCTYPE html>" htmltxt = "<!DOCTYPE html>"
htmltxt += "<html><head>" htmltxt += "<html><head>"
htmltxt += "<title>"+M.MARCH[matching.matchtype]["title"]+"</title>" htmltxt += "<title>"+M.MATCH[matching.matchtype]["title"]+"</title>"
htmltxt += utils.css_tool.getInternalStyle("diffFiles") htmltxt += utils.css_tool.getInternalStyle("diffFiles")
htmltxt += "</head>" htmltxt += "</head>"
htmltxt += "<body>" htmltxt += "<body>"
htmltxt += "<h1>"+M.MARCH[matching.matchtype]["title"]+"</h1>" htmltxt += "<h1>"+M.MATCH[matching.matchtype]["title"]+"</h1>"
htmltxt += "<h4>"+M.MARCH[M.MARCH[matching.matchtype]["A"]]["long"]+": "+matching.matchfiles["A"]+"</h4>" htmltxt += "<h4>"+M.MATCH[M.MATCH[matching.matchtype]["A"]]["long"]+": "+matching.matchfiles["A"]+"</h4>"
htmltxt += "<h4>"+M.MARCH[M.MARCH[matching.matchtype]["B"]]["long"]+": "+matching.matchfiles["B"]+"</h4><br>" htmltxt += "<h4>"+M.MATCH[M.MATCH[matching.matchtype]["B"]]["long"]+": "+matching.matchfiles["B"]+"</h4><br>"
matching.htmltext = htmltxt matching.htmltext = htmltxt
def setDiffFooter(self): def setDiffFooter(self):
@ -276,7 +276,7 @@ def getEvaluation(matching, type, acceptance, sideA, sideB):
result = "test" result = "test"
if match == "99": return ["MATCH", "novalue", "novalue", "novalue", "novalue"] if match == "99": return ["MATCH", "novalue", "novalue", "novalue", "novalue"]
if acceptance == "ignore": result = "ignore" if acceptance == "ignore": result = "ignore"
if (matching.matchtype == M.MARCH_POSTCOND) and (result == "test"): if (matching.matchtype == M.MATCH_POSTCOND) and (result == "test"):
result = "hard" result = "hard"
classA = "diffA" classA = "diffA"
classB = "diffB" classB = "diffB"
@ -392,7 +392,7 @@ def markRow(matching, header, row, side):
cssClass = res[2] cssClass = res[2]
text += "<td "+utils.css_tool.getInlineStyle("diffFiles", cssClass)+">"+val+"</td>" text += "<td "+utils.css_tool.getInlineStyle("diffFiles", cssClass)+">"+val+"</td>"
text = "<tr><td "+utils.css_tool.getInlineStyle("diffFiles", cssClass)+">" \ text = "<tr><td "+utils.css_tool.getInlineStyle("diffFiles", cssClass)+">" \
+ M.MARCH[M.MARCH[matching.matchtype][side]]["short"] + "</td>"+text+"</tr>" + M.MATCH[M.MATCH[matching.matchtype][side]]["short"] + "</td>"+text+"</tr>"
matching.difftext += text matching.difftext += text
return text return text
@ -447,8 +447,8 @@ def compareRow(matching, header, rA, rB):
matching.setCssClass("result1") matching.setCssClass("result1")
if allident: if allident:
return "<tr><td/>"+textA+"</tr>" return "<tr><td/>"+textA+"</tr>"
text = "<tr><td>"+M.MARCH[M.MARCH[matching.matchtype]["A"]]["short"]+"</td>"+textA+"</tr>" text = "<tr><td>"+M.MATCH[M.MATCH[matching.matchtype]["A"]]["short"]+"</td>"+textA+"</tr>"
text += "<tr><td>"+M.MARCH[matching.matchtype]["shortB"]+"</td>"+textB+"</tr>" text += "<tr><td>"+M.MATCH[matching.matchtype]["shortB"]+"</td>"+textB+"</tr>"
matching.difftext += text matching.difftext += text
return text return text

Loading…
Cancel
Save