@echo off

REM This script is to patch python binding which is using None keyword for enum. Apply this patch until ACT is fixed

set "current_dir=%~dp0"

REM Specify the python binding file path
set "file_path=%current_dir%\..\Autogenerated\Bindings\Python\Lib3MF.py"

REM None is a python keyword which has to be replaced
set "search_line=	None = 0"

REM Replace None with BeamLatticeBallModeNone
set "new_line=	BeamLatticeBallModeNone = 0"

REM Use PowerShell to find and replace the line
powershell -Command "(Get-Content '%file_path%') -replace '%search_line%', '%new_line%' | Set-Content '%file_path%'"