projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1030a7b
)
[py] use macro in docstring of generated objects macro if defined
author
Paul Brossier
<piem@piem.org>
Tue, 4 Dec 2018 01:42:17 +0000
(
02:42
+0100)
committer
Paul Brossier
<piem@piem.org>
Tue, 4 Dec 2018 01:42:17 +0000
(
02:42
+0100)
python/lib/gen_code.py
patch
|
blob
|
history
diff --git
a/python/lib/gen_code.py
b/python/lib/gen_code.py
index
a29a23f
..
b48f9a0
100644
(file)
--- a/
python/lib/gen_code.py
+++ b/
python/lib/gen_code.py
@@
-231,11
+231,21
@@
typedef struct{{
return out.format(do_inputs_list = do_inputs_list, **self.__dict__)
def gen_doc(self):
return out.format(do_inputs_list = do_inputs_list, **self.__dict__)
def gen_doc(self):
+ sig = []
+ for p in self.input_params:
+ name = p['name']
+ defval = aubiodefvalue[name].replace('"','\\\"')
+ sig.append("{name}={defval}".format(defval=defval, name=name))
out = """
out = """
-// TODO: add documentation
-static char Py_{shortname}_doc[] = \"undefined\";
+#ifndef PYAUBIO_{shortname}_doc
+#define PYAUBIO_{shortname}_doc "{shortname}({sig})"
+#endif /* PYAUBIO_{shortname}_doc */
+
+static char Py_{shortname}_doc[] = ""
+PYAUBIO_{shortname}_doc
+"";
"""
"""
- return out.format(**self.__dict__)
+ return out.format(
sig=', '.join(sig),
**self.__dict__)
def gen_new(self):
out = """
def gen_new(self):
out = """