{"shas":[["84e2589f2205eb0b88fca92418c17950ab3a3f1b","85a9b6f2e1b0e212b7bb91b284faceef2db4d84d@gmail.com","Left too much unlrelated code in example.","Lance Stout"],["6d45971411f88f134abc28051c678986db8e9df8","85a9b6f2e1b0e212b7bb91b284faceef2db4d84d@gmail.com","Allow a stanza plugin to override a parent's interfaces.\n\nEach interface, say foo, may be overridden in three ways:\n    set_foo\n    get_foo\n    del_foo\n\nTo declare an override in a plugin, add the class field\noverrides as so:\n    overrides = ['set_foo', 'del_foo']\n\nEach override must have a matching set_foo(), etc method\nfor implementing the new behaviour.\n\nTo enable the overrides for a particular parent stanza,\npass the option overrides=True to register_stanza_plugin.\n\n    register_stanza_plugin(Stanza, Plugin, overrides=True)\n\nExample code:\n\nclass Test(ElementBase):\n\n    name = 'test'\n    namespace = 'testing'\n    interfaces = set(('foo', 'bar'))\n    sub_interfaces = set(('bar',))\n\nclass TestOverride(ElementBase):\n\n    name = 'test-override'\n    namespace = 'testing'\n    plugin_attrib = 'override'\n    interfaces = set(('foo',))\n    overrides = ['set_foo']\n\n    def setup(self, xml):\n        # Don't include an XML element in the parent stanza\n        # since we're adding just an attribute.\n        # If adding a regular subelement, no need to do this.\n        self.xml = ET.Element('')\n\n    def set_foo(self, value):\n        print(\"overrides!\")\n        self.parent()._set_attr('foo', 'override-%s' % value)\n\nregister_stanza_plugin(Test, TestOverride, overrides=True)\n\nExample usage:\n>>> t = TestStanza()\n>>> t['foo'] = 'bar'\n>>> t['foo']\n'override-bar'","Lance Stout"],["d94811d81d68d948155d42ff9096c23ccb90a73c","85a9b6f2e1b0e212b7bb91b284faceef2db4d84d@gmail.com","Added new implementation for XEP-0086.","Lance Stout"],["77601f7262370ba172966352a94575ec02b4a776","85a9b6f2e1b0e212b7bb91b284faceef2db4d84d@gmail.com","Merge branch 'develop' into roster","Lance Stout"]],"repo":"fritzy/SleekXMPP","actor":"legastero","ref":"refs/heads/roster","size":4,"head":"77601f7262370ba172966352a94575ec02b4a776","actor_gravatar":"7bd3d7290e1753406b15f00a9d7cdcbc","push_id":27440689}