Skip to content

Commit

Permalink
Filter out useless languages
Browse files Browse the repository at this point in the history
  • Loading branch information
vookimedlo committed Mar 21, 2018
1 parent aba2d1b commit b6127df
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
<key>script</key>
<string>query="{query}"
say -v $query "$textToSay"
#echo -n $query</string>
say -v $query "$textToSay"</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -117,6 +115,9 @@ import re
import sys
from subprocess import Popen, PIPE
langFilter = os.environ['language_filter']
langFilterRE = re.compile(langFilter, re.I)
query = "{query}"
try:
Expand All @@ -132,6 +133,11 @@ try:
for line in output:
results = voicesPattern.search(line)
if results:
# Filter out languages
#
if not langFilterRE.search(results.group(2)):
continue
# Alfred menu items
#
alfreditems['items'].append({
Expand Down Expand Up @@ -160,7 +166,7 @@ except:
<key>subtext</key>
<string></string>
<key>title</key>
<string>Preparing voice selection</string>
<string>Preparing a voice selection</string>
<key>type</key>
<integer>3</integer>
<key>withspace</key>
Expand Down Expand Up @@ -339,6 +345,15 @@ Icons taken from https://openclipart.org/detail/298688/silly-face-icon-umber</st
<integer>280</integer>
</dict>
</dict>
<key>variables</key>
<dict>
<key>language_filter</key>
<string></string>
</dict>
<key>variablesdontexport</key>
<array>
<string>language_filter</string>
</array>
<key>version</key>
<string>2018.03.XX</string>
<key>webaddress</key>
Expand Down

0 comments on commit b6127df

Please sign in to comment.