new_contents: from scripts.migrate_piwik import settings
  
  def get_dir_for(phase):
      return '/'.join([
          settings.OUTPUT_DIR,
          settings.PHASES[phase.upper()]['DIR'],
      ])
  
  def get_history_run_id_for(phase):
      history = get_history_for(phase, 'r')
      return history.readline().replace('Run ID: ', '').rstrip()
  
  def get_history_for(phase, mode):
      filename = '/'.join([get_dir_for(phase), settings.HISTORY_FILENAME])
      return open(filename, mode)
  
  def get_complaints_run_id_for(phase):
      complaints = get_complaints_for(phase, 'r')
      return complaints.readline().replace('Run ID: ', '').rstrip()
  
  def get_complaints_for(phase, mode):
      filename = '/'.join([get_dir_for(phase), settings.COMPLAINTS_FILENAME])
      return open(filename, mode)
  
  
subject: add utility methods for piwik migration