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

Error when trying to show current backup: AttributeError: 'list' object has no attribute 'items'~ #295

Closed
YYYasin19 opened this issue Jun 16, 2021 · 4 comments

Comments

@YYYasin19
Copy link

Hey,

I hope this wasn't already mentioned somewhere else (on first glance, I couldn't find an issue).
Everytime I try to look into the config of shallow-backup, I get the following error:

shallow-backup -show

 #######################
 # SHALLOW BACKUP CONFIG
 #######################

 Backup Path: ~/shallow-backup

 Dotfiles: (Backup and Reinstall conditions will be shown if they exist)
 Traceback (most recent call last):
   File "/Users/ytatar/anaconda3/bin/shallow-backup", line 8, in <module>
     sys.exit(cli())
   File "/Users/ytatar/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
     return self.main(*args, **kwargs)
   File "~/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
     rv = self.invoke(ctx)
   File "~/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
     return ctx.invoke(self.callback, **ctx.params)
   File "~/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
     return callback(*args, **kwargs)
   File "~/anaconda3/lib/python3.8/site-packages/shallow_backup/__main__.py", line 71, in cli
     show_config()
   File "~/anaconda3/lib/python3.8/site-packages/shallow_backup/config.py", line 177, in show_config
     for dotfile, options in contents.items():
 AttributeError: 'list' object has no attribute 'items'~

Have I somehow broken my configuration file? Where is it located?

Thanks in advance!

@alichtman
Copy link
Owner

alichtman commented Jun 18, 2021

Can you post your config and I'll take a look? Some better error handling could be added here, but I don't have the time. Happy to help with a PR though.

$ cat ~/.config/shallow-backup.conf

@YYYasin19
Copy link
Author

{
    "backup_path": "~/shallow-backup",
    "dotfiles": [
        ".bash_profile",
        ".bashrc",
        ".config/git",
        ".config/nvim/init.vim",
        ".config/tmux",
        ".config/zsh",
        ".profile",
        ".pypirc",
        ".ssh",
        ".zshenv",
        ".config/shallow-backup.conf",
        ".config/fish",
        ".local/share/fish"
    ],
    "root-gitignore": [
        "dotfiles/.ssh",
        "dotfiles/.pypirc",
        ".DS_Store"
    ],
    "dotfiles-gitignore": [
        ".ssh",
        ".pypirc",
        ".DS_Store"
    ],
    "config_mapping": {
        "/Users/ytatar/Library/Application Support/Sublime Text 2": "sublime2",
        "/Users/ytatar/Library/Application Support/Sublime Text 3": "sublime3",
        "/Users/ytatar/Library/Application Support/Code/User/settings.json": "vscode/settings",
        "/Users/ytatar/Library/Application Support/Code/User/Snippets": "vscode/Snippets",
        "/Users/ytatar/Library/Application Support/Code/User/keybindings.json": "vscode/keybindings",
        "/Users/ytatar/.atom": "atom",
        "/Users/ytatar/Library/Preferences/com.apple.Terminal.plist": "terminal_plist"
    },
    "lowest_supported_version": "5.0.1"
}⏎

This is the configuration currently.

@alichtman
Copy link
Owner

alichtman commented Jul 4, 2021

No idea what's going on here tbh. Config looks good to me.

@YYYasin19
Copy link
Author

Seems gone now after a reinstall (didn't reinstall just for this). Will open a PR if it comes up again and I find a fix.
Thanks, though!

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

2 participants