MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / __call__

Method __call__

test/run.py:64–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 self.failed = []
63 test_cases.append(self)
64 def __call__(self):
65 if self.fn.startswith("http://") or self.fn.startswith("ftp://"):
66 fn = self.store_as if self.store_as else self.fn.split("/")[-1]
67 if os.path.exists(os.path.join("input",fn)):
68 print ("[Notice] Already downloaded:",fn)
69 else:
70 print ("[Notice] Downloading:",fn)
71 urlretrieve(self.fn,os.path.join("input",fn))
72 self.fn = fn
73 if extension(self.fn) == '.zip':
74 print ("[Notice] Extracting:",self.fn)
75 zf = ZipFile(os.path.join("input",self.fn))
76 self.fn = [n for n in zf.namelist() if extension(n) == '.ifc' and not n.startswith('__') and not n.startswith('.')]
77 for fn in self.fn:
78 if not os.path.exists(os.path.join("input",fn)): zf.extract(fn,"input")
79 zf.close()
80 else: self.fn = [self.fn]
81 for fn in self.fn:
82 print ("[Notice] Rendering:",fn)
83 succes = subprocess.call(['blender','-b','-P','bpy.py','render',os.path.join("input",fn)]) == 0
84 if not succes: self.failed.append(fn)
85 return len(self.failed) == 0
86 def __str__(self): return "\n".join(self.failed) if len(self.failed) else ""
87
88# Karlsruher Institut fuer Technologie

Callers

nothing calls this directly

Calls 7

printFunction · 0.85
extensionFunction · 0.85
splitMethod · 0.80
joinMethod · 0.45
extractMethod · 0.45
closeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected