编译和安装软件或python包以及生成由makina corpus赞助的脚本或配置文件的方法。

minitage.recipe.wsgi的Python项目详细描述


Introduction

鸡蛋有那些入口点:

  • wsgi: Make a Python paste configuration file eatable by mod_wsgi with all the eggs dependencies you need.

您可以在Minitage的以下资源中浏览代码:

minitage.recipe.wsgi

Abstract

  • This recipe is inspired by collective.recipe.modwsgi but use minitage code to generate a wrapper to launch a paste configuration file, suitable for mod_mwsgi.
  • This recipe inherit from minitage;recipe:egg.
  • I recommend Spawning to be the WSGI server, but in the wonderful world of system administration, you don’t have always the choice of the final technology to use. This will help to to use mod_wsgi with buildout based installations.

Specific options

  • All the shared options and the options from minitage.recipe:egg +
  • config-file
    full path to the paste configuration file to use

Detailled documentation

让我们创建一个构建配置文件:

>>> rmdir(tempdir)
>>> mkdir(tempdir)
>>> cd(tempdir)
>>> a = [mkdir(d) for d in ('eggs', 'develop-eggs', 'bin', 'src')]
>>> install_develop_eggs(['minitage.recipe.wsgi'])
>>> install_eggs_from_pathes(['zc.buildout'], sys.path)
>>> touch('buildout.cfg')
>>> sh('buildout -o bootstrap')
buildout -o bootstrap...
>>> index_url = start_server(os.path.sep.join(tempdir))

Initializing test env.

>>> if os.path.exists('foo'): rmdir(foo)
>>> mkdir('foo')
>>> mkdir('foo/src/toto')
>>> touch('foo/setup.py', data="""
... from setuptools import setup, find_packages
... setup(name='foo', version='1.0',
...     packages=find_packages('src'),
...     package_dir = {'': 'src'},
...     include_package_data=True,
...     scripts=['src/toto/toto.py'],
...     entry_points={'console_scripts': ['s=toto.toto:f']},
...     )
... """)
>>> touch('foo/src/toto/__init__.py')
>>> touch('toto.cfg')
>>> touch('foo/src/toto/toto.py', data="""
... def f():
...     print "foo"
... if __name__ == '__main__' :
...     print 'called'
...
... """)
>>> noecho = [os.remove(d) for d in os.listdir('.') if '.tar.gz' in d]
>>> os.chdir('foo')
>>> sh('python setup.py sdist')
p...
>>> noecho = [shutil.copy(os.path.join('dist', d), os.path.join('..', d)) for d in os.listdir('dist')]
>>> os.chdir('..')

Generating a mod_mwsgi friendly configuration

不要指定文件选项。

>>> data = """
... [buildout]
... download-cache=${buildout:directory}
... parts = part
... [part]
... recipe=minitage.recipe.wsgi
... config-file = toto.cfg
... find-links=%(index)s
... eggs=foo
... """%{'index': index_url}
>>> touch('buildout.cfg', data=data)
>>> sh('bin/buildout -vvvvv install')
b...
minitage.recipe: Generated script: '/tmp/buildout.test/parts/part/wsgi'...
>>> cat('parts', 'part', 'wsgi')
#!...
#!!! #GENERATED VIA MINITAGE.recipe !!!...
import sys
sys.path[0:0] = [ '/tmp/buildout.test/eggs/foo-1.0-py....egg', ]...
from paste.deploy import loadapp
application = loadapp("config:toto.cfg")...

CHANGELOG

1.37 -

  • fix dependencies (#1)

1.35

  • splitted out from minitage.recipe

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ApachePOI如何通过java从excel文件中删除空白列?   linux到后台Java服务应用程序的简单发送/接收接口   java ActionBarPullToRefresh什么都没发生   java从millis获取错误的整数天   java相同的代码在两个不同的包上表现不同   java将每个新的char元素写入一个文件(如果被覆盖)   mysql如何在Java中通过外键链接的多个表中插入数据   java环境下mysql网络文件访问   java当使用构建器模式时,为什么我不应该重用builderobject来访问对象配置?   java jQueryServlet post异常失败   java应该使用什么逻辑来创建像《愤怒的小鸟》中那样的锁屏   java Android:在不滑动的情况下更改ViewPager中的片段   java在使用我的程序逻辑时获得空输出