diff --git a/python/scripts/generate_enums.py b/python/scripts/generate_enums.py index d20dbe3eb..ef028ef50 100644 --- a/python/scripts/generate_enums.py +++ b/python/scripts/generate_enums.py @@ -9,19 +9,7 @@ enums.cpp import re import subprocess - -# def remove_comments(text): -# def replacer(match): -# s = match.group(0) -# if s.startswith('/'): -# return " " # note: a space and not an empty string -# else: -# return s -# pattern = re.compile( -# r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', -# re.DOTALL | re.MULTILINE -# ) -# return re.sub(pattern, replacer, text) +from parse import remove_comments def extract_enums(lines): line_iter = iter(lines) diff --git a/python/src/enums.cpp b/python/src/enums.cpp index 9006aa002..bb7671e6f 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -278,4 +278,10 @@ void init_enums(py::module &m) { slsDetectorDefs::detectorModeType::INTERPOLATING) .value("ANALOG", slsDetectorDefs::detectorModeType::ANALOG) .export_values(); + + py::enum_(Defs, "burstMode") + .value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF) + .value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL) + .value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL) + .export_values(); }