Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2013 23:46
What would you like to do?
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('~/')
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment