003 File Manager
Current Path:
/usr/src/contrib/cortex-strings/scripts
usr
/
src
/
contrib
/
cortex-strings
/
scripts
/
📁
..
📄
add-license.sh
(2.39 KB)
📄
bench.py
(5.53 KB)
📄
fixup.py
(504 B)
📄
libplot.py
(2.05 KB)
📄
plot-align.py
(1.97 KB)
📄
plot-sizes.py
(3.48 KB)
📄
plot-top.py
(1.54 KB)
📄
plot.py
(3.5 KB)
📄
trim.sh
(211 B)
Editing: fixup.py
"""Simple script that enables target specific blocks based on the first argument. Matches comment blocks like this: /* For Foo: abc def */ and de-comments them giving: abc def """ import re import sys def main(): key = sys.argv[1] expr = re.compile(r'/\* For %s:\s([^*]+)\*/' % key, re.M) for arg in sys.argv[2:]: with open(arg) as f: body = f.read() with open(arg, 'w') as f: f.write(expr.sub(r'\1', body)) if __name__ == '__main__': main()
Upload File
Create Folder