code: def upload_prev(ver, doc_root='./'):
      'push a copy of older release to appropriate version directory'
      local_dir = doc_root + 'build/html'
      remote_dir = '/usr/share/nginx/pandas/pandas-docs/version/%s/' % ver
      cmd = 'cd %s; rsync -avz . pandas@pandas.pydata.org:%s -essh'
      cmd = cmd % (local_dir, remote_dir)
      print cmd
      if os.system(cmd):
          raise SystemExit(
              'Upload to %s from %s failed' % (remote_dir, local_dir))
  
      local_dir = doc_root + 'build/latex'
      pdf_cmd = 'cd %s; scp pandas.pdf pandas@pandas.pydata.org:%s'
      pdf_cmd = pdf_cmd % (local_dir, remote_dir)
      if os.system(pdf_cmd):
          raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root)f upload_prev(ver, doc_root='./'):
      'push a copy of older release to appropriate version directory'
      local_dir = doc_root + 'build/html'
      remote_dir = '/usr/share/nginx/pandas/pandas-docs/version/%s/' % ver
      cmd = 'cd %s; rsync -avz . pandas@pandas.pydata.org:%s -essh'
      cmd = cmd % (local_dir, remote_dir)
      print cmd
      if os.system(cmd):
          raise SystemExit(
              'Upload to %s from %s failed' % (remote_dir, local_dir))
  
      local_dir = doc_root + 'build/latex'
      pdf_cmd = 'cd %s; scp pandas.pdf pandas@pandas.pydata.org:%s'
      pdf_cmd = pdf_cmd % (local_dir, remote_dir)
      if os.system(pdf_cmd):
          raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))
docs: push a copy of older release to appropriate version directory