diff --git a/modules/io/pymod/wrap_io.cc b/modules/io/pymod/wrap_io.cc index 6d16af3e91192a6b47c39a3f4d770e2be94cd260..302720245b63d534d88aceb2bba9c4d64bba0464 100644 --- a/modules/io/pymod/wrap_io.cc +++ b/modules/io/pymod/wrap_io.cc @@ -83,7 +83,8 @@ BOOST_PYTHON_MODULE(_ost_io) def("Instance",IOManager::Instance, return_value_policy<reference_existing_object>() ); - def("LoadEntity",LoadEntity,load_entity_ov()); + def("LoadEntity", LoadEntity, + load_entity_ov(args("filename", "format"))); def("SaveEntity", &save_ent_view, save_entity_view_ov(args("entity", "filename", "format"))); def("SaveEntity", &save_ent_handle, diff --git a/modules/io/src/mol/load_entity.cc b/modules/io/src/mol/load_entity.cc index 98eea40f861a728340b8ad97b79997800bbd6119..4ce5f94b7e7a2aad92bef022b44463881242641a 100644 --- a/modules/io/src/mol/load_entity.cc +++ b/modules/io/src/mol/load_entity.cc @@ -30,13 +30,13 @@ namespace ost { namespace io { namespace { -void Import(mol::EntityHandle& eh, const String& filename, int flag) +void Import(mol::EntityHandle& eh, const String& filename, const String& format) { Profile profile_import("import"); LOG_DEBUG("creating EntityIOHandle for " << filename); - EntityIOHandlerP ent_io = IOManager::Instance().FindEntityImportHandler(filename); + EntityIOHandlerP ent_io = IOManager::Instance().FindEntityImportHandler(filename, format); - // TODO: proper error handling + // note: error handling done in FindEntityImportHandler LOG_DEBUG("calling import on entity io handle"); ent_io->Import(eh,filename); @@ -53,12 +53,12 @@ void Import(mol::EntityHandle& eh, const String& filename, int flag) } // anon ns -mol::EntityHandle LoadEntity(const String& filename, int flag) +mol::EntityHandle LoadEntity(const String& filename, const String& format) { LOG_DEBUG("creating emtpy entity"); mol::EntityHandle eh=mol::CreateEntity(); mol::XCSEditor xcs_lock=eh.EditXCS(mol::BUFFERED_EDIT); - Import(eh,filename,flag); + Import(eh, filename, format); return eh; } diff --git a/modules/io/src/mol/load_entity.hh b/modules/io/src/mol/load_entity.hh index 0a38c07afbfeaac506badf1445606a101d670a70..80ff0bb492923ed94de7db92b7766bccc37efa8c 100644 --- a/modules/io/src/mol/load_entity.hh +++ b/modules/io/src/mol/load_entity.hh @@ -25,7 +25,7 @@ namespace ost { namespace io { // load unmanaged entity -DLLEXPORT_OST_IO mol::EntityHandle LoadEntity(const String& filename, int flag=0); +DLLEXPORT_OST_IO mol::EntityHandle LoadEntity(const String& filename, const String& format="auto"); }} // ns