{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: Implementation :: CPython" ], "description": "stringexchange\n========================================\n\nno pyramid\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n from stringexchange import make_exchange, function_call_emitter\n\n exchange = make_exchange(function_call_emitter)\n\n template = \"\"\"f(a, {}, b)\"\"\".format(exchange.subscribe(\"args\"))\n p = exchange.publisher(\"args\")\n\n p.publish(\"x\")\n p.publish(\"y\\n\")\n p.publish(\"z\")\n\n output = exchange.emit(template)\n assert output == \"f(a, x, y, z, b)\"\n\non pyramid\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nfile structure\n\n- onpyramid.py\n- top.html\n\nonpyramid.py\n\n.. code:: python\n\n # -*- coding:utf-8 -*-\n ## onpyramid.py\n from wsgiref.simple_server import make_server\n from pyramid.config import Configurator\n import os.path\n\n\n def top_view(request):\n js = request.string_exchange.publisher(\"js\")\n css = request.string_exchange.publisher(\"css\")\n return {\"css\": css, \"js\": js}\n\n\n if __name__ == '__main__':\n here = os.path.dirname(os.path.abspath(__file__))\n settings = {\"mako.directories\": here,\n \"pyramid.reload_templates\": True}\n config = Configurator(settings=settings)\n\n config.include(\"pyramid_mako\")\n config.include(\"stringexchange\") # !!\n config.add_mako_renderer(\".html\")\n\n config.add_route('top', '/')\n config.add_view(top_view, route_name='top', renderer=\"top.html\")\n\n app = config.make_wsgi_app()\n server = make_server('0.0.0.0', 8080, app)\n server.serve_forever()\n\ntop.html\n\n.. code:: html\n\n ## top.html\n \n \n ${request.string_exchange.subscribe(\"css\", emit=\"newline\", iterator=\"unique\")}\n \n \n \n \n <% js.publish('') %>\n <% js.publish('') %>\n

foo

\n foo content\n \n \n <% js.publish('') %>\n <% js.publish('') %>\n <% css.publish('') %>\n

boo

\n \n \n ${request.string_exchange.subscribe(\"js\", \"newline\", iterator=\"unique\")}\n \n \n\noutput\n\n.. code:: bash\n\n $ python demo/onpyramid.py &\n $ curl http://localhost:8080\n \n \n \n \n \n \n \n \n \n

foo

\n foo content\n \n \n \n \n \n

boo

\n \n \n \n \n \n \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": "", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "stringexchange", "package_url": "https://pypi.org/project/stringexchange/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/stringexchange/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/stringexchange/0.1/", "requires_dist": null, "requires_python": null, "summary": "anything like django sekizai", "version": "0.1" }, "last_serial": 1119273, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "388eda08c736bcc235ab1c87a504adc7", "sha256": "b68942d685993ebe9751a6d537171d3e8d39007e78b5e5ce5d1fe58a436b2cab" }, "downloads": -1, "filename": "stringexchange-0.1.tar.gz", "has_sig": false, "md5_digest": "388eda08c736bcc235ab1c87a504adc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4941, "upload_time": "2014-06-09T14:19:18", "url": "https://files.pythonhosted.org/packages/dc/5f/4dee6823478718460a80060b57084da51dc8c799e8664091c1a053f5d62e/stringexchange-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "388eda08c736bcc235ab1c87a504adc7", "sha256": "b68942d685993ebe9751a6d537171d3e8d39007e78b5e5ce5d1fe58a436b2cab" }, "downloads": -1, "filename": "stringexchange-0.1.tar.gz", "has_sig": false, "md5_digest": "388eda08c736bcc235ab1c87a504adc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4941, "upload_time": "2014-06-09T14:19:18", "url": "https://files.pythonhosted.org/packages/dc/5f/4dee6823478718460a80060b57084da51dc8c799e8664091c1a053f5d62e/stringexchange-0.1.tar.gz" } ] }