Commit d04a1c7d authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Restore behaviour of accepting vids=None from processing functions

parent 3f072be6
......@@ -138,6 +138,10 @@ def runProcess(proc, dtable, vids):
addvids = []
addmeta = []
def expand(res, length):
if res is None: return [None] * length
else: return res
for result in results:
if result is None:
continue
......@@ -150,20 +154,20 @@ def runProcess(proc, dtable, vids):
# series/vids to add
if len(result) == 2:
add .extend(result[0])
addvids.extend(result[1])
addmeta.extend([None] * len(result[1]))
addvids.extend(expand(result[1], len(result[0])))
addmeta.extend(expand(None, len(result[0])))
# columns to remove, and
# series/vids to add
elif len(result) in (3, 4):
if len(result) == 3: meta = [None] * len(result[1])
else: meta = result[3]
if len(result) == 3:
result = list(result) + [None]
remove .extend(result[0])
add .extend(result[1])
addvids.extend(result[2])
addmeta.extend(meta)
addvids.extend(expand(result[2], len(result[1])))
addmeta.extend(expand(result[3], len(result[1])))
else:
raise error
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment