def build_pdf(branch):
 os.chdir(os.path.join(gitdname, 'statsmodels', 'docs'))
 sphinx_dir = os.path.join(virtual_dir, 'bin')
 retcode = subprocess.call(' '.join(['make', 'latexpdf', (('SPHINXBUILD=' + sphinx_dir) + '/sphinx-build')]), shell=True)
 if (retcode != 0):
  msg = ('Could not build the pdf docs for branch %s' % branch)
  raise Exception(msg)
 os.chdir(dname)

def build_pdf ( branch ) : os . chdir ( os . path . join ( gitdname , 'statsmodels' , 'docs' ) ) sphinx_dir = os . path . join ( virtual_dir , 'bin' ) retcode = subprocess . call ( ' ' . join ( [ 'make' , 'latexpdf' , ( ( 'SPHINXBUILD=' + sphinx_dir ) + '/sphinx-build' ) ] ) , shell = True ) if ( retcode != 0 ) : msg = ( 'Could not build the pdf docs for branch %s' % branch ) raise Exception ( msg ) os . chdir ( dname )
changes into new_branch_dir and builds the docs using sphinx in the buildenv virtualenv .