Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Set Settings #5

Closed
pntaylor opened this issue Jan 7, 2015 · 10 comments
Closed

Cannot Set Settings #5

pntaylor opened this issue Jan 7, 2015 · 10 comments

Comments

@pntaylor
Copy link

pntaylor commented Jan 7, 2015

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?

@shkm
Copy link

shkm commented Jan 7, 2015

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:

alfred preferences 2015-01-07 11-24-05

Also take a look at this issue

@shkm
Copy link

shkm commented Jan 7, 2015

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

@bachya
Copy link
Owner

bachya commented Jan 7, 2015

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?

@shkm
Copy link

shkm commented Jan 7, 2015

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

@bachya
Copy link
Owner

bachya commented Jan 7, 2015

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?

https://github.com/bachya/lp-vault-manager/releases/download/v3.2/LastPass.Vault.Manager.alfredworkflow

@shkm
Copy link

shkm commented Jan 8, 2015

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.

@bachya
Copy link
Owner

bachya commented Jan 8, 2015

@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?

@shkm
Copy link

shkm commented Jan 9, 2015

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!

@shkm
Copy link

shkm commented Jan 9, 2015

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.

@bachya
Copy link
Owner

bachya commented Jan 9, 2015

Great to hear, @shkm. That's a tricky one, indeed. My guess is that if you edited the file via the lpsettings command, TextEdit is to blame. Fortunately, you can prevent this rich text behavior inside the TextEdit properties:

screen shot 2015-01-09 at 11 46 33 am

I'll make sure to put a note in the README.

@bachya bachya closed this as completed Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants