Major update to readRow which now extracts necessary row items into runtime for filtering. Debugging prints suppressed
This commit is contained in:
+22
-14
@@ -110,7 +110,7 @@ def readRow(action, resolved, outputs):
|
|||||||
columnattr = ""
|
columnattr = ""
|
||||||
columnattr = key + " " + value
|
columnattr = key + " " + value
|
||||||
|
|
||||||
print(columnattr)
|
#print(columnattr)
|
||||||
column_creation.append(columnattr)
|
column_creation.append(columnattr)
|
||||||
|
|
||||||
rowsearchvalue = action.readrow["rowsearchvalue"]
|
rowsearchvalue = action.readrow["rowsearchvalue"]
|
||||||
@@ -124,6 +124,10 @@ def readRow(action, resolved, outputs):
|
|||||||
value = resolved[item["resolved"]]
|
value = resolved[item["resolved"]]
|
||||||
|
|
||||||
values.append(value)
|
values.append(value)
|
||||||
|
|
||||||
|
exports = action.readrow["export"]
|
||||||
|
for column_index, output_name in exports.items():
|
||||||
|
outputs.pop(output_name, None)
|
||||||
|
|
||||||
database = sqlite3.connect("savedata/rmmanager.db")
|
database = sqlite3.connect("savedata/rmmanager.db")
|
||||||
|
|
||||||
@@ -142,21 +146,25 @@ def readRow(action, resolved, outputs):
|
|||||||
""",
|
""",
|
||||||
(value,)
|
(value,)
|
||||||
)
|
)
|
||||||
print("DEBUG RESOLVED TARGET ITEM")
|
#print("DEBUG READROW TARGET ITEM")
|
||||||
print(value)
|
#print(value)
|
||||||
|
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
print(result)
|
|
||||||
|
|
||||||
|
## extension for matching by unique item vs column find
|
||||||
try:
|
if result is not None:
|
||||||
target = result[action.readrow["columnnumber"]]
|
for column_index, output_name in exports.items():
|
||||||
except TypeError:
|
dbtarget = result[column_index]
|
||||||
target = None
|
outputs[output_name] = dbtarget# result[column_index]
|
||||||
print("Message ID not found in database")
|
#print("DEBUGGING DATABASE LINE EXTRACTION IN READROW")
|
||||||
|
#print(outputs[output_name])
|
||||||
outputs["databasetarget"] = target
|
#print(dbtarget)
|
||||||
|
|
||||||
print("READROW TEST")
|
return resolved, outputs
|
||||||
print(target)
|
else:
|
||||||
|
print(f"Search target {value} not found in database table {table}")
|
||||||
|
return resolved, outputs
|
||||||
|
|
||||||
|
#print("READROW SEARCH RESULT")
|
||||||
|
#print(target)
|
||||||
return resolved, outputs
|
return resolved, outputs
|
||||||
Reference in New Issue
Block a user