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

Added backup() method to backup shortcuts.vdf before saving it #195

Merged
merged 1 commit into from
May 20, 2014

Conversation

geraldhumphries
Copy link
Contributor

This will backup each user's shortcuts.vdf file before saving the new one generated by Ice. The backups are saved to the folder "userdata/user_id/config/backups" with a timestamp.

@scottrice
Copy link
Owner

Awesome, thanks for doing this. I do have a few quick requests though before I merge it, comments inline.

# If they just called backup(), then overwrite the file that was used to
# generate the manager.
if not file:
file = self.shortcuts_file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think file is a great parameter. It doesn't make sense to me that a shortcut manager can backup any file on the users system. If the shortcut manager is going to have back something up, it should be the shortcuts file and the shortcuts file only. I would prefer file was removed as a parameter and these two lines were changed to

if not self.shortcuts_file:
    return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following what was laid out by the save method. The file parameter should be removed from there as well, as it can currently overwrite any file on the user's system with a generated shortcuts file. I do agree though, and I will change it when I get home from work.

Fixed comment

Changed backup() to use config file for the location and made it only
possible to backup the shortcuts file
@geraldhumphries
Copy link
Contributor Author

Updated and squashed the commits.

scottrice added a commit that referenced this pull request May 20, 2014
Added backup() method to backup shortcuts.vdf before saving it
@scottrice scottrice merged commit 2fd5a4c into scottrice:master May 20, 2014
@geraldhumphries geraldhumphries deleted the backupshortcuts branch May 20, 2014 21:30
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

Successfully merging this pull request may close these issues.

2 participants