{ "info": { "author": "Dalton Barreto", "author_email": "daltonmatos@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "Plug n' Play\n************\n\nPlug n' PLay (PnP) is a Generic plug-in system inspired by Trac's (http://trac.edgewall.org)\ninternal component management. With PnP you can turn any program into a pluggable software very easily. \n\nYou just have to define the Interfaces and let others implement them. When your code is running \nyou can dynamically retrieve who are the classes that implement a certain Interface, and call \nthe specific methods.\n\nA simple example\n****************\n\nThink this way: You have e very simple program that just copy files around.\n\nSay you want to check if the copy was OK by calculating the MD5 hash of the \ntwo files (the original and the copy). You can do this implementing the MD5 check \ninside your main code, that's OK too, but when you need to add another check \n(e.g. calculate the SHA-1 of the files) you will have to modify your code so \nit can call two methods, the MD5 checker and the SHA-1 checker.\n\nWith PnP you write only the main piece of the program, the part that does only the copying, \nand the hash checkers you can implement whenever you want, *without* any modification \nto the main code.\n \nPnP is roughly a implementation of the Observer pattern (http://en.wikipedia.org/wiki/Observer_pattern). \n \nThe code for this example\n*************************\n\nOk, too much talk, now some code. A pseudo-code to the example above would be:\n\n:: \n \n class CopyListener(Interface): \n def copy_finished(self, original_file, new_file):\n pass\n\n\n\nThe main code would be:\n\n::\n\n PnP.load_plugins(\"/some/path/with/python/files\") # egg files in the future?.\n copy_file(file1, file2)\n\n # Would return all python classes that \n # implement CopyListerner interface\n copy_listeners = CopyListener.implementors()\n\n # Call each of the listeners telling the copy finished\n for listener in copy_listeners:\n listener.copy_finished(file1, file2)\n\n\nAnd an example of one such observer would be:\n\n::\n\n from myproject.interfaces import CopyListener\n\n class MD5Check(Plugin):\n implements = [CopyListener,]\n\n def copy_finished(self, file1, file2):\n md5_1 = hash.md5(file1.read()).hexdigest()\n md5_2 = hash.md5(file2.read()).hexdigest()\n if md5_1 is not md5_2:\n # Do something very useful! =)\n\n\nConclusion\n**********\n\nDid you like this project? Very nice, so help me write it! Fork the repo and \nsend me some pull requests! Or talk to me directly if you have some great ideas to implement!\n\n\nThanks,\n\nDalton Barreto", "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/daltonmatos/plugnplay", "keywords": null, "license": "BSD-3", "maintainer": null, "maintainer_email": null, "name": "plugnplay", "package_url": "https://pypi.org/project/plugnplay/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/plugnplay/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/daltonmatos/plugnplay" }, "release_url": "https://pypi.org/project/plugnplay/0.5.3/", "requires_dist": null, "requires_python": null, "summary": "A Generic plug-in system for python", "version": "0.5.3" }, "last_serial": 2250304, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "80341a6ade1f7ccaa2206c4a9ed8ba85", "sha256": "1261f48a24a721ca6ad50689b70668b9ef38db47311ff65035cccbb16848771b" }, "downloads": -1, "filename": "plugnplay-0.1-py2.6.egg", "has_sig": false, "md5_digest": "80341a6ade1f7ccaa2206c4a9ed8ba85", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 10247, "upload_time": "2010-11-12T22:39:20", "url": "https://files.pythonhosted.org/packages/51/b1/d2cca31b419fd23028513aa9abd65636792638d127dfa4e04483e4e6d422/plugnplay-0.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "d8f69bd4c5b2ebff6a322bc63c9bf9d0", "sha256": "40d0ab055cafb7fec959b348e34bb4322efd6110d3d3953a07b7b376cc13d97f" }, "downloads": -1, "filename": "plugnplay-0.1.tar.gz", "has_sig": false, "md5_digest": "d8f69bd4c5b2ebff6a322bc63c9bf9d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4030, "upload_time": "2010-11-12T22:39:18", "url": "https://files.pythonhosted.org/packages/2f/de/c8c2cb9b5a540898f10f2934dbc1f6e1902d392e761f8f06377fa22ccd03/plugnplay-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bbe9c5c59aefccc14678e0c65e2be310", "sha256": "076082c443f4fb0eac044f305275a69d01978160270e86c65044b9fd4404fa5e" }, "downloads": -1, "filename": "plugnplay-0.2-py2.7.egg", "has_sig": false, "md5_digest": "bbe9c5c59aefccc14678e0c65e2be310", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 4939, "upload_time": "2011-07-23T03:34:44", "url": "https://files.pythonhosted.org/packages/4e/cb/acefcbbb7c78adecdc40f3b7b2a35c39d04ca3a0a88cf42f979c41b8ebe4/plugnplay-0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "7050aa319274bc6a12234af18ee57f90", "sha256": "d3eacfc46779739f619be3d972fdb6285bcebc96e18b4dbfd427140c07093bb2" }, "downloads": -1, "filename": "plugnplay-0.2-py3.1.egg", "has_sig": false, "md5_digest": "7050aa319274bc6a12234af18ee57f90", "packagetype": "bdist_egg", "python_version": "3.1", "requires_python": null, "size": 5034, "upload_time": "2011-07-23T03:34:39", "url": "https://files.pythonhosted.org/packages/c8/2d/503f88bdf6bad02889a3b549a0f8990dadcd7506eb1a743ca90b6594db8b/plugnplay-0.2-py3.1.egg" }, { "comment_text": "", "digests": { "md5": "ada6c9dd2791bd55498cdd39ab850275", "sha256": "aed688154f316c02114bf59614342270c2369072dd0aad592fd5c23f23909ef2" }, "downloads": -1, "filename": "plugnplay-0.2.tar.gz", "has_sig": false, "md5_digest": "ada6c9dd2791bd55498cdd39ab850275", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3160, "upload_time": "2011-07-23T03:33:31", "url": "https://files.pythonhosted.org/packages/7b/2e/f051d47d6154cbbb982969cbbdc464a867741fe0294b483ec64b041a970a/plugnplay-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "bb074e3f6866b49f118b1aa9649f3ea7", "sha256": "e9a56dc42f9a19d7d76f344ebb48376a217db830c606c0720e6770ed8286e2da" }, "downloads": -1, "filename": "plugnplay-0.3.tar.gz", "has_sig": false, "md5_digest": "bb074e3f6866b49f118b1aa9649f3ea7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3288, "upload_time": "2012-03-02T19:21:54", "url": "https://files.pythonhosted.org/packages/e4/92/288012706cf7b991b1462e659ac2dd8ca65591518386f27e1b893253fb41/plugnplay-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "7a7ce5b8f25ee85aa1cc009423711bd7", "sha256": "3873a6dcecb1c4feed2a34a9be556e4c6c7b90a84330f0b0c614324c25682d02" }, "downloads": -1, "filename": "plugnplay-0.4.tar.gz", "has_sig": false, "md5_digest": "7a7ce5b8f25ee85aa1cc009423711bd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3387, "upload_time": "2012-05-17T04:16:24", "url": "https://files.pythonhosted.org/packages/a2/3a/efea29cd2543a1c0adb703a7333f4bddea4a8fe2748240a3765eeeec6038/plugnplay-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "8948f825dc1cdbd9c91a7f4186d0779d", "sha256": "62c1e60670d2cf215ae3f8e273e6d25a618c39dd93346cc6d75e0ca5a3645dee" }, "downloads": -1, "filename": "plugnplay-0.4.1.tar.gz", "has_sig": false, "md5_digest": "8948f825dc1cdbd9c91a7f4186d0779d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3905, "upload_time": "2012-05-28T01:02:53", "url": "https://files.pythonhosted.org/packages/7b/bc/5bfb39ddfe45779b1916d36d2126f87b679677a6ab6c1850d823b3f45fb7/plugnplay-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "990c3b6e005ac3cbda3927fc0bccb3c6", "sha256": "2fb138dd292b2bcb84b6661e85788684a6b222bbe3e484604090f964b6562566" }, "downloads": -1, "filename": "plugnplay-0.4.2.tar.gz", "has_sig": false, "md5_digest": "990c3b6e005ac3cbda3927fc0bccb3c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4217, "upload_time": "2012-06-02T02:51:07", "url": "https://files.pythonhosted.org/packages/d5/94/9d75324223b3877fdcbb00a2abbe3dcc907c4bfa8602da35c4eb89c0ccb1/plugnplay-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "88bc4b148e2daaf1e7c6adfd6aa650ba", "sha256": "105ed16f6bd6435befc65d2d9857b1c031f560dab5c361d545d8633aa027433c" }, "downloads": -1, "filename": "plugnplay-0.5.0.tar.gz", "has_sig": false, "md5_digest": "88bc4b148e2daaf1e7c6adfd6aa650ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5556, "upload_time": "2012-07-01T21:41:51", "url": "https://files.pythonhosted.org/packages/ed/b7/41d21ce26e58c8985943ee9f3ea8ddc0d4e1a54d4fdeea202103056df1c1/plugnplay-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "d7aebad58acf6f0604bdd7d464c348e2", "sha256": "6b2619d22e437c6158387938713760e4c51c15b37d255b93911acc1b9a704947" }, "downloads": -1, "filename": "plugnplay-0.5.1.tar.gz", "has_sig": false, "md5_digest": "d7aebad58acf6f0604bdd7d464c348e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5740, "upload_time": "2012-07-24T02:35:52", "url": "https://files.pythonhosted.org/packages/56/e4/aa03319264b8e241d611d4769e565a24655e05f935f373cd18e48c5fef9c/plugnplay-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "7b61e44de34b57dff636904e880f8195", "sha256": "4a03fd4ab2b9a3b5731fb066246ad3ec750e4b4677b7610f65c6f836aa8f8e0b" }, "downloads": -1, "filename": "plugnplay-0.5.2.tar.gz", "has_sig": false, "md5_digest": "7b61e44de34b57dff636904e880f8195", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5943, "upload_time": "2012-11-06T23:33:47", "url": "https://files.pythonhosted.org/packages/ff/c0/f74cf044722bd58a3ed42aa199bf0f51e983f024d6b318fe1804b85e1c0e/plugnplay-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "7ec582872008711bc0715456b632dce5", "sha256": "ca524c49c25165113a4b3bee586ee9be88fc057d0db0f02ae5d4f82dcda0ed95" }, "downloads": -1, "filename": "plugnplay-0.5.3.tar.gz", "has_sig": false, "md5_digest": "7ec582872008711bc0715456b632dce5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4437, "upload_time": "2016-07-29T00:09:12", "url": "https://files.pythonhosted.org/packages/0b/9a/a66ae16277f30bc1d1c8290db12d97f1182f3ffd5979c27248c80fba95e4/plugnplay-0.5.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ec582872008711bc0715456b632dce5", "sha256": "ca524c49c25165113a4b3bee586ee9be88fc057d0db0f02ae5d4f82dcda0ed95" }, "downloads": -1, "filename": "plugnplay-0.5.3.tar.gz", "has_sig": false, "md5_digest": "7ec582872008711bc0715456b632dce5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4437, "upload_time": "2016-07-29T00:09:12", "url": "https://files.pythonhosted.org/packages/0b/9a/a66ae16277f30bc1d1c8290db12d97f1182f3ffd5979c27248c80fba95e4/plugnplay-0.5.3.tar.gz" } ] }