Created
April 29, 2013 23:46
-
-
Save three18ti/5485689 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import platform | |
import shutil | |
import cPickle | |
org_state_file_path = os.path.expanduser('~/.config/deluge/state/torrents.state') | |
new_state_file_path = os.path.expanduser('~/torrents.state.new') | |
state_file_org = open(org_state_file_path, 'rb') | |
state_file_new = open(newstate_file_path, 'rb') | |
state_org = cPickle.load(state_file_org) | |
state_new = cPickle.load(state_file_new) | |
final_state = state_org + state_new | |
shutil.copyfile(org_state_file_path, org_state_file_path + '.old') | |
state_file = open(state_file_path, 'wb') | |
cPickle.dump(state, final_state) | |
state_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment