{
"info": {
"author": "Roger Ineichen and the Zope Community",
"author_email": "zope-dev@zope.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Zope3",
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP"
],
"description": "The ``z3c.recipe.dev:app`` generates start scripts and configuration files for\nstarting a egg based Zope 3 setup.\n\nThe ``z3c.recipe.dev:script`` generates a hook to a existing python module and\nallows to execute a python method including eggs in sys path.\n\n\nDetailed Documentation\n**********************\n\n=====================\nZ3 development recipe\n=====================\n\nz3c.recipe.dev app\n------------------\n\nThis Zope 3 recipes allows you to define Zope applications.\n\nThe 'app' recipe can be used to define a Zope application. It is designed to\nwork with with Zope solely from eggs. The app recipe causes a part to be\ncreated. The part will contain the application's `zope.conf`, `site.zcml`,\n`principals.zcml` and `securitypolicy.zcml`. This configuration files will get\nrecreated during each update. Another folder called logs will get created and\ncontains the `access.log` and `z3c.log` files. This log files doesn't get\nrecreated. The start script itself is located in the bin folder and uses the\nconfiguration files from the relevant parts folder.\n\n\nOptions\n~~~~~~~\n\nThe 'app' recipe accepts the following options:\n\neggs\n The names of one or more eggs, with their dependencies that should\n be included in the Python path of the generated scripts.\n\nserver\n The ``zserver`` or ``twisted`` server otpion.\n\nzope.conf\n The contents of zope.conf.\n\nsite.zcml\n The contents of site.zcml.\n\nprincipals.zcml\n The contents of securitypolicy.zcml.\n\nsecuritypolicy.zcml\n The contents of securitypolicy.zcml.\n\nsite.zcml\n The contents of site.zcml.\n\n\nTest\n~~~~\n\nLets define some (bogus) eggs that we can use in our application:\n\n >>> mkdir('demo1')\n >>> write('demo1', 'setup.py',\n ... '''\n ... from setuptools import setup\n ... setup(name = 'demo1')\n ... ''')\n\n >>> mkdir('demo2')\n >>> write('demo2', 'setup.py',\n ... '''\n ... from setuptools import setup\n ... setup(name = 'demo2', install_requires='demo1')\n ... ''')\n\nWe'll create a `buildout.cfg` file that defines our application:\n\n >>> write('buildout.cfg',\n ... '''\n ... [buildout]\n ... develop = demo1 demo2\n ... parts = myapp var\n ... newest = false\n ...\n ... [myapp]\n ... recipe = z3c.recipe.dev:app\n ... eggs = demo2\n ... z3c.recipe.dev [test]\n ... server = zserver\n ... zope.conf = ${var:zconfig}\n ... \n ... #level DEBUG\n ... \n ... path STDOUT\n ... formatter zope.exceptions.log.Formatter\n ... \n ... \n ...\n ... devmode on\n ...\n ... site.zcml =\n ... \n ... \n ...\n ... principals.zcml =\n ... \n ...\n ... \n ...\n ... \n ...\n ... \n ...\n ... \n ...\n ... \n ...\n ... securitypolicy.zcml =\n ... \n ...\n ... \n ...\n ... \n ... \n ... \n ...\n ... \n ... \n ... \n ...\n ... \n ...\n ... [var]\n ... recipe = zc.recipe.filestorage\n ...\n ... ''' % globals())\n\nNow, Let's run the buildout and see what we get:\n\n >>> print system(join('bin', 'buildout')),\n Develop: '/sample-buildout/demo1'\n Develop: '/sample-buildout/demo2'\n Installing var.\n Installing myapp.\n Generated script '/sample-buildout/bin/myapp'.\n\nThe bin folder contains the start script:\n\n >>> ls('bin')\n - buildout-script.py\n - buildout.exe\n - myapp-script.py\n - myapp.exe\n\nThe myapp-scrip.py contains the start code for our zope setup:\n\n >>> cat('bin', 'myapp')\n #!\"C:\\Python24\\python.exe\"\n \n import sys\n sys.path[0:0] = [\n '/sample-buildout/demo2',\n '/z3c.recipe.dev/trunk/src',\n '/sample-buildout/eggs/zc.recipe.filestorage-1.0.1-py2.4.egg',\n '/sample-buildout/eggs/zope.testing-3.7.1-py2.4.egg',\n '/sample-buildout/eggs/zc.recipe.egg-1.1.0-py2.4.egg',\n '/sample-buildout/eggs/zc.buildout-1.1.1-py2.4.egg',\n '/sample-pyN.N.egg',\n '/sample-buildout/eggs/zconfig-2.6.1-py2.4.egg',\n '/sample-buildout/demo1',\n '/sample-buildout/eggs/zope.interface-3.5.0-py2.4-win32.egg',\n '/sample-pyN.N.egg',\n ]\n \n import os\n sys.argv[0] = os.path.abspath(sys.argv[0])\n \n \n import zope.app.server.main\n \n if __name__ == '__main__':\n zope.app.server.main.main([\n '-C', '/sample-buildout/parts/myapp/zope.conf',\n ]+sys.argv[1:])\n\nAnd the myapp folder contains the configure files:\n\n >>> ls('parts', 'myapp')\n - principals.zcml\n - securitypolicy.zcml\n - site.zcml\n - zope.conf\n\n\nz3c.recipe.dev script\n---------------------\n\nThe script recipe allows us to point to scripts which the recipe will install\na execute script hook for us. You can use this if you need to run a python\nscript which knows about some egg packages.\n\n\nOptions\n~~~~~~~\n\nThe 'script' recipe accepts the following options:\n\neggs\n The names of one or more eggs, with their dependencies that should\n be included in the Python path of the generated scripts.\n\nmodule\n The ``module`` which contains the ``method`` to be executed.\n\nmethod\n The ``method`` which get called from the ``module``.\n\narguments\n Use the option ``arguments`` to pass arguments to the script.\n All the string will be copied to the script 1:1.\n So what you enter here is what you get.\n\nenvironment\n The environement if needed by your script\n\n\nTest\n~~~~\n\nLets define a egg that we can use in our application:\n\n >>> mkdir('hello')\n >>> write('hello', 'setup.py',\n ... '''\n ... from setuptools import setup\n ... setup(name='hello')\n ... ''')\n\nAnd let's define a python module which we use for our test:\n\n >>> write('hello', 'helloworld.py',\n ... \"\"\"\n ... def helloWorld(*args):\n ... print 'Hello World'\n ... for a in args:\n ... print a\n ... \"\"\")\n\nAlos add a `__init__` to the `hello` package:\n\n >>> write('hello', '__init__.py', '#make package')\n\nWe'll create a `buildout.cfg` file that defines our script:\n\n >>> write('buildout.cfg',\n ... '''\n ... [buildout]\n ... develop = hello\n ... parts = helloworld\n ... newest = false\n ...\n ... [helloworld]\n ... recipe = z3c.recipe.dev:script\n ... eggs = hello\n ... module = helloworld\n ... method = helloWorld\n ...\n ... ''' % globals())\n\nLet's run buildout again:\n\n >>> print system(join('bin', 'buildout')),\n Develop: '/sample-buildout/hello'\n Uninstalling myapp.\n Uninstalling var.\n Installing helloworld.\n Generated script '/sample-buildout/bin/helloworld'.\n\nAnd check the script again. Now we see the `helloWorld()` method is used:\n\n >>> cat('bin', 'helloworld')\n #!C:\\Python24\\python.exe\n \n import sys\n sys.path[0:0] = [\n '/sample-buildout/hello',\n ]\n \n import os\n sys.argv[0] = os.path.abspath(sys.argv[0])\n \n \n import helloworld\n \n if __name__ == '__main__':\n helloworld.helloWorld()\n\nNow we can call the script:\n\n >>> print system(join('bin', 'helloworld')),\n Hello World\n\n\nTest with parameters\n--------------------\n\nOf the same script defined above.\n\nUse the option ``arguments = `` to pass arguments to the script.\nAll the string will be copied to the script ``1:1``.\nSo what you enter here is what you get.\n\nWe'll create a ``buildout.cfg`` file that defines our script:\n\n >>> write('buildout.cfg',\n ... '''\n ... [buildout]\n ... develop = hello\n ... parts = helloworld\n ... newest = false\n ...\n ... [helloworld]\n ... recipe = z3c.recipe.dev:script\n ... eggs = hello\n ... module = helloworld\n ... method = helloWorld\n ... arguments = 'foo', 'bar'\n ...\n ... ''' % globals())\n\nLet's run buildout again:\n\n >>> print system(join('bin', 'buildout')),\n Develop: '/sample-buildout/hello'\n Uninstalling helloworld.\n Installing helloworld.\n Generated script '/sample-buildout/bin/helloworld'.\n\nAnd check the script again. Now we see the `helloWorld()` method is used:\n\n >>> cat('bin', 'helloworld')\n #!C:\\Python24\\python.exe\n \n import sys\n sys.path[0:0] = [\n '/sample-buildout/hello',\n ]\n \n import os\n sys.argv[0] = os.path.abspath(sys.argv[0])\n \n \n import helloworld\n \n if __name__ == '__main__':\n helloworld.helloWorld('foo', 'bar')\n\nNow we can call the script:\n\n >>> print system(join('bin', 'helloworld')),\n Hello World\n foo\n bar\n\n\nCreating Directories\n--------------------\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = data-dir\n ... find-links = http://download.zope.org/distribution\n ... newest = false\n ...\n ... [data-dir]\n ... recipe = z3c.recipe.dev:mkdir\n ... path = mystuff\n ... \"\"\")\n >>> print system(buildout),\n Uninstalling helloworld.\n Installing data-dir.\n data-dir: Creating directory mystuff\n\n >>> ls(sample_buildout)\n - .installed.cfg\n d bin\n - buildout.cfg\n d demo1\n d demo2\n d develop-eggs\n d eggs\n d hello\n d mystuff\n d parts\n\nIf we change the directory name the old directory ('mystuff') is not deleted.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = data-dir\n ... find-links = http://download.zope.org/distribution\n ... newest = false\n ...\n ... [data-dir]\n ... recipe = z3c.recipe.dev:mkdir\n ... path = otherdir\n ... \"\"\")\n >>> print system(buildout),\n Uninstalling data-dir.\n Installing data-dir.\n data-dir: Creating directory otherdir\n\n >>> ls(sample_buildout)\n - .installed.cfg\n d bin\n - buildout.cfg\n d demo1\n d demo2\n d develop-eggs\n d eggs\n d hello\n d mystuff\n d otherdir\n d parts\n\nWe can also create a full path.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = data-dir\n ... find-links = http://download.zope.org/distribution\n ... newest = false\n ...\n ... [data-dir]\n ... recipe = z3c.recipe.dev:mkdir\n ... path = with/subdir\n ... \"\"\")\n >>> print system(buildout),\n data-dir: Cannot create /sample-buildout/with/subdir. /sample-buildout/with is not a directory.\n While:\n Installing.\n Getting section data-dir.\n Initializing part data-dir.\n Error: Invalid Path\n\nBut we need to activate this function explicitely.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = data-dir\n ... find-links = http://download.zope.org/distribution\n ... newest = false\n ...\n ... [data-dir]\n ... recipe = z3c.recipe.dev:mkdir\n ... createpath = True\n ... path = with/subdir\n ... \"\"\")\n >>> print system(buildout),\n Uninstalling data-dir.\n Installing data-dir.\n data-dir: Creating directory with/subdir\n\n >>> ls(sample_buildout)\n - .installed.cfg\n d bin\n - buildout.cfg\n d demo1\n d demo2\n d develop-eggs\n d eggs\n d hello\n d mystuff\n d otherdir\n d parts\n d with\n\n\nCreating Files\n--------------\n\nThe mkfile recipe creates a file with a given path, content and\npermissions.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = script\n ... newest = false\n ...\n ... [script]\n ... recipe = z3c.recipe.dev:mkfile\n ... path = file.sh\n ... content = hoschi\n ... mode = 0755\n ... \"\"\")\n >>> print system(buildout)\n Uninstalling data-dir.\n Installing script.\n script: Writing file /sample-buildout/file.sh\n \n\n >>> ls(sample_buildout)\n - .installed.cfg\n d bin\n - buildout.cfg\n d demo1\n d demo2\n d develop-eggs\n d eggs\n - file.sh\n d hello\n d mystuff\n d otherdir\n d parts\n d with\n\nThe content is written to the file.\n\n >>> cat(sample_buildout, 'file.sh')\n hoschi\n\nAnd the mode is set. Note set a mode is not supported on windows\n\n >>> import os, stat, sys\n >>> path = os.path.join(sample_buildout, 'file.sh')\n >>> if sys.platform[:3].lower() != \"win\":\n ... oct(stat.S_IMODE(os.stat(path)[stat.ST_MODE]))\n ... else:\n ... '0755'\n '0755'\n\nIf we change the filename the old file is deleted.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = script\n ... newest = false\n ...\n ... [script]\n ... recipe = z3c.recipe.dev:mkfile\n ... path = newfile.sh\n ... content = hoschi\n ... mode = 0755\n ... \"\"\")\n >>> print system(buildout)\n Uninstalling script.\n Installing script.\n script: Writing file /sample-buildout/newfile.sh\n \n\n >>> ls(sample_buildout)\n - .installed.cfg\n d bin\n - buildout.cfg\n d demo1\n d demo2\n d develop-eggs\n d eggs\n d hello\n d mystuff\n - newfile.sh\n d otherdir\n d parts\n d with\n\nWe can also specify to create the path for the file.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = script\n ... newest = false\n ...\n ... [script]\n ... recipe = z3c.recipe.dev:mkfile\n ... createpath = On\n ... path = subdir/for/file/file.sh\n ... content = hoschi\n ... mode = 0755\n ... \"\"\")\n >>> print system(buildout)\n Uninstalling script.\n Installing script.\n script: Creating directory /sample-buildout/subdir/for/file\n script: Writing file /sample-buildout/subdir/for/file/file.sh\n \n\n >>> ls(sample_buildout + '/subdir/for/file')\n - file.sh\n\n\n\n\n=======\nCHANGES\n=======\n\n0.6.0 (2010-08-19)\n------------------\n\n- Added support for environment.\n\n- Fixed tests to run with current package versions.\n\n- Fixed tests to run on \\*nix systems (not only win).\n\n\n0.5.4 (2009-02-22)\n------------------\n\n- Feature: implemented mkdir script\n\n- Feature: implemented mkfile script\n\n- fix tests\n\n\n0.5.3 (2008-04-07)\n------------------\n\n- Bug: ``script`` ``defaults`` had a bug that prevented it from use\n renamed it to ``arguments``, now it's working\n\n\n0.5.2 (unreleased)\n------------------\n\n- cleanup code, remove commented out code parts\n\n\n0.5.1 (2008-01-24)\n------------------\n\n- Bug: Correct and update meta-data.\n\n\n0.5.0 (2008-01-21)\n------------------\n\n- Initial Release",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://pypi.python.org/pypi/z3c.recipe.dev",
"keywords": "zope3 z3c dev recipe",
"license": "ZPL 2.1",
"maintainer": null,
"maintainer_email": null,
"name": "z3c.recipe.dev",
"package_url": "https://pypi.org/project/z3c.recipe.dev/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/z3c.recipe.dev/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://pypi.python.org/pypi/z3c.recipe.dev"
},
"release_url": "https://pypi.org/project/z3c.recipe.dev/0.6.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Zope3 development server setup recipes",
"version": "0.6.0"
},
"last_serial": 802074,
"releases": {
"0.5.0": [
{
"comment_text": "",
"digests": {
"md5": "e1b6fc9f10de140ed64b6ed8e6be00d4",
"sha256": "c6d409731cc9b3897258ba640e096050c4f8d12f454be3ac0249b94b8fb34cfb"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.5.0.zip",
"has_sig": false,
"md5_digest": "e1b6fc9f10de140ed64b6ed8e6be00d4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15266,
"upload_time": "2008-01-21T00:44:32",
"url": "https://files.pythonhosted.org/packages/aa/4f/b132f70740172049e246b5338e815432582dad19252cbb7bc31dad07d4e0/z3c.recipe.dev-0.5.0.zip"
}
],
"0.5.1": [
{
"comment_text": "",
"digests": {
"md5": "4e713a7d4ee147ab5f82ef23ca881104",
"sha256": "4319cf0438d31c41392ee5255e51a1617460e4d958ea1065ca62073283df14df"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "4e713a7d4ee147ab5f82ef23ca881104",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9049,
"upload_time": "2008-01-25T04:17:35",
"url": "https://files.pythonhosted.org/packages/c7/6f/ed3009b0539dbb7f5948382371446177437f1ae4868e7d9a7726b68202d5/z3c.recipe.dev-0.5.1.tar.gz"
}
],
"0.5.3": [
{
"comment_text": "",
"digests": {
"md5": "b33928f6b75e5d1195d1efff4a1d706d",
"sha256": "2073c1e386311abf77924b2c3735964b42b52a38eb041b9b6c8be4b361d66916"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.5.3.tar.gz",
"has_sig": false,
"md5_digest": "b33928f6b75e5d1195d1efff4a1d706d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9512,
"upload_time": "2008-04-07T15:02:49",
"url": "https://files.pythonhosted.org/packages/cd/b6/c4435d73d14400cafbef8cccb9a65d710b5d4bead3f261cb300833755237/z3c.recipe.dev-0.5.3.tar.gz"
}
],
"0.5.4": [
{
"comment_text": "",
"digests": {
"md5": "931e4d3a59dee089f433b50d925e1293",
"sha256": "fbe4ec7d25cbd3d79608deff60aaef96a9f948f97f1d5dc0aa26598db997e841"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.5.4.zip",
"has_sig": false,
"md5_digest": "931e4d3a59dee089f433b50d925e1293",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24055,
"upload_time": "2009-02-22T08:21:15",
"url": "https://files.pythonhosted.org/packages/8f/43/5249135d660518226dd003636643c5a83d5efb774178e3d2b59e36a68836/z3c.recipe.dev-0.5.4.zip"
}
],
"0.6.0": [
{
"comment_text": "",
"digests": {
"md5": "7038a32b982fa26073ab00b618d1b0fd",
"sha256": "d399a6540ac26628af4eac4f16ca606f319b550cd16a3ef586b5c3b33233463a"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "7038a32b982fa26073ab00b618d1b0fd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11999,
"upload_time": "2010-08-19T09:17:55",
"url": "https://files.pythonhosted.org/packages/f7/da/c96e27898fcbd401acffd559c4eb3bddcaa69cc44beb6a10eb077acffced/z3c.recipe.dev-0.6.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7038a32b982fa26073ab00b618d1b0fd",
"sha256": "d399a6540ac26628af4eac4f16ca606f319b550cd16a3ef586b5c3b33233463a"
},
"downloads": -1,
"filename": "z3c.recipe.dev-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "7038a32b982fa26073ab00b618d1b0fd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11999,
"upload_time": "2010-08-19T09:17:55",
"url": "https://files.pythonhosted.org/packages/f7/da/c96e27898fcbd401acffd559c4eb3bddcaa69cc44beb6a10eb077acffced/z3c.recipe.dev-0.6.0.tar.gz"
}
]
}