Skip to content

Commit

Permalink
Make updates work; turn off Norwegian locale
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Dec 29, 2014
1 parent 6447bc9 commit b63c490
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
Binary file not shown.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ by two newlines (`\n\n`).
- Lithuanian
- Latvian
- Dutch
- Norwegian
- Polish
- Portuguese (BR)
- Russian
Expand Down
8 changes: 7 additions & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import sys

from workflow import Workflow
from fakum import ALL_LOCALES, DEFAULT_SETTINGS, UPDATE_SETTINGS, HELP_URL
from fakeum import ALL_LOCALES, DEFAULT_SETTINGS, UPDATE_SETTINGS, HELP_URL

ALFRED_AS = 'tell application "Alfred 2" to search "fakeconfig "'

Expand Down Expand Up @@ -59,6 +59,12 @@ def main(wf):
subprocess.call(['osascript', '-e', ALFRED_AS])
return 0

if wf.update_available:
wf.add_item('A newer version is available',
'↩ to install update',
autocomplete='workflow:update',
icon='update-available.png')

query = args.get('<query>')

locales = sorted([(v, k) for (k, v) in ALL_LOCALES.items()])
Expand Down
11 changes: 5 additions & 6 deletions src/fakum.py → src/fakeum.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

DELIMITER = '⟩'

HELP_URL = 'https://github.com/deanishe/alfred-fakum'
UPDATE_SETTINGS = {'github_slug': 'deanishe/alfred-fakum'}
HELP_URL = 'https://github.com/deanishe/alfred-fakeum'
UPDATE_SETTINGS = {'github_slug': 'deanishe/alfred-fakeum'}

# All locales supported by faker
ALL_LOCALES = {
Expand All @@ -48,7 +48,7 @@
'lt_LT': 'Lithuanian',
'lv_LV': 'Latvian',
'nl_NL': 'Dutch',
'no_NO': 'Norwegian',
# 'no_NO': 'Norwegian', # Doesn't seem to be working :(
'pl_PL': 'Polish',
'pt_BR': 'Portuguese (BR)',
'ru_RU': 'Russian',
Expand All @@ -57,7 +57,6 @@
'zh_TW': 'Chinese (TW)',
}


DEFAULT_SETTINGS = {
'locales': [
# 'en_GB',
Expand Down Expand Up @@ -128,7 +127,7 @@ def get_faker():
"""Return random faker instance"""
global fakers
if not fakers:
for loc in wf.settings.get('locales', ALL_LOCALES):
for loc in wf.settings.get('locales', DEFAULT_SETTINGS['locales']):
fakers.append(Factory.create(loc))

return random.choice(fakers)
Expand Down Expand Up @@ -191,7 +190,7 @@ def get_fake_data(names=None, count=1):
def main(wf):

if wf.update_available:
wf.add_item('An newer version is available',
wf.add_item('A newer version is available',
'↩ to install update',
autocomplete='workflow:update',
icon='update-available.png')
Expand Down
6 changes: 3 additions & 3 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>net.deanishe.alfred-fakum</string>
<string>net.deanishe.alfred-fakeum</string>
<key>connections</key>
<dict>
<key>305FB681-8DA9-4F6C-9C38-1B3880FDD6BF</key>
Expand Down Expand Up @@ -63,7 +63,7 @@
<key>disabled</key>
<false/>
<key>name</key>
<string>Fakum</string>
<string>Fakeum</string>
<key>objects</key>
<array>
<dict>
Expand Down Expand Up @@ -116,7 +116,7 @@
<key>runningsubtext</key>
<string>Faking up some stuff…</string>
<key>script</key>
<string>/usr/bin/python fakum.py "{query}"</string>
<string>/usr/bin/python fakeum.py "{query}"</string>
<key>subtext</key>
<string>Fake data for testing</string>
<key>title</key>
Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0
1.1

0 comments on commit b63c490

Please sign in to comment.