{ "info": { "author": "Kyle Marek-Spartz", "author_email": "kyle.marek.spartz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "interface-mixins\n================\n\nTo create an Interface, pass it an interface name and a list of method\nnames. A class will be created which raises NotImplementedError for each\nof the specified method names:\n\n.. code:: python\n\n AnInterface = Interface('AnInterface', [\n 'some',\n 'methods',\n 'the',\n 'interface',\n 'should',\n 'have'\n ])\n\nTo use this interface, simply inherit from it:\n\n.. code:: python\n\n class AClass(AnInterface):\n pass\n\nWe also provide a way to create abstract test cases to help test objects\nagainst the interface:\n\n.. code:: python\n\n AbstractTestAnInterface = AbstractInterfaceTest('AbstractTestAnInterface', [\n 'some',\n 'methods',\n 'the',\n 'interface',\n 'should',\n 'have'\n ])\n\nThese tests can be used by creating TestCases which inherit from from\nthe abstract test. This makes sure each method is implemented in AClass:\n\n.. code:: python\n\n from unittest import TestCase\n\n class TestAClass(AbstractTestAnInterface, TestCase):\n def setUp(self):\n self.obj = AClass()\n\nIt is also possible to create both the Interface and the\nAbstractInterfaceTest at the same time. Also, you can create multiple\ninterfaces using the following idiom [1]_:\n\n.. code:: python\n\n interfaces = {\n 'AnInterface': [\n 'some',\n 'methods',\n 'the',\n 'interface',\n 'should',\n 'have'\n ],\n 'AnotherInterface': [\n 'different',\n 'methods'\n ]\n }\n\n for interface_name, methods in interfaces.iteritems():\n interface_name += 'Interface'\n globals()[interface_name] = Interface(interface_name, methods)\n test_name = 'AbstractTest' + interface_name\n globals()[test_name] = AbstractInterfaceTest(test_name, methods)\n\n.. [1]\n This isn't very idiomatic Python. The use ``globals`` is ugly. This\n is just an idiom for using this library. I'm not sure I like it.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/zeckalpha/interface-mixins", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "interface-mixins", "package_url": "https://pypi.org/project/interface-mixins/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/interface-mixins/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://www.github.com/zeckalpha/interface-mixins" }, "release_url": "https://pypi.org/project/interface-mixins/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Interfaces for Python", "version": "0.0.3" }, "last_serial": 1101189, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8b8d51cf8df90bd49c947660e1fa0a98", "sha256": "1f463302999b1db22db3bdbc25173df51873845ffc55453428bc84a1177730f0" }, "downloads": -1, "filename": "interface-mixins-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8b8d51cf8df90bd49c947660e1fa0a98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2219, "upload_time": "2014-02-02T00:31:10", "url": "https://files.pythonhosted.org/packages/3d/41/7fb3322f691b34259f93d2ef5c21932e39204d17fb0624ef18e3744dcf73/interface-mixins-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "afdc5d933c34cc40facffc87200bbf54", "sha256": "f8f0382d779a9a3f7baa0b725a6b979a840d35cf7cfc9d9a81c5a2eb1d64c935" }, "downloads": -1, "filename": "interface-mixins-0.0.2.tar.gz", "has_sig": false, "md5_digest": "afdc5d933c34cc40facffc87200bbf54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2345, "upload_time": "2014-02-04T19:15:54", "url": "https://files.pythonhosted.org/packages/b9/e6/182072110e56dc09790ab05ada3bb3d479d8a6d3b984620a654b1698ee64/interface-mixins-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "427b456755902e3b34b024677f9e8ed6", "sha256": "98356a0a7323cf5064c0cc3f024f6cd6f85ae7739db6d6d4ce988db1a94a761f" }, "downloads": -1, "filename": "interface-mixins-0.0.3.tar.gz", "has_sig": false, "md5_digest": "427b456755902e3b34b024677f9e8ed6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2373, "upload_time": "2014-05-22T16:17:00", "url": "https://files.pythonhosted.org/packages/53/ab/86443e65081ea3a0d661a643688aa9ba65d2e5c37c84bf0722f3ae484b26/interface-mixins-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "427b456755902e3b34b024677f9e8ed6", "sha256": "98356a0a7323cf5064c0cc3f024f6cd6f85ae7739db6d6d4ce988db1a94a761f" }, "downloads": -1, "filename": "interface-mixins-0.0.3.tar.gz", "has_sig": false, "md5_digest": "427b456755902e3b34b024677f9e8ed6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2373, "upload_time": "2014-05-22T16:17:00", "url": "https://files.pythonhosted.org/packages/53/ab/86443e65081ea3a0d661a643688aa9ba65d2e5c37c84bf0722f3ae484b26/interface-mixins-0.0.3.tar.gz" } ] }