This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c68a6d
commit 5454c66
Showing
10 changed files
with
1,979 additions
and
335 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import re | ||
|
||
fname = re.compile(r"\w+\s\*{0,1}\s{0,1}\w+\*{0,1}\s{0,1}\(") | ||
|
||
def clean (content): | ||
return content.replace("\n", "").replace(" ", " ") | ||
# return content | ||
|
||
with open('../include/framebot/objects.h') as f: | ||
content = f.read() | ||
|
||
names = fname.findall(content) | ||
dump = list() | ||
|
||
for name in names: | ||
tmp = content.split(name) | ||
params = tmp[1].split(");")[0] | ||
dump.append("{}{})".format(name, clean(params))) | ||
|
||
with open('../include/framebot/framebot.h') as f: | ||
content = f.read().split("#include <framebot/util.h>")[1] | ||
|
||
names = fname.findall(content) | ||
# dump = list() | ||
|
||
for name in names: | ||
tmp = content.split(name) | ||
params = tmp[1].split(");")[0] | ||
dump.append("{}{})".format(name, clean(params))) | ||
|
||
with open('functions.rst', 'w') as f: | ||
for func in dump: | ||
f.write(".. c:function:: {}\n\n".format(func)) |