{ "info": { "author": "Emanuele Acri", "author_email": "crossbower@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers" ], "description": "This module provides a simple facility to the goal-oriented programming paradigm.\r\n\r\nIn goal-oriented programming, the programmer subdivides the problem in minor goals,\r\nwith dependencies between them, and just pass them to a scheduler that will\r\nexecute them asyncronously and in the correct order.\r\n\r\n ===\r\n\r\nIn this implementation every goal function receives three arguments:\r\nname -- the unique name of the goal\r\nargs -- the results from its dependencies\r\nresults -- a dictionary where it can write a return value\r\n (readable by subcessive goals)\r\n\r\nThe test cointained in the module file illustrates how the module must be used.\r\n\r\n ===\r\n\r\nAn example of usage:\r\n\r\n \"\"\"Usage example\"\"\"\r\n \r\n def goal1(name, args, results):\r\n print name, args\r\n sleep(1)\r\n results[name] = name + \" completed!\"\r\n\r\n def goal2(name, args, results):\r\n print name, args\r\n sleep(2)\r\n results[name] = name + \" completed!\"\r\n\r\n def goal3(name, args, results):\r\n print name, args\r\n sleep(2)\r\n results[name] = name + \" completed!\"\r\n\r\n def goal4(name, args, results):\r\n print name, args\r\n sleep(1)\r\n results[name] = name + \" completed!\"\r\n\r\n def goal5(name, args, results):\r\n print name, args\r\n sleep(3)\r\n results[name] = name + \" completed!\"\r\n\r\n def goal6(name, args, results):\r\n print name, args\r\n sleep(1)\r\n results[name] = name + \" completed!\"\r\n\r\n # goals to run and their dependencies\r\n schedule_goals( goal1 = { 'target': goal1 },\r\n goal2 = { 'target': goal2 },\r\n goal3 = { 'target': goal3, 'deps': ['goal1', 'goal2'] },\r\n goal4 = { 'target': goal4, 'deps': ['goal3'] },\r\n goal5 = { 'target': goal5, 'deps': ['goal2'] },\r\n goal6 = { 'target': goal6 } )\r\n \r\n ===\r\n\r\nOutput of the example:\r\n\r\n $ python goal_oriented.py\r\n\r\n goal6 {}\r\n goal2 {}\r\n goal1 {}\r\n goal5 {'goal2': 'goal2 completed!'}\r\n goal3 {'goal2': 'goal2 completed!', 'goal1': 'goal1 completed!'}\r\n goal4 {'goal3': 'goal3 completed!'}\r\n \r\n real\t0m5.018s\r\n user\t0m0.104s\r\n sys\t0m0.052s\r\n\r\n ===\r\n\r\nHave fun... :)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://securityadventures.wordpress.com/", "keywords": "goal oriented programming", "license": "This module is distributed under the BSD license, and it is reusable by everyone", "maintainer": "", "maintainer_email": "", "name": "goal_oriented", "package_url": "https://pypi.org/project/goal_oriented/", "platform": "Unix\r\nWindows\r\nCross-platform", "project_url": "https://pypi.org/project/goal_oriented/", "project_urls": { "Homepage": "http://securityadventures.wordpress.com/" }, "release_url": "https://pypi.org/project/goal_oriented/0.1/", "requires_dist": null, "requires_python": null, "summary": "This module provides a simple facility to the goal-oriented programming paradigm.", "version": "0.1" }, "last_serial": 792536, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b3e3953e10c40e3427b3363128dac8c4", "sha256": "0dbf815cebc788c4bc2a100918a83b3157865323f6846e31252524ec5e7c3ad5" }, "downloads": -1, "filename": "goal_oriented-0.1.tar.gz", "has_sig": false, "md5_digest": "b3e3953e10c40e3427b3363128dac8c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1985, "upload_time": "2013-01-03T17:00:46", "url": "https://files.pythonhosted.org/packages/8d/bf/0afcc65d9b236588a629132acb8da0ec5c19a295e341ecab92eef3f1d0f6/goal_oriented-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3e3953e10c40e3427b3363128dac8c4", "sha256": "0dbf815cebc788c4bc2a100918a83b3157865323f6846e31252524ec5e7c3ad5" }, "downloads": -1, "filename": "goal_oriented-0.1.tar.gz", "has_sig": false, "md5_digest": "b3e3953e10c40e3427b3363128dac8c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1985, "upload_time": "2013-01-03T17:00:46", "url": "https://files.pythonhosted.org/packages/8d/bf/0afcc65d9b236588a629132acb8da0ec5c19a295e341ecab92eef3f1d0f6/goal_oriented-0.1.tar.gz" } ] }