{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "```\n### Utility\nfrom pyramid import testing\nfrom pyramid_tiny_utility import ConfiguredObject, create_configured_instance_lookup\n\nclass Uploader(ConfiguredObject):\n def __init__(self, storepath):\n self.storepath = storepath\n\nget_uploder = create_configured_instance_lookup(Uploader)\n \nsettings = {\n \"demo.uploader.storepath\": \"/tmp/storepath\"\n}\n\nconfig = testing.setUp()\nconfig.include(\"pyramid_tiny_utility\")\nconfig.add_instance(Uploader(settings[\"demo.uploader.storepath\"]))\n\n## request\nclass request:\n registry = config.registry\nuploader = get_uploder(request)\nassert uploader.storepath == \"/tmp/storepath\"\n\ntesting.tearDown()\n```\n\n```\n### Valiadative Utility\n\n## request\n\nclass request:\n registry = config.registry\n\nmail_management = get_mailmanagemt(request)\n\nassert mail_management.sender == \"foo@bar.jp\"\nassert mail_management.default_title == \"default\"\n\ntesting.tearDown()\n```\n\n```\n### Adapter\nclass Model(object):\n def __init__(self,x,y,z):\n self.x = x\n self.y = y\n self.z = z\n\nclass Render:\n pass\n\nclass RowRender(object):\n def __init__(self, o):\n self.o = o\n\n def render(self):\n r = [\"\"]\n r.append(\"{0}\".format(self.o.x))\n r.append(\"{0}\".format(self.o.y))\n r.append(\"{0}\".format(self.o.z))\n r.append(\"\")\n return \"\".join(r)\n \nclass ListRender(object):\n def __init__(self, o):\n self.o = o\n\n def render(self):\n r = [\"\")\n return \"\".join(r)\n\n## configuration\n\nconfig = testing.setUp()\nconfig.include(\"pyramid_tiny_utility\")\nconfig.add_mapping(Model, Render, RowRender)\nconfig.add_mapping(Model, Render, RowRender, name=\"row\")\nconfig.add_mapping(Model, Render, ListRender, name=\"list\")\n\n\n## request\nclass request:\n registry = config.registry\n\nfrom pyramid_tiny_utility import get_mapping\n\nmodel = Model(10,20,30)\nprint get_mapping(request, model, Render)(model).render()\nprint get_mapping(request, model, Render, name=\"list\")(model).render()\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyramid-tiny-utility", "package_url": "https://pypi.org/project/pyramid-tiny-utility/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid-tiny-utility/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/pyramid-tiny-utility/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "the training wheel for developing with pyramid", "version": "0.0.2" }, "last_serial": 797596, "releases": { "0.0": [ { "comment_text": "", "digests": { "md5": "81a33bcbf19036e8f82f68d421adddd9", "sha256": "886170f88c779a34107e531b3007ff5aaedca19b2f2d44da944ab925e0c114e0" }, "downloads": -1, "filename": "pyramid-tiny-utility-0.0.tar.gz", "has_sig": false, "md5_digest": "81a33bcbf19036e8f82f68d421adddd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2792, "upload_time": "2013-05-11T08:02:37", "url": "https://files.pythonhosted.org/packages/6f/e9/880d5639ce5378717c4e4241f38eb683dcc31d3161354327f01eb5258265/pyramid-tiny-utility-0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "910c06ffca4996a1d5a81e42b63c3130", "sha256": "f4806787a4cdb78caae3ac68ea6d3f7e4a9f735c7607eb4d19a8ec3a88757c7f" }, "downloads": -1, "filename": "pyramid-tiny-utility-0.0.1.tar.gz", "has_sig": false, "md5_digest": "910c06ffca4996a1d5a81e42b63c3130", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3903, "upload_time": "2013-05-11T13:49:06", "url": "https://files.pythonhosted.org/packages/72/fc/901c3c4e24ecb9444de0987bbecb4159832a673e2996fd859c760a3a903d/pyramid-tiny-utility-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "cacb5b1195cf4faf1db4eeb44faa6b35", "sha256": "4284f680c54d807286d077ab1159fd0578e14a3fc4e9281226f5877c3c4e3871" }, "downloads": -1, "filename": "pyramid-tiny-utility-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cacb5b1195cf4faf1db4eeb44faa6b35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4040, "upload_time": "2013-05-11T17:38:36", "url": "https://files.pythonhosted.org/packages/04/3f/98127b205934e8afae9d28d09dc76387258debbe3c5d093c1b70713ed11c/pyramid-tiny-utility-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cacb5b1195cf4faf1db4eeb44faa6b35", "sha256": "4284f680c54d807286d077ab1159fd0578e14a3fc4e9281226f5877c3c4e3871" }, "downloads": -1, "filename": "pyramid-tiny-utility-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cacb5b1195cf4faf1db4eeb44faa6b35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4040, "upload_time": "2013-05-11T17:38:36", "url": "https://files.pythonhosted.org/packages/04/3f/98127b205934e8afae9d28d09dc76387258debbe3c5d093c1b70713ed11c/pyramid-tiny-utility-0.0.2.tar.gz" } ] }