Skip to content

Instantly share code, notes, and snippets.

@three18ti
Created April 29, 2013 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save three18ti/5485689 to your computer and use it in GitHub Desktop.
Save three18ti/5485689 to your computer and use it in GitHub Desktop.
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