{ "info": { "author": "Shane Breatnach", "author_email": "shane.breatnach@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "## fabpowertasks\n\nOffers an alternative to the standard way of generating Fabric tasks. Instead\nof random functions or Task declarations, instead create Commands classes that\nuse a simple configuration flow and allow for dependency injection to share\nfunctionality between Tasks.\n\nAdditionally, some simple tasks are auto-generated and act as examples of how\nto write Commands.\n\n### Examples\n\nHere's a simple fabfile.py:\n\n import fabpowertasks\n project_dir = os.path.dirname(__file__)\n fabpowertasks.initialize(globals(), project_dir)\n\nThis automatically generates the Fabric tasks that come with fabpowertasks. They\ncan be run as standard using Fabric with ```fab ```\n\nBut that's not all - here's a more complex example ```fabfile/__init__.py```\nthat includes custom tasks:\n\n import os\n import fabpowertasks\n from fabfile.config import ProjectPaths\n from fabfile.tasks import CustomCommands\n\n fabfile_dir = os.path.dirname(__file__)\n project_dir = os.path.dirname(fabfile_dir)\n properties = fabpowertasks.Properties.load_from_file(\n os.path.join(fabfile_dir, 'project.json')\n )\n properties.base_dir = project_dir\n local_project_paths = ProjectPaths(project_dir, properties)\n injection_objs = {\n 'local_project_paths': local_project_paths,\n 'remote_project_paths': fabpowertasks.SystemPaths(properties.remote_base_dir,\n properties),\n 'custom_commands': CustomCommands()\n }\n fabpowertasks.initialize(globals(), os.path.dirname(fabfile_dir),\n project_properties=properties,\n project_inject_objs=injection_objs)\n\nSome explanation of this example is needed:\n\n* ```CustomCommands``` is a class that extends the utility class\n```fabpowertasks.commands.BaseCommands```. This class comes with some additional\nfunctions that are used to generate Fabric tasks from itself.\n* An instance of the ```Properties``` class is used extensively throughout the\nlibrary and contains all project properties. At the very least, it requires\na project directory location, which is why this is a required option to\n```initialize()```. But the default instance may be overridden, as shown here.\n* fabpowertasks inspects the variables for each Commands instance and attempts\nto inject any matching values as described in ```injection_objs```. Any variables\nthat don't start with _ and are None as treated as potential injection points.\nBy default, an attempt to inject ```local_project_paths``` into every Commands instance\nis made but more injections can be added using the **project_injection_objs** argument.\n\n### Commands\n\nThe concept of Commands is simple - they are an advanced form of a Fabric Task.\nInstead of being limited to the run() function, multiple functions of the\nCommand instance can be treated as Tasks.\n\n#### Implementation\n\n* Extend fabpowertasks.commands.BaseCommands\n* Write the functions for your resulting Task\n* ```__init__()```: Update self._task_functions with the functions\n* ```__init__()```: Optionally, set instance variables for injection\n* Import your new class into ```fabfile/__init__.py``` and pass into the\nproject_injection_objs dict where the resulting Tasks are auto-generated\n\nNote that arguments to the function mirror what a standard Fabric task expects.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/sbreatnach/fabpowertasks", "keywords": "fabric tool", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "fabpowertasks", "package_url": "https://pypi.org/project/fabpowertasks/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fabpowertasks/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/sbreatnach/fabpowertasks" }, "release_url": "https://pypi.org/project/fabpowertasks/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.0.1" }, "last_serial": 1052517, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1fb6afd275619d9873aece0f01ab9c1f", "sha256": "58da81730a46a6bb43d7d4f0addf81d4af3663ff7f1f9473b0a9390fc0c271fe" }, "downloads": -1, "filename": "fabpowertasks-0.0.1.tar.gz", "has_sig": true, "md5_digest": "1fb6afd275619d9873aece0f01ab9c1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6693, "upload_time": "2014-04-06T09:48:23", "url": "https://files.pythonhosted.org/packages/0a/4f/788f9b6da5fde5101270245a78d12073826394622faccc63a08403f7ffb5/fabpowertasks-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1fb6afd275619d9873aece0f01ab9c1f", "sha256": "58da81730a46a6bb43d7d4f0addf81d4af3663ff7f1f9473b0a9390fc0c271fe" }, "downloads": -1, "filename": "fabpowertasks-0.0.1.tar.gz", "has_sig": true, "md5_digest": "1fb6afd275619d9873aece0f01ab9c1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6693, "upload_time": "2014-04-06T09:48:23", "url": "https://files.pythonhosted.org/packages/0a/4f/788f9b6da5fde5101270245a78d12073826394622faccc63a08403f7ffb5/fabpowertasks-0.0.1.tar.gz" } ] }