Created
March 20, 2014 16:50
-
-
Save lasconic/9668440 to your computer and use it in GitHub Desktop.
Python script to find all SMuFL symbols used in MuseScore source
This file contains hidden or 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
import os | |
import re | |
def grep(path, regex, regexcontent): | |
regObj = re.compile(regex) | |
res = set() | |
for root, dirs, fnames in os.walk(path): | |
for fname in fnames: | |
if regObj.match(fname) and not "sym.cpp" in fname: | |
datafile = file(os.path.join(root, fname)) | |
for line in datafile: | |
matches = re.findall(regexcontent, line) | |
if len(matches) > 0: | |
for m in matches: | |
res.add(m) | |
return res | |
symbols = grep('/Users/lasconic/MuseScore', r'.*\.cpp', r'SymId\:\:(\w*)') | |
for s in sorted(symbols): | |
if s != "noSym": | |
print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment