{ "info": { "author": "Kyle Adams", "author_email": "kadams54@users.sourceforge.net", "bugtrack_url": null, "classifiers": [], "description": "About switchboard-tg2\n-------------------------\n\nswitchboard-tg2 provides an easy way to plug Switchboard_, a feature flipper\nlibrary, into TurboGears2 applications.\n\nInstalling\n-------------------------------\n\nswitchboard-tg2 can be installed both from pypi::\n\n easy_install switchboard-tg2\n\nshould just work for most of the users.\n\nUsing switchboard-tg2\n----------------------------\n\nIn your application *config/app_cfg.py* import **plug**::\n\n from tgext.pluggable import plug\n\nThen at the *end of the file* call plug with switchboard-tg2::\n\n plug(base_config, 'switchboard_tg2')\n\nYou will be able to access Switchboard's admin UI at\n*http://localhost:8080/switchboard*.\n\nYou will also need to configure Switchboard's access to memcached and MongoDB.\nBy default Switchboard attempts to connect to both of these services on\nlocalhost and on the default ports. If it fails to connect it will fall back\nto in-memory equivalents and display warning messages in the admin UI.\n\nWhile running with the in-memory mode enabled is fine for getting started\nquickly, please do not run in production in this mode!\n\nGetting Started - An Example\n----------------------------\n\nThe `switchboard-tg2 code`_ contains an example TurboGears 2 application,\nmodified to use Switchboard. The application is a quickstart application and\nthe only changes made to it where to setup Switchboard. You'll find the\napplication in the 'example' directory. Here's how Switchboard was added to\nthe app:\n\n#. Add the plug call to *app_cfg.py*::\n\n from tgext.pluggable import plug\n ...\n plug(base_config, 'switchboard_tg2')\n\n#. Import Switchboard's operator and use it to optionally display a flash\n message from the *root.py* controller, as an example of using Switchboard in Python\n code::\n\n from switchboard import operator\n ...\n if operator.is_active('hello_world'):\n flash('Hello World')\n\n#. Next, we want to pass the operator off to the template so that we can\n also use it there. Again, in the *root.py* controller::\n\n return(page='index', operator=operator)\n\n#. Finally we can use the operator in the *index.html* template to make various\n parts of the page turn on or off::\n\n \n ...\n \n\nOne thing to note: the template demonstrates the use of parent/child switches.\nThe *getting_started* switch is the parent switch. Any switch prefixed with\n*getting_started:* will be a child. Children inherit conditions from their\nparents and can add conditions of their own.\n\nTo see all of these switches in action: run *paster serve development.ini* in the\nexample directory and point your browser to *http://localhost:8080/*. Once you\nload the index page, all of the switches encountered will be automagically\ncreated within Switchboard. When you pull up the admin UI at\n*http://localhost:8080/switchboard/*, you'll see the *hello_world* and\n*getting_started* switches.\n\nSet the *getting_started* switch to \"Active for everyone\" and reload the index\npage. Now reload the Switchboard admin and you should see several more of the\nchild switches for the Getting Started section. These switches weren't created\nbecause they weren't even checked until their parent switch was turned on.\n\nPlay around with turning various switches on and off to see what impact it\nhas on the index page. You can also try adding conditions to a switch to see\nwhat happens when a switch is only active under certain conditions.\n\nHere's a diff of all the changes made to the example app to change it from\nthe stock quickstart app to a Switchboard-enabled app:\n\nhttp://pastie.org/6634144\n\nMore information\n----------------------\n\nYou can find more information about Switchboard and how to use it in your code\nin the `Switchboard docs`_.\n\n.. _Switchboard: http://sf.net/p/switchboard/\n.. _Switchboard docs: http://switchboard.readthedocs.org/\n.. _switchboard-tg2 code: https://sourceforge.net/p/switchboard-tg2/code/ci/a1930e98f90765dc914caf711540e43f184176c9/tree/example/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://sf.net/projects/switchboard-tg2", "keywords": "turbogears2.application", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "switchboard-tg2", "package_url": "https://pypi.org/project/switchboard-tg2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/switchboard-tg2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://sf.net/projects/switchboard-tg2" }, "release_url": "https://pypi.org/project/switchboard-tg2/0.3/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.3" }, "last_serial": 800299, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "79d0373c28d8bf8ec6dfdb2941862de1", "sha256": "37a3d30587d906d97f4a79e5ad1b128b95c295b69b38c99d5126875bf9789eee" }, "downloads": -1, "filename": "switchboard-tg2-0.1.tar.gz", "has_sig": false, "md5_digest": "79d0373c28d8bf8ec6dfdb2941862de1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2503, "upload_time": "2013-03-18T21:34:27", "url": "https://files.pythonhosted.org/packages/7f/0d/8fdfdbec7787a7495f09a46044f9af4a6f13b9f82963664354698e3040f8/switchboard-tg2-0.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d54e844fb92657a0f8ef04e257caf1d1", "sha256": "559e4d699eb90b62faed53a928bb24d9b7ea15ef714c271123bd2c2968cd8a26" }, "downloads": -1, "filename": "switchboard-tg2-0.3.tar.gz", "has_sig": false, "md5_digest": "d54e844fb92657a0f8ef04e257caf1d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3841, "upload_time": "2013-03-20T01:11:17", "url": "https://files.pythonhosted.org/packages/64/ab/048920550a50e6cb44e6cade55504a19bb93d282636ada1565ac0c72485f/switchboard-tg2-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d54e844fb92657a0f8ef04e257caf1d1", "sha256": "559e4d699eb90b62faed53a928bb24d9b7ea15ef714c271123bd2c2968cd8a26" }, "downloads": -1, "filename": "switchboard-tg2-0.3.tar.gz", "has_sig": false, "md5_digest": "d54e844fb92657a0f8ef04e257caf1d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3841, "upload_time": "2013-03-20T01:11:17", "url": "https://files.pythonhosted.org/packages/64/ab/048920550a50e6cb44e6cade55504a19bb93d282636ada1565ac0c72485f/switchboard-tg2-0.3.tar.gz" } ] }