-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding a new data file for things like pico sdk version
- Loading branch information
1 parent
b160048
commit 2fe65a0
Showing
5 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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,30 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import json | ||
import re | ||
|
||
def add_release_version(doxyfile_path, data_obj): | ||
with open(doxyfile_path) as f: | ||
doxy_content = f.read() | ||
version_search = re.search("(\nPROJECT_NUMBER\s*=\s*)([\d.]+)", doxy_content) | ||
if version_search is not None: | ||
version = version_search.group(2) | ||
data_obj["pico_sdk_release"] = version | ||
return data_obj | ||
|
||
def write_new_data_file(output_dir, data_obj): | ||
f = open(output_dir, 'w') | ||
f.write(json.dumps(data_obj)) | ||
f.close() | ||
return | ||
|
||
if __name__ == "__main__": | ||
# read the doxygen config file | ||
input_file = sys.argv[1] | ||
# output the new data file | ||
output_dir = sys.argv[2] | ||
data_obj = {} | ||
data_obj = add_release_version(input_file, data_obj) | ||
write_new_data_file(output_dir, data_obj) |
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