{ "info": { "author": "Lele Gaifax", "author_email": "lele@metapensiero.it", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. -*- coding: utf-8 -*-\n.. :Progetto: metapensiero.recipe.script\n.. :Creato: ven 07 mar 2014 18:13:50 CET\n.. :Autore: Lele Gaifax \n.. :Licenza: GNU General Public License version 3 or later\n..\n\nBuildout helper recipes\n=======================\n\nThis module implements two simple recipes to execute either a `shell` script (actually `batch`\nscripts under M$-Windows) or a Python script.\n\nBoth recipes take two options, ``install`` and ``update``: both are considered as a list of\nstatements, one per line, that will be written in a temporary file that will be executed\nrespectively when the recipe is installed or updated. One or the other may be missing, and in\nsuch case nothing will happen for that particular step.\n\nWhen the commands to execute depend on the platform, they can be specified using the options\n``install-linux`` or ``install-win32`` that have higher priority than the generic form.\n\nShell scripts\n-------------\n\nThe ``metapensiero.recipe.script:shell`` recipe is implemented by the ``ShellScript`` class,\nand can be used in the following way::\n\n [config]\n recipe = metapensiero.recipe.script:shell\n ini = config.ini\n install = ${buildout:bin-directory}/soladmin create-config ${:ini}\n\nAs said, some time the commands to execute depend on the particular platform they are run. In\nsuch cases, you can say::\n\n [config]\n recipe = metapensiero.recipe.script:shell\n ini = config.ini\n install = ${buildout:bin-directory}/soladmin create-config ${:ini}\n install-win32 =\n ${buildout:bin-directory}/soladmin create-config ${:ini}\n echo Configuration created!\n pause\n\nPython scripts\n--------------\n\nThe ``metapensiero.recipe.script:python`` recipe is implemented by the ``PythonScript``\nclass. It is somewhat more powerful because it can easily access the whole buildout\nconfiguration.\n\nConsider the following example::\n\n [start_script]\n recipe = metapensiero.recipe.script:python\n install =\n >>> import sys\n >>> from os.path import join\n >>> basedir = buildout['buildout']['directory']\n >>> bindir = buildout['buildout']['bin-directory']\n >>> script = join(basedir, 'sol.bat' if sys.platform=='win32' else 'sol.sh')\n >>> config = join(basedir, buildout['config']['ini'])\n >>> with open(script, 'w') as f:\n >>> if sys.platform == 'win32':\n >>> f.write('@echo off\\n')\n >>> f.write('%s %s\\n' % (join(bindir, 'solserver'), config))\n >>> installed = script\n\nAs you can see, the script can access other section settings thru the ``buildout`` local\nvariable, a dictionary that contains the whole buildout configuration. Another local variable\nis ``options``, another dictionary containing the recipe settings.\n\nThe script may set the ``installed`` variable, that can be either a simple scalar string value\nor a sequence of strings: it will be used as the result of the recipe, which usually is the\nlist of the files/directories installed by the recipe itself that will be deleted whenever the\nrecipe is removed from the configuration.\n\nUsing eggs\n~~~~~~~~~~\n\nIf the Python script uses additional eggs, they can be specified with the ``eggs`` option, like\nin the following example::\n\n [extjs]\n recipe = metapensiero.recipe.script:python\n eggs = metapensiero.extjs.desktop\n install =\n >>> from metapensiero.extjs.desktop.scripts.extjs_dl import download_and_extract, URL\n >>> download_and_extract(URL)\n\n\nChanges\n-------\n\n1.2 (2014-03-08)\n~~~~~~~~~~~~~~~~\n\n* Simple test suite\n\n* Fix return of installed stuff in Python scripts\n\n\n1.1 (2014-03-08)\n~~~~~~~~~~~~~~~~\n\n* First release on PyPI\n\n\n1.0 (2014-03-08)\n~~~~~~~~~~~~~~~~\n\n* Initial version, extracted from SoLista", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/lele/metapensiero.recipe.script", "keywords": null, "license": "GPLv3+", "maintainer": null, "maintainer_email": null, "name": "metapensiero.recipe.script", "package_url": "https://pypi.org/project/metapensiero.recipe.script/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/metapensiero.recipe.script/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/lele/metapensiero.recipe.script" }, "release_url": "https://pypi.org/project/metapensiero.recipe.script/1.2/", "requires_dist": null, "requires_python": null, "summary": "Buildout recipes to execute Python or Shell scripts", "version": "1.2" }, "last_serial": 1023233, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5006bb85030cfed791bcf4fa8c50b82a", "sha256": "3d24c273cf58ac985104fa8cc07ca275ff20787d0a9a884198bf166f8be39608" }, "downloads": -1, "filename": "metapensiero.recipe.script-1.0.tar.gz", "has_sig": false, "md5_digest": "5006bb85030cfed791bcf4fa8c50b82a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5250, "upload_time": "2014-03-08T08:42:22", "url": "https://files.pythonhosted.org/packages/68/33/489964484c6e604275a27ad801c4cfebc9da7128b3e38d54c89133d9ead2/metapensiero.recipe.script-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "c8c5a221e3e6a07f40d67265fe67eaef", "sha256": "4a49148bbe2dd6394d1b36e9645386741f3a05b66516007fdc5831cf15410c12" }, "downloads": -1, "filename": "metapensiero.recipe.script-1.1.tar.gz", "has_sig": false, "md5_digest": "c8c5a221e3e6a07f40d67265fe67eaef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5292, "upload_time": "2014-03-08T08:46:53", "url": "https://files.pythonhosted.org/packages/b5/ae/d6558b041d34de50a1f3bdaf251946f6e96e06c3e3dcda37ced8ee39ca92/metapensiero.recipe.script-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a124b9c4f706cef3c5b34d15d9654078", "sha256": "811ca69f62561d9cecb6597de169766225593bf1337cff390f95f1b966f876d8" }, "downloads": -1, "filename": "metapensiero.recipe.script-1.2.tar.gz", "has_sig": false, "md5_digest": "a124b9c4f706cef3c5b34d15d9654078", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6591, "upload_time": "2014-03-08T13:33:06", "url": "https://files.pythonhosted.org/packages/ed/e2/da1a638e6b0ec28083f09d645f71cd8390552798830028b809af382da193/metapensiero.recipe.script-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a124b9c4f706cef3c5b34d15d9654078", "sha256": "811ca69f62561d9cecb6597de169766225593bf1337cff390f95f1b966f876d8" }, "downloads": -1, "filename": "metapensiero.recipe.script-1.2.tar.gz", "has_sig": false, "md5_digest": "a124b9c4f706cef3c5b34d15d9654078", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6591, "upload_time": "2014-03-08T13:33:06", "url": "https://files.pythonhosted.org/packages/ed/e2/da1a638e6b0ec28083f09d645f71cd8390552798830028b809af382da193/metapensiero.recipe.script-1.2.tar.gz" } ] }