mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Pass around non-static logger instances and programmatic access to messages in-memory
This commit is contained in:
@@ -95,6 +95,7 @@ from .entity_instance import entity_instance, register_schema_attributes
|
||||
from .file import file, rocksdb_lazy_instance
|
||||
from .file import file as _file
|
||||
from .sql import sqlite, sqlite_entity
|
||||
from .ifcopenshell_wrapper import get_log, logger
|
||||
|
||||
# explicitly specify available imported symbols
|
||||
# (it's a requirement for a typed library)
|
||||
@@ -389,4 +390,3 @@ def convert_path_to_rocksdb(ifcspf_path: Union[Path, str], rocksdb_path: Union[P
|
||||
|
||||
version_core = ifcopenshell_wrapper.version()
|
||||
__version__ = version = "0.0.0"
|
||||
get_log = ifcopenshell_wrapper.get_log
|
||||
|
||||
@@ -461,6 +461,7 @@ def create_shape(
|
||||
inst: entity_instance,
|
||||
repr: Optional[entity_instance] = None,
|
||||
geometry_library: GEOMETRY_LIBRARY = "opencascade",
|
||||
logger: Optional[ifcopenshell.logger] = None,
|
||||
) -> Union[ShapeType, ShapeElementType, ifcopenshell_wrapper.Transformation, utils.shape_tuple, TopoDS.TopoDS_Shape]:
|
||||
"""
|
||||
Returns a geometric interpretation of the IFC entity instance
|
||||
@@ -507,7 +508,7 @@ def create_shape(
|
||||
return wrap_shape_creation(
|
||||
settings,
|
||||
ifcopenshell_wrapper.create_shape(
|
||||
settings, inst.wrapped_data, repr.wrapped_data if repr is not None else None, geometry_library
|
||||
settings, inst.wrapped_data, repr.wrapped_data if repr is not None else None, geometry_library, *(filter(None, (logger,)))
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user