Skip to content

Commit

Permalink
DOC: update make.py script (pandas-dev#16456)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored and stangirala committed Jun 11, 2017
1 parent 4772a19 commit 9ec38fc
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,60 @@
SPHINX_BUILD = 'sphinxbuild'


def upload_dev(user='pandas'):
def _process_user(user):
if user is None or user is False:
user = ''
else:
user = user + '@'
return user


def upload_dev(user=None):
'push a copy to the pydata dev directory'
if os.system('cd build/html; rsync -avz . {0}@pandas.pydata.org'
user = _process_user(user)
if os.system('cd build/html; rsync -avz . {0}pandas.pydata.org'
':/usr/share/nginx/pandas/pandas-docs/dev/ -essh'.format(user)):
raise SystemExit('Upload to Pydata Dev failed')


def upload_dev_pdf(user='pandas'):
def upload_dev_pdf(user=None):
'push a copy to the pydata dev directory'
if os.system('cd build/latex; scp pandas.pdf {0}@pandas.pydata.org'
user = _process_user(user)
if os.system('cd build/latex; scp pandas.pdf {0}pandas.pydata.org'
':/usr/share/nginx/pandas/pandas-docs/dev/'.format(user)):
raise SystemExit('PDF upload to Pydata Dev failed')


def upload_stable(user='pandas'):
def upload_stable(user=None):
'push a copy to the pydata stable directory'
if os.system('cd build/html; rsync -avz . {0}@pandas.pydata.org'
user = _process_user(user)
if os.system('cd build/html; rsync -avz . {0}pandas.pydata.org'
':/usr/share/nginx/pandas/pandas-docs/stable/ -essh'.format(user)):
raise SystemExit('Upload to stable failed')


def upload_stable_pdf(user='pandas'):
def upload_stable_pdf(user=None):
'push a copy to the pydata dev directory'
if os.system('cd build/latex; scp pandas.pdf {0}@pandas.pydata.org'
user = _process_user(user)
if os.system('cd build/latex; scp pandas.pdf {0}pandas.pydata.org'
':/usr/share/nginx/pandas/pandas-docs/stable/'.format(user)):
raise SystemExit('PDF upload to stable failed')


def upload_prev(ver, doc_root='./', user='pandas'):
def upload_prev(ver, doc_root='./', user=None):
'push a copy of older release to appropriate version directory'
user = _process_user(user)
local_dir = doc_root + 'build/html'
remote_dir = '/usr/share/nginx/pandas/pandas-docs/version/%s/' % ver
cmd = 'cd %s; rsync -avz . %s@pandas.pydata.org:%s -essh'
cmd = 'cd %s; rsync -avz . %spandas.pydata.org:%s -essh'
cmd = cmd % (local_dir, user, 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 %s@pandas.pydata.org:%s'
pdf_cmd = 'cd %s; scp pandas.pdf %spandas.pydata.org:%s'
pdf_cmd = pdf_cmd % (local_dir, user, remote_dir)
if os.system(pdf_cmd):
raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))
Expand Down

0 comments on commit 9ec38fc

Please sign in to comment.