mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
flatten list
This commit is contained in:
parent
4b455d45e9
commit
0070cb7af0
1 changed files with 5 additions and 8 deletions
|
@ -11,17 +11,14 @@ import yaml
|
||||||
from printerlinter import factory
|
from printerlinter import factory
|
||||||
|
|
||||||
|
|
||||||
def examineFile(file, settings):
|
def examineFile(file, settings, full_body_check):
|
||||||
patient = factory.create(file, settings)
|
patient = factory.create(file, settings)
|
||||||
if patient is None:
|
if patient is None:
|
||||||
return {}
|
return
|
||||||
|
|
||||||
body_check = []
|
|
||||||
for diagnostic in patient.check():
|
for diagnostic in patient.check():
|
||||||
if diagnostic:
|
if diagnostic:
|
||||||
body_check.append(diagnostic.toDict())
|
full_body_check["Diagnostics"].append(diagnostic.toDict())
|
||||||
|
|
||||||
return body_check
|
|
||||||
|
|
||||||
|
|
||||||
def fixFile(file, settings, full_body_check):
|
def fixFile(file, settings, full_body_check):
|
||||||
|
@ -103,9 +100,9 @@ def main():
|
||||||
for file in files:
|
for file in files:
|
||||||
if file.is_dir():
|
if file.is_dir():
|
||||||
for fp in file.rglob("**/*"):
|
for fp in file.rglob("**/*"):
|
||||||
full_body_check["Diagnostics"].append(examineFile(fp, settings))
|
examineFile(fp, settings, full_body_check)
|
||||||
else:
|
else:
|
||||||
full_body_check["Diagnostics"].append(examineFile(file, settings))
|
examineFile(file, settings, full_body_check)
|
||||||
|
|
||||||
results = yaml.dump(full_body_check, default_flow_style=False, indent=4, width=240)
|
results = yaml.dump(full_body_check, default_flow_style=False, indent=4, width=240)
|
||||||
if report:
|
if report:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue