Skip to content

Commit

Permalink
Merge pull request #67 from justinsalamon/nogrep
Browse files Browse the repository at this point in the history
Remove grep dependency, parse help string in python
  • Loading branch information
rabitt authored Apr 17, 2018
2 parents 3ed47c9 + 9d0e1de commit fe6f242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions sox/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ def _get_valid_formats():
if NO_SOX:
return []

shell_output = subprocess.check_output(
'sox -h | grep "AUDIO FILE FORMATS"',
shell=True
)
formats = str(shell_output).strip('\n').split(' ')[3:]
so = subprocess.check_output('sox -h', shell=True)
if type(so) is not str:
so = str(so, encoding='UTF-8')
so = so.split('\n')
idx = [i for i in range(len(so)) if 'AUDIO FILE FORMATS:' in so[i]][0]
formats = so[idx].split(' ')[3:]

return formats


Expand Down
2 changes: 1 addition & 1 deletion sox/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""Version info"""

short_version = '1.3'
version = '1.3.2'
version = '1.3.3'

0 comments on commit fe6f242

Please sign in to comment.