Cannot Set Settings
pntaylor opened this issue · 10 comments
Hi,
I originally installed LPVM however had an issue and realised that it was due to me not having the LP CLI installed. I've now done this and, despite removing and re-installing the workflow I cannot set any settings. When I enter 'lpsettings' in Alfred it pauses, then wants to Google search for that rather than execute the workflow.
Any ideas?
Same problem here. It's probably erroring out.
Try clicking the debug button in the workflow's tab, which will give you an error console as shown:
Also take a look at this issue
Since I'm suffering the same problem, here's some more information.
I'm running the brand new 3.2 pre-release. Python is 2.7.9, installed via Homebrew. Yosemite 10.10.1.
Error upon running lpsettings:
[ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last):
File "settings.py", line 337, in <module>
wf.settings.setdefault(
File "/Users/jamie/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.2E81E083-924E-42B7-BE32-A4526307F271/workflow/workflow.py", line 1378, in settings
self._default_settings)
File "/Users/jamie/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.2E81E083-924E-42B7-BE32-A4526307F271/workflow/workflow.py", line 802, in __init__
self._load()
File "/Users/jamie/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.2E81E083-924E-42B7-BE32-A4526307F271/workflow/workflow.py", line 813, in _load
for key, value in json.load(file_obj, encoding='utf-8').items():
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 351, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Hi guys – sorry you're having troubles. I'll work with you to sort them out.
@shkm: what happens if you open Terminal and run cat ~/Library/Application\ Support/Alfred\ 2/Workflow\ Data/com.bachya.lpvm/settings.json
?
Here we go. Looks quite all right to me!
Debonair :: ~ % cat ~/Library/Application\ Support/Alfred\ 2/Workflow\ Data/com.bachya.lpvm/settings.json
{
"general": {
"browser": 1,
"cache_bust": 300
},
"lastpass": {
"path": "/usr/local/bin/lpass",
"username": “jamie@schembri.me”
},
"passwords": {
"length": 20,
"number": 10
}
}%
Debonair :: ~ % which /usr/local/bin/lpass
/usr/local/bin/lpass
Not sure what that's all about – I've published a new pre-release that may help us figure out what's going on. Try this and see if lpsettings
works?
The error above was taken from that version, @bachya. Perhaps it's something to do with my system or something. lpass and python were installed via homebrew, whilst Alfred was installed via homebrew cask, if that helps any.
@shkm, the release number is the same, but that's actually a link to a new .alfredworkflow
give (I'm choosing not to bump version numbers until I'm sure my changes are working). Try it and let me know?
Ah, fair enough!
Just gave it a shot, and unfortunately the error is still the same.
Side-track: thanks for this great workflow. Can't wait to start using it!
Oh, dear, I've found the problem. Look again at my settings.json
, particularly:
"username": “jamie@schembri.me”
The quotes are incorrect. I have no idea how this happened — I do recall editing the settings file at some point, but it's very unlikely that I'd have used anything but vim to do it, which wouldn't have inserted smart quotes.
Oh, well. It seems to be working now! Sorry to waste your time.