sql: remove debug prints

This commit is contained in:
Andrej730
2026-09-02 14:51:48 +05:00
parent 6b62723aae
commit 2b0ebcee32
+1 -15
View File
@@ -144,8 +144,6 @@ class sqlite(file):
self.ifc_class_inverses = {}
for declaration in self.ifc_schema.entities():
# print('Dealing with declaration', declaration.name())
self.ifc_class_subtypes[declaration.name()] = ifcopenshell.util.schema.get_subtypes(declaration)
self.ifc_class_attributes[declaration.name()] = {a.name(): a for a in declaration.all_attributes()}
self.ifc_class_inverse_attributes[declaration.name()] = {
@@ -166,7 +164,6 @@ class sqlite(file):
self.ifc_class_inverses[subtype.name()][declaration.name()].append(attribute.name())
elif self.is_entity_list(attribute):
# print('is an entity list', attribute.name())
entity_list.append(attribute.name())
for entity_name in re.findall("<entity (.*?)>", str(attribute)):
@@ -258,7 +255,6 @@ class sqlite(file):
results.append(result)
if max_levels is None or max_levels:
queue.append(result)
# print('traverse results', results)
return results
def get_inverse(
@@ -351,9 +347,7 @@ class sqlite_entity:
wrapped_data: ifcopenshell.entity_instance
def __init__(self, id: int, ifc_class: str, file: sqlite = None):
if not ifc_class:
print(id, ifc_class, file)
assert False
assert ifc_class, (id, ifc_class, file)
s = sqlite_wrapper(id, ifc_class, file)
object.__setattr__(self, "wrapped_data", file._create_entity(ifc_class))
object.__setattr__(self, "sqlite_wrapper", s)
@@ -383,9 +377,6 @@ class sqlite_entity:
self.sqlite_wrapper.attribute_cache = {}
def __getattr__(self, name: str) -> Any:
# print("*" * 100)
# print("GETATTR", self.sqlite_wrapper.id, self.sqlite_wrapper.ifc_class, name)
INVALID, FORWARD, INVERSE, DERIVED = range(4)
attr_cat = self.wrapped_data.get_attribute_category(name)
if attr_cat == DERIVED:
@@ -394,13 +385,8 @@ class sqlite_entity:
return None
if attr_cat == FORWARD:
if self.sqlite_wrapper.attribute_cache:
# print(self.sqlite_wrapper.ifc_class)
# print(self.sqlite_wrapper.attribute_cache)
return self.sqlite_wrapper.attribute_cache[name]
# print('first time for', self.sqlite_wrapper.ifc_class)
# print("IT IS A FORWARD")
query = f"SELECT * FROM {self.sqlite_wrapper.ifc_class} WHERE `ifc_id` = {self.sqlite_wrapper.id} LIMIT 1"
self.sqlite_wrapper.file.cursor.execute(query)
row = self.sqlite_wrapper.file.cursor.fetchone()