5 START = 'self._commands = {'
10 while START not in line:
15 print('Reach end of file!', file=sys.stderr)
20 with open('mpdaio/client.py', 'r', encoding='utf-8') as fd:
21 # fast forward to find self._commands
23 cmd_patt = '"(?P<command>.*)":'
24 tit_patt = '# ?(?P<title>.*)'
25 cmd_regex = re.compile(cmd_patt)
26 tit_regex = re.compile(tit_patt)
27 # Now extract supported commands
29 while line and END not in line:
31 cmd = cmd_regex.search(line)
32 tit = tit_regex.search(line)
35 print('^'*len(tit[1]))
40 if __name__ == '__main__':