alfred-workflow-gauth
alfred-workflow-gauth copied to clipboard
When adding an account via Alfred for the first time, the config file is being corrupted
If you add an account for the first time using Alfred (instead of creating the file manually), the plugin is adding some comments to the end of the configuration file.
These comments cannot be parsed by the plugin, making it fail.
We could do one of the following to fix it:
- Stop adding comments
- Add support for comments
- (Suggestions??)
Example:
When I added my gmail account for the first time (via Alfred), the configuration file was created with the following data:
[[email protected]]
secret = a1b1 c1c2 b1b2 d3d4 asdf ghij zxc1 qwe3
xxxxxxxxxxxxxxxx
#
#[evernote - robert]
#secret=yyyyyyyyyyyyyyyyyy
A fixed ~/.gauth file would look like the following:
[[email protected]]
secret = a1b1 c1c2 b1b2 d3d4 asdf ghij zxc1 qwe3
I'm not sure, but the problem might be the sequence of x's (xxxxxxxxxxxxxxxx) and not the comments.
It's strange, the current default file is :
_CONFIG_FILE_INITIAL_CONTENT = \
"""#Examples of valid configurations:
#[google - [email protected]]
#secret=xxxxxxxxxxxxxxxxxx
#
#[evernote - robert]
#secret=yyyyyyyyyyyyyyyyyy
"""
(https://github.com/moul/alfred-workflow-gauth/blob/master/src/gauth.py#L20-L26)
How to you installed the workflow ? from packal ? It may be outdated
I don't remember how I've installed it, but I think I had the last version from trunk on my computer.
Looking at your comment, it looks like the config file initial content was written to the initial .gauth file and then, when adding the new key via the plugin, it overlapped the original content (that's the reason of the xxxxxxxxx without a comment on my example.
We should have appended the new key to the end of the file, not to the beginning - probably I've written this part of the code :)