我使用狮身人面像( Sphinx )来自动记录一个烧瓶api。一切看起来都很顺利,但我有一个很奇怪的问题。这个问题可以绕过,但旁路并不理想。
当我运行make html时,Sphinx会通过
(env)vagrant@dweloDevEnv:~/make html
sphinx-build -E -a -b html -d _build/doctrees . _build/html
Running Sphinx v1.3.1
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 1 added, 0 changed, 0 removed
* Running on http://127.0.0.1:9001/
* Restarting with reloader
Running Sphinx v1.3.1
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index 在上线处,狮身人面像被吊死。我已经留了整整一分钟了,但不会再继续了。如果我用cntrl + c来终止这个进程,这个过程实际上似乎成功地完成了:
reading sources... [100%] index
^C
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents...
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
doneing output... [100%] index
writing output... [100%] index
generating indices... genindex
generating indices... genindex http-routingtable http-routingtable
writing additional pages... search
writing additional pages... search
copying static files...
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
copying extra files... done
dumping search index in English (code: en) ... done
build succeeded.
done
dumping object inventory... done
build succeeded.如果我去检查输出目录,我确实找到了api的文档。太棒了!不幸的是,这种方法使我无法将进程嵌入到shell脚本中(因为我必须杀死进程才能传递挂起)。我的rst文件很简单。我把它包括在下面:
my_app.rst
Contents:
.. toctree::
:maxdepth: 2
.. autoflask:: my_api.run:api.app
:undoc-static:
:blueprints: v1_api
:include-empty-docstring:我已经花了很长一段时间了,似乎找不出到底出了什么问题。缺少任何有用的错误消息并不能使它变得更容易。过去有没有人遇到过这种情况?
发布于 2015-04-29 23:19:01
问题是我实际上是在my_app.py文件中执行api (my_app.py)。所以,当应用程序对象可用并最终被解释的时候,我挂掉了,因为api是在线的。
https://stackoverflow.com/questions/29954968
复制相似问题