{ "info": { "author": "Alessandro Molina", "author_email": "alessandro.molina@axant.it", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: TurboGears", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "About Mobile Middleware\n-------------------------\n\nMobile Middleware is a middleware for WSGI applications.\n\nThought to be used on TurboGears 2 applications it detects mobile browser and provides a way\nto detect and react to them. Detection expression can be customized and action can\nchange from plain detection to exposing a specific custom template for mobile requests\n\nYou will be able to see if your request is coming from a mobile browser with::\n\n from tg import request\n request.is_mobile\n\nInstalling\n-------------------------------\n\ntgext.mobilemiddleware can be installed both from pypi or from bitbucket::\n\n easy_install tgext.mobilemiddleware\n\nshould just work for most of the users\n\nEnabling Mobile Agents Detection\n----------------------------------\n\nIn your application *config/middleware.py* import **MobileMiddleware**:: \n\n from tgext.mobilemiddleware import MobileMiddleware\n\nChange your **make_app** method::\n\n app = make_base_app(global_conf, full_stack=True, **app_conf)\n return MobileMiddleware(app, app_conf)\n\nExposing Mobile Templates\n----------------------------\n\n**tgext.mobilemiddleware** implements a *@expose_mobile* decorator that works like *@expose*\nTurboGears2 decorator which can be used to specify which template to expose for mobile requests.\n\nThis will work by switching the template before rendering the view if the request\nis detected to be from a mobile browser.\n*@expose_mobile* supports the same template naming convention that @expose uses\nand can accept any rendering engine that has been registered in TurboGears\nby specifying it as *engine:module.template_name* \n\nExamples::\n\n @expose('app.templates.index')\n @expose_mobile('app.templates.mobile.index')\n def index(self, *args, **kw):\n return dict()\n\n\nCustomizing User Agents Detection\n-----------------------------------\n\nIf you want to quickly customize the regular expression used to detect the mobile browser you can define *mobile.agents* \nconfiguration variable in your application config file and set it to the regular expression that you want to use.\n\nFor more complex customizations, you may create your own subclass of **DetectMobileBrowser**, \nor callable object and supply it as an argument to **MobileMiddleware**, like::\n\n return MobileMiddleware(app, app_conf, mobile_browser_detector=YourClass)\n\n**DetectMobileBrowser** behaviour can be changed by any subclass by overridding the **DetectMobileBrowser.perform_detection** method.\nIf user has defined a custom regular expression it will be available inside the *perform_detection* method as *self.custom_mobile_re*", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/_amol_/tgext.mobilemiddleware", "keywords": "turbogears2.extension pylons", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "tgext.mobilemiddleware", "package_url": "https://pypi.org/project/tgext.mobilemiddleware/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tgext.mobilemiddleware/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/_amol_/tgext.mobilemiddleware" }, "release_url": "https://pypi.org/project/tgext.mobilemiddleware/0.4/", "requires_dist": null, "requires_python": null, "summary": "Mobile Middleware utilities for Turbogears 2 detects mobile browsers", "version": "0.4" }, "last_serial": 5486084, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "62296547ecfe94de54718f4f3733c710", "sha256": "88cd9128ef1af3a7ec4183dc6b176de8e945f6c2f4af87d9436afe684333d022" }, "downloads": -1, "filename": "tgext.mobilemiddleware-0.1.tar.gz", "has_sig": false, "md5_digest": "62296547ecfe94de54718f4f3733c710", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3012, "upload_time": "2011-04-18T23:41:28", "url": "https://files.pythonhosted.org/packages/a5/d8/6746f17c59b331c509c0414d77f8e9a62c84c41d9b35331b0640c2fd1419/tgext.mobilemiddleware-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "9cae2cd21d2be32f092a6fc22b6b1f62", "sha256": "4d06aa8e41446c635e63b317ce167e6574d2482413934e288e46bb63395a48ee" }, "downloads": -1, "filename": "tgext.mobilemiddleware-0.2.tar.gz", "has_sig": false, "md5_digest": "9cae2cd21d2be32f092a6fc22b6b1f62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3047, "upload_time": "2011-04-19T10:00:45", "url": "https://files.pythonhosted.org/packages/af/d1/a55ac2a07d3eb6879bbfbc58958cd3a9bb3d2c9fe94467e19648007b3715/tgext.mobilemiddleware-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "9ef99697e43f2dec4b6bc2a0051414f2", "sha256": "d09b40f22dc53fcf161fa702e26ca74dd32962d7781d60cb9e0fdcee24e6a47a" }, "downloads": -1, "filename": "tgext.mobilemiddleware-0.3.tar.gz", "has_sig": false, "md5_digest": "9ef99697e43f2dec4b6bc2a0051414f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4753, "upload_time": "2011-04-29T18:22:03", "url": "https://files.pythonhosted.org/packages/4f/7e/e40d75a05e0176e2f068f89641094b7f4c03eb5ae26a9a27cfd281fb2a4b/tgext.mobilemiddleware-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "d2d1e35eac5fd418d9860b76ab85fb50", "sha256": "6f52aee1ef3ebadfba41c295735768231c150effbc89c80d7c33aa1bfdca7fc0" }, "downloads": -1, "filename": "tgext.mobilemiddleware-0.4.tar.gz", "has_sig": false, "md5_digest": "d2d1e35eac5fd418d9860b76ab85fb50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4983, "upload_time": "2013-01-17T09:02:52", "url": "https://files.pythonhosted.org/packages/a6/22/b385657211db8b885b5bf8b8f778a627598c08304b2caf85f36d36257379/tgext.mobilemiddleware-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d2d1e35eac5fd418d9860b76ab85fb50", "sha256": "6f52aee1ef3ebadfba41c295735768231c150effbc89c80d7c33aa1bfdca7fc0" }, "downloads": -1, "filename": "tgext.mobilemiddleware-0.4.tar.gz", "has_sig": false, "md5_digest": "d2d1e35eac5fd418d9860b76ab85fb50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4983, "upload_time": "2013-01-17T09:02:52", "url": "https://files.pythonhosted.org/packages/a6/22/b385657211db8b885b5bf8b8f778a627598c08304b2caf85f36d36257379/tgext.mobilemiddleware-0.4.tar.gz" } ] }