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

Errors after updating keep from v2.4.2 to v2.6.1 #50

Closed
krzysztof-wolowski opened this issue Mar 11, 2019 · 2 comments
Closed

Errors after updating keep from v2.4.2 to v2.6.1 #50

krzysztof-wolowski opened this issue Mar 11, 2019 · 2 comments

Comments

@krzysztof-wolowski
Copy link

File "/home/kris/.local/lib/python2.7/site-packages/keep/utils.py", line 72, in list_commands
    table_data.append(['$ ' + cmd, fields['desc'], fields['alias']])
TypeError: string indices must be integers

I was getting the above error when trying to run any keep command. Rolled back to v.2.4.2.

@OrkoHunter
Copy link
Owner

Hi @kriswolo ! Thank you for raising the issue. The problem is raised because the new version of keep uses a different schema for ~/.keep/commands.json. Unfortunately, no migration script has been shipped out with the latest version, hence the errors are being raised. (This is a technical error from my side, which I can not solve due to unavailability of time.) :(

The fix is as below:

# Use Python3

import os
import json

home_dir = os.path.expanduser("~")

with open(home_dir + "/.keep/commands.json", "r") as f:
    old_commands = json.load(f)

new_commands = {}

for key, value in old_commands.items():
    new_commands[key] = {
        "desc": value,
        "alias": ""
    }

print(new_commands)

Please put the new_commands inside your ~/.keep/commands.json and the new version will be good to go. Also please use pip3 to install keep. :)

Thank you! Let me know if the problem persists.

@jcdevil
Copy link

jcdevil commented Apr 16, 2019

Thx @OrkoHunter : worked fine for me !

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

4 participants