def build_docs(branch):
 os.chdir(os.path.join(gitdname, 'docs'))
 retcode = subprocess.call('make clean', shell=True, stdout=sys.stdout, stderr=sys.stderr)
 if (retcode != 0):
  os.chdir(dname)
  msg = ('Could not clean the html docs for branch %s' % branch)
  raise Exception(msg)
 sphinx_call = ' '.join(['make', 'html', "SPHINXBUILD=' python /usr/local/bin/sphinx-build'"])
 activate = os.path.join(virtual_dir, 'bin', 'activate')
 activate_virtualenv = ('. ' + activate)
 retcode = subprocess.call(' && '.join([activate_virtualenv, sphinx_call]), shell=True, env=env, stdout=sys.stdout, stderr=sys.stderr)
 if (retcode != 0):
  os.chdir(dname)
  msg = ('Could not build the html docs for branch %s' % branch)
  raise Exception(msg)
 os.chdir(dname)

def build_docs ( branch ) : os . chdir ( os . path . join ( gitdname , 'docs' ) ) retcode = subprocess . call ( 'make clean' , shell = True , stdout = sys . stdout , stderr = sys . stderr ) if ( retcode != 0 ) : os . chdir ( dname ) msg = ( 'Could not clean the html docs for branch %s' % branch ) raise Exception ( msg ) sphinx_call = ' ' . join ( [ 'make' , 'html' , "SPHINXBUILD=' python /usr/local/bin/sphinx-build'" ] ) activate = os . path . join ( virtual_dir , 'bin' , 'activate' ) activate_virtualenv = ( '. ' + activate ) retcode = subprocess . call ( ' && ' . join ( [ activate_virtualenv , sphinx_call ] ) , shell = True , env = env , stdout = sys . stdout , stderr = sys . stderr ) if ( retcode != 0 ) : os . chdir ( dname ) msg = ( 'Could not build the html docs for branch %s' % branch ) raise Exception ( msg ) os . chdir ( dname )
invoke sphinx make build to generate docs .