← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3474: Fix docs-generation.

 

------------------------------------------------------------
revno: 3474
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2014-10-15 09:02:01 +0200
message:
  Fix docs-generation.
  
  Revert the previous behaviour, calling sphinx.main function.
  It seems, new versions of sphinx are calling sys.exit() after
  execution, which breaks our doc generation.
  
  Now SystemExit is catched by try-except block.
modified:
  doc/sphinx/yadeSphinx.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'doc/sphinx/yadeSphinx.py'
--- doc/sphinx/yadeSphinx.py	2014-10-02 08:56:07 +0000
+++ doc/sphinx/yadeSphinx.py	2014-10-15 07:02:01 +0000
@@ -214,8 +214,12 @@
 
 for writer in ['html','latex','epub']:
 	genWrapperRst()
-        commLine = "sphinx-build -a -E -b %s -d %s . %s"%(writer,outDir+'/doctrees', (outDir+'/%s'%writer))
-        os.system(commLine)
+	# HACK: must rewrite sys.argv, since reference generator in conf.py determines if we output latex/html by inspecting it
+	sys.argv=['sphinx-build','-a','-E','-b','%s'%writer,'-d',outDir+'/doctrees','.',outDir+'/%s'%writer]
+	try:
+		sphinx.main(sys.argv)
+	except SystemExit:
+		pass
 	if writer=='html':
 		makeBaseClassesClickable((outDir+'/html/yade.wrapper.html'),writer)
 	elif writer=='latex':