/bindings/python/sigrok/__pycache__/
/bindings/python/sigrok/core/classes.py
/bindings/python/sigrok/core/classes_wrap.cpp
-/bindings/python/sigrok/core/doc.i
+/bindings/python/sigrok/core/doc_start.i
+/bindings/python/sigrok/core/doc_end.i
/bindings/python/sigrok/core/lowlevel.py
/bindings/python/sigrok/core/lowlevel_wrap.c
/bindings/python/timestamp
if BINDINGS_PYTHON
PDIR = bindings/python
-PDOC = bindings/python/sigrok/core/doc.i
+PDOC_START = bindings/python/sigrok/core/doc_start.i
+PDOC_END = bindings/python/sigrok/core/doc_end.i
setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' LDADD='$(PYSIGROK_LIBS)'
setup_quiet = --quiet
setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
-$(PDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
+$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
$(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
- $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) > $@
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
+
+$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
+ $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
python-build: $(PDIR)/timestamp
$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
- bindings/swig/classes.i bindings/swig/enums.i $(PDOC) \
- $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
+ bindings/swig/classes.i bindings/swig/enums.i $(PDOC_START) \
+ $(PDOC_END) $(library_include_HEADERS) \
+ $(nodist_library_include_HEADERS) \
$(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
$(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
@ORDER@ bindings/cxx/libsigrokcxx.la
%ignore sigrok::InputFormat::create_input;
%ignore sigrok::OutputFormat::create_output;
-%include "doc.i"
+%include "doc_start.i"
%define %attributevector(Class, Type, Name, Get)
%rename(_ ## Get) sigrok::Class::Get;
data = property(_data)
}
}
+
+%include "doc_end.i"
from xml.etree import ElementTree
import sys, os
-language, input_file = sys.argv[1:]
+language, input_file = sys.argv[1:3]
+if len(sys.argv) == 4:
+ mode = sys.argv[3]
input_dir = os.path.dirname(input_file)
index = ElementTree.parse(input_file)
trimmed_name, member_name))
print('%}')
elif language == 'python' and constants:
- print('%%extend %s {\n%%pythoncode %%{' % class_name)
- for member_name, brief in constants:
- print(' ## @brief %s\n %s = None' % (brief, member_name))
- print('%}\n}')
+ if mode == 'start':
+ print('%%extend %s {\n%%pythoncode %%{' % class_name)
+ for member_name, brief in constants:
+ print(' ## @brief %s\n %s = None' % (brief, member_name))
+ print('%}\n}')
+ elif mode == 'end':
+ print('%pythoncode %{')
+ for member_name, brief in constants:
+ print('%s.%s.__doc__ = """%s"""' % (
+ trimmed_name, member_name, brief))
+ print('%}')