def _save_state(state):
 try:
  with open(config['statefile'].as_filename(), 'w') as f:
   pickle.dump(state, f)
 except IOError as exc:
  log.error(u'state file could not be written: {0}'.format(exc))

def _save_state ( state ) : try : with open ( config [ 'statefile' ] . as_filename ( ) , 'w' ) as f : pickle . dump ( state , f ) except IOError as exc : log . error ( u'state file could not be written: {0}' . format ( exc ) )
writes the state dictionary out to disk .