Bindings: Python: Rework disk bindings
parent
a0c8cc62df
commit
fb3778f91b
|
|
@ -44,7 +44,7 @@ install(TARGETS icsneopy LIBRARY DESTINATION icsneopy)
|
|||
|
||||
find_program(STUBGEN_EXE stubgen)
|
||||
if(STUBGEN_EXE)
|
||||
add_custom_command(TARGET icsneopy POST_BUILD COMMAND stubgen -m icsneopy -o .)
|
||||
add_custom_command(TARGET icsneopy POST_BUILD COMMAND stubgen -v -p icsneopy -o .)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icsneopy.pyi py.typed DESTINATION icsneopy)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,14 @@
|
|||
|
||||
namespace icsneo {
|
||||
|
||||
// binding namespace workaround to avoid submodules
|
||||
struct DiskNamespace {
|
||||
using Access = icsneo::Disk::Access;
|
||||
using MemoryType = icsneo::Disk::MemoryType;
|
||||
};
|
||||
|
||||
void init_diskdriver(pybind11::module_& m) {
|
||||
auto disk = m.def_submodule("disk");
|
||||
pybind11::class_<DiskNamespace> disk(m, "Disk");
|
||||
pybind11::enum_<Disk::Access>(disk, "Access")
|
||||
.value("None", Disk::Access::None)
|
||||
.value("EntireCard", Disk::Access::EntireCard)
|
||||
|
|
|
|||
Loading…
Reference in New Issue