sed -i 's/set((\(.*\),))$/{\1}/g' **/*.py
This commit is contained in:
		| @@ -19,7 +19,7 @@ class Challenge(StanzaBase): | ||||
|  | ||||
|     name = 'challenge' | ||||
|     namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' | ||||
|     interfaces = set(('value',)) | ||||
|     interfaces = {'value'} | ||||
|     plugin_attrib = name | ||||
|  | ||||
|     def setup(self, xml): | ||||
|   | ||||
| @@ -18,7 +18,7 @@ class Failure(StanzaBase): | ||||
|     namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' | ||||
|     interfaces = set(('condition', 'text')) | ||||
|     plugin_attrib = name | ||||
|     sub_interfaces = set(('text',)) | ||||
|     sub_interfaces = {'text'} | ||||
|     conditions = set(('aborted', 'account-disabled', 'credentials-expired', | ||||
|         'encryption-required', 'incorrect-encoding', 'invalid-authzid', | ||||
|         'invalid-mechanism', 'malformed-request', 'mechansism-too-weak', | ||||
|   | ||||
| @@ -19,7 +19,7 @@ class Response(StanzaBase): | ||||
|  | ||||
|     name = 'response' | ||||
|     namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' | ||||
|     interfaces = set(('value',)) | ||||
|     interfaces = {'value'} | ||||
|     plugin_attrib = name | ||||
|  | ||||
|     def setup(self, xml): | ||||
|   | ||||
| @@ -16,7 +16,7 @@ class STARTTLS(ElementBase): | ||||
|  | ||||
|     name = 'starttls' | ||||
|     namespace = 'urn:ietf:params:xml:ns:xmpp-tls' | ||||
|     interfaces = set(('required',)) | ||||
|     interfaces = {'required'} | ||||
|     plugin_attrib = name | ||||
|  | ||||
|     def get_required(self): | ||||
|   | ||||
| @@ -16,7 +16,7 @@ class FormField(ElementBase): | ||||
|     plugin_multi_attrib = 'fields' | ||||
|     interfaces = set(('answer', 'desc', 'required', 'value', | ||||
|                       'label', 'type', 'var')) | ||||
|     sub_interfaces = set(('desc',)) | ||||
|     sub_interfaces = {'desc'} | ||||
|     plugin_tag_map = {} | ||||
|     plugin_attrib_map = {} | ||||
|  | ||||
| @@ -165,7 +165,7 @@ class FieldOption(ElementBase): | ||||
|     name = 'option' | ||||
|     plugin_attrib = 'option' | ||||
|     interfaces = set(('label', 'value')) | ||||
|     sub_interfaces = set(('value',)) | ||||
|     sub_interfaces = {'value'} | ||||
|     plugin_multi_attrib = 'options' | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -24,7 +24,7 @@ class Form(ElementBase): | ||||
|     name = 'x' | ||||
|     plugin_attrib = 'form' | ||||
|     interfaces = OrderedSet(('instructions', 'reported', 'title', 'type', 'items', )) | ||||
|     sub_interfaces = set(('title',)) | ||||
|     sub_interfaces = {'title'} | ||||
|     form_types = set(('cancel', 'form', 'result', 'submit')) | ||||
|  | ||||
|     def __init__(self, *args, **kwargs): | ||||
|   | ||||
| @@ -72,7 +72,7 @@ class DiscoInfo(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/disco#info' | ||||
|     plugin_attrib = 'disco_info' | ||||
|     interfaces = set(('node', 'features', 'identities')) | ||||
|     lang_interfaces = set(('identities',)) | ||||
|     lang_interfaces = {'identities'} | ||||
|  | ||||
|     # Cache identities and features | ||||
|     _identities = set() | ||||
|   | ||||
| @@ -11,7 +11,7 @@ from slixmpp.xmlstream import ET | ||||
|  | ||||
| class OptionalSetting(object): | ||||
|  | ||||
|     interfaces = set(('required',)) | ||||
|     interfaces = {'required'} | ||||
|  | ||||
|     def set_required(self, value): | ||||
|         if value in (True, 'true', 'True', '1'): | ||||
|   | ||||
| @@ -23,7 +23,7 @@ class Affiliations(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'affiliations' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class Affiliation(ElementBase): | ||||
| @@ -56,14 +56,14 @@ class Subscriptions(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'subscriptions' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class SubscribeOptions(ElementBase, OptionalSetting): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'subscribe-options' | ||||
|     plugin_attrib = 'suboptions' | ||||
|     interfaces = set(('required',)) | ||||
|     interfaces = {'required'} | ||||
|  | ||||
|  | ||||
| class Item(ElementBase): | ||||
| @@ -105,7 +105,7 @@ class Create(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'create' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class Default(ElementBase): | ||||
| @@ -125,7 +125,7 @@ class Publish(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'publish' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class Retract(ElementBase): | ||||
| @@ -227,7 +227,7 @@ class PublishOptions(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub' | ||||
|     name = 'publish-options' | ||||
|     plugin_attrib = 'publish_options' | ||||
|     interfaces = set(('publish_options',)) | ||||
|     interfaces = {'publish_options'} | ||||
|     is_extension = True | ||||
|  | ||||
|     def get_publish_options(self): | ||||
|   | ||||
| @@ -44,49 +44,49 @@ class EventRetract(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'retract' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('id',)) | ||||
|     interfaces = {'id'} | ||||
|  | ||||
|  | ||||
| class EventItems(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'items' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventCollection(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'collection' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventAssociate(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'associate' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventDisassociate(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'disassociate' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventConfiguration(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'configuration' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventPurge(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#event' | ||||
|     name = 'purge' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class EventDelete(ElementBase): | ||||
|   | ||||
| @@ -41,7 +41,7 @@ class DefaultConfig(ElementBase): | ||||
|  | ||||
| class OwnerAffiliations(Affiliations): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|     def append(self, affiliation): | ||||
|         if not isinstance(affiliation, OwnerAffiliation): | ||||
| @@ -58,26 +58,26 @@ class OwnerConfigure(Configure): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     name = 'configure' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class OwnerDefault(OwnerConfigure): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class OwnerDelete(ElementBase, OptionalSetting): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     name = 'delete' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class OwnerPurge(ElementBase, OptionalSetting): | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     name = 'purge' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|  | ||||
| class OwnerRedirect(ElementBase): | ||||
| @@ -97,7 +97,7 @@ class OwnerSubscriptions(Subscriptions): | ||||
|     name = 'subscriptions' | ||||
|     namespace = 'http://jabber.org/protocol/pubsub#owner' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('node',)) | ||||
|     interfaces = {'node'} | ||||
|  | ||||
|     def append(self, subscription): | ||||
|         if not isinstance(subscription, OwnerSubscription): | ||||
|   | ||||
| @@ -37,7 +37,7 @@ class ChatState(ElementBase): | ||||
|     name = '' | ||||
|     namespace = 'http://jabber.org/protocol/chatstates' | ||||
|     plugin_attrib = 'chat_state' | ||||
|     interfaces = set(('chat_state',)) | ||||
|     interfaces = {'chat_state'} | ||||
|     sub_interfaces = interfaces | ||||
|     is_extension = True | ||||
|  | ||||
|   | ||||
| @@ -44,7 +44,7 @@ class LegacyError(ElementBase): | ||||
|     name = 'legacy' | ||||
|     namespace = Error.namespace | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('condition',)) | ||||
|     interfaces = {'condition'} | ||||
|     overrides = ['set_condition'] | ||||
|  | ||||
|     error_map = {'bad-request': ('modify', '400'), | ||||
|   | ||||
| @@ -22,7 +22,7 @@ log = logging.getLogger(__name__) | ||||
| class Compression(ElementBase): | ||||
|     name = 'compression' | ||||
|     namespace = 'http://jabber.org/features/compress' | ||||
|     interfaces = set(('methods',)) | ||||
|     interfaces = {'methods'} | ||||
|     plugin_attrib = 'compression' | ||||
|     plugin_tag_map = {} | ||||
|     plugin_attrib_map = {} | ||||
| @@ -37,7 +37,7 @@ class Compression(ElementBase): | ||||
| class Compress(StanzaBase): | ||||
|     name = 'compress' | ||||
|     namespace = 'http://jabber.org/protocol/compress' | ||||
|     interfaces = set(('method',)) | ||||
|     interfaces = {'method'} | ||||
|     sub_interfaces = interfaces | ||||
|     plugin_attrib = 'compress' | ||||
|     plugin_tag_map = {} | ||||
|   | ||||
| @@ -46,7 +46,7 @@ class UserNick(ElementBase): | ||||
|     namespace = 'http://jabber.org/protocol/nick' | ||||
|     name = 'nick' | ||||
|     plugin_attrib = name | ||||
|     interfaces = set(('nick',)) | ||||
|     interfaces = {'nick'} | ||||
|  | ||||
|     def set_nick(self, nick): | ||||
|         """ | ||||
|   | ||||
| @@ -13,7 +13,7 @@ class Request(ElementBase): | ||||
|     namespace = 'urn:xmpp:receipts' | ||||
|     name = 'request' | ||||
|     plugin_attrib = 'request_receipt' | ||||
|     interfaces = set(('request_receipt',)) | ||||
|     interfaces = {'request_receipt'} | ||||
|     sub_interfaces = interfaces | ||||
|     is_extension = True | ||||
|  | ||||
|   | ||||
| @@ -17,7 +17,7 @@ class Attention(ElementBase): | ||||
|     name = 'attention' | ||||
|     namespace = 'urn:xmpp:attention:0' | ||||
|     plugin_attrib = 'attention' | ||||
|     interfaces = set(('attention',)) | ||||
|     interfaces = {'attention'} | ||||
|     is_extension = True | ||||
|  | ||||
|     def setup(self, xml): | ||||
|   | ||||
| @@ -53,7 +53,7 @@ class Error(ElementBase): | ||||
|     plugin_attrib = 'error' | ||||
|     interfaces = set(('code', 'condition', 'text', 'type', | ||||
|                       'gone', 'redirect', 'by')) | ||||
|     sub_interfaces = set(('text',)) | ||||
|     sub_interfaces = {'text'} | ||||
|     plugin_attrib_map = {} | ||||
|     plugin_tag_map = {} | ||||
|     conditions = set(('bad-request', 'conflict', 'feature-not-implemented', | ||||
|   | ||||
| @@ -213,7 +213,7 @@ class ElementBase(object): | ||||
|         ...     name = "message" | ||||
|         ...     namespace = "jabber:client" | ||||
|         ...     interfaces = set(('to', 'from', 'type', 'body')) | ||||
|         ...     sub_interfaces = set(('body',)) | ||||
|         ...     sub_interfaces = {'body'} | ||||
|  | ||||
|     The resulting Message stanza's contents may be accessed as so:: | ||||
|  | ||||
|   | ||||
| @@ -140,7 +140,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foo" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('bar', 'baz', 'qux')) | ||||
|             sub_interfaces = set(('baz',)) | ||||
|             sub_interfaces = {'baz'} | ||||
|  | ||||
|             def get_qux(self): | ||||
|               return 'qux' | ||||
| @@ -149,7 +149,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foobar" | ||||
|             namespace = "foo" | ||||
|             plugin_attrib = "foobar" | ||||
|             interfaces = set(('fizz',)) | ||||
|             interfaces = {'fizz'} | ||||
|  | ||||
|         register_stanza_plugin(TestStanza, TestStanza, iterable=True) | ||||
|         register_stanza_plugin(TestStanza, TestStanzaPlugin) | ||||
| @@ -186,7 +186,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foo" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('bar', 'baz', 'qux')) | ||||
|             sub_interfaces = set(('baz',)) | ||||
|             sub_interfaces = {'baz'} | ||||
|  | ||||
|             def set_qux(self, value): | ||||
|                 pass | ||||
| @@ -195,7 +195,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foobar" | ||||
|             namespace = "foo" | ||||
|             plugin_attrib = "foobar" | ||||
|             interfaces = set(('foobar',)) | ||||
|             interfaces = {'foobar'} | ||||
|  | ||||
|         register_stanza_plugin(TestStanza, TestStanzaPlugin) | ||||
|  | ||||
| @@ -220,7 +220,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foo" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('bar', 'baz', 'qux')) | ||||
|             sub_interfaces = set(('bar',)) | ||||
|             sub_interfaces = {'bar'} | ||||
|  | ||||
|             def del_qux(self): | ||||
|                 pass | ||||
| @@ -229,7 +229,7 @@ class TestElementBase(SlixTest): | ||||
|             name = "foobar" | ||||
|             namespace = "foo" | ||||
|             plugin_attrib = "foobar" | ||||
|             interfaces = set(('foobar',)) | ||||
|             interfaces = {'foobar'} | ||||
|  | ||||
|         register_stanza_plugin(TestStanza, TestStanzaPlugin) | ||||
|  | ||||
| @@ -298,7 +298,7 @@ class TestElementBase(SlixTest): | ||||
|         class TestStanza(ElementBase): | ||||
|             name = "foo" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('bar',)) | ||||
|             interfaces = {'bar'} | ||||
|  | ||||
|             def set_bar(self, value): | ||||
|                 wrapper = ET.Element("{foo}wrapper") | ||||
| @@ -458,13 +458,13 @@ class TestElementBase(SlixTest): | ||||
|         class TestSubStanza(ElementBase): | ||||
|             name = "sub" | ||||
|             namespace = "baz" | ||||
|             interfaces = set(('attrib',)) | ||||
|             interfaces = {'attrib'} | ||||
|  | ||||
|         class TestStanza(ElementBase): | ||||
|             name = "foo" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('bar','baz', 'qux')) | ||||
|             sub_interfaces = set(('qux',)) | ||||
|             sub_interfaces = {'qux'} | ||||
|  | ||||
|             def set_qux(self, value): | ||||
|                 self._set_sub_text('qux', text=value) | ||||
| @@ -475,7 +475,7 @@ class TestElementBase(SlixTest): | ||||
|         class TestStanzaPlugin(ElementBase): | ||||
|             name = "plugin" | ||||
|             namespace = "http://test/slash/bar" | ||||
|             interfaces = set(('attrib',)) | ||||
|             interfaces = {'attrib'} | ||||
|  | ||||
|         register_stanza_plugin(TestStanza, TestSubStanza, iterable=True) | ||||
|         register_stanza_plugin(TestStanza, TestStanzaPlugin) | ||||
| @@ -592,7 +592,7 @@ class TestElementBase(SlixTest): | ||||
|         class TestSubStanza(ElementBase): | ||||
|             name = "foobar" | ||||
|             namespace = "foo" | ||||
|             interfaces = set(('qux',)) | ||||
|             interfaces = {'qux'} | ||||
|  | ||||
|         class TestStanza(ElementBase): | ||||
|             name = "foo" | ||||
| @@ -678,7 +678,7 @@ class TestElementBase(SlixTest): | ||||
|             name = 'extended' | ||||
|             namespace = 'foo' | ||||
|             plugin_attrib = name | ||||
|             interfaces = set((name,)) | ||||
|             interfaces = {name} | ||||
|             is_extension = True | ||||
|  | ||||
|             def set_extended(self, value): | ||||
| @@ -721,7 +721,7 @@ class TestElementBase(SlixTest): | ||||
|             name = 'overrider' | ||||
|             namespace = 'foo' | ||||
|             plugin_attrib = name | ||||
|             interfaces = set(('bar',)) | ||||
|             interfaces = {'bar'} | ||||
|             overrides = ['set_bar'] | ||||
|  | ||||
|             def setup(self, xml): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Emmanuel Gil Peyrot
					Emmanuel Gil Peyrot