Fixed tab and spacing issue to please the Tab Nanny during unit tests.

This commit is contained in:
Lance Stout 2010-06-27 10:14:21 -04:00
parent 646a609c0b
commit acb53ba371

View file

@ -30,7 +30,7 @@ class Addresses(ElementBase):
address['delivered'] = delivered address['delivered'] = delivered
return address return address
def getAddresses(self, atype=None): def getAddresses(self, atype=None):
addresses = [] addresses = []
for addrXML in self.xml.findall('{%s}address' % Address.namespace): for addrXML in self.xml.findall('{%s}address' % Address.namespace):
# ElementTree 1.2.6 does not support [@attr='value'] in findall # ElementTree 1.2.6 does not support [@attr='value'] in findall
@ -39,7 +39,7 @@ class Addresses(ElementBase):
addresses.append(Address(xml=addrXML, parent=None)) addresses.append(Address(xml=addrXML, parent=None))
return addresses return addresses
def setAddresses(self, addresses, set_type=None): def setAddresses(self, addresses, set_type=None):
self.delAddresses(set_type) self.delAddresses(set_type)
for addr in addresses: for addr in addresses:
# Remap 'type' to 'atype' to match the add method # Remap 'type' to 'atype' to match the add method
@ -51,7 +51,7 @@ class Addresses(ElementBase):
addr['atype'] = curr_type addr['atype'] = curr_type
self.addAddress(**addr) self.addAddress(**addr)
def delAddresses(self, atype=None): def delAddresses(self, atype=None):
for addrXML in self.xml.findall('{%s}address' % Address.namespace): for addrXML in self.xml.findall('{%s}address' % Address.namespace):
# ElementTree 1.2.6 does not support [@attr='value'] in findall # ElementTree 1.2.6 does not support [@attr='value'] in findall
if atype is not None and addrXML.get('type') == atype: if atype is not None and addrXML.get('type') == atype:
@ -62,59 +62,59 @@ class Addresses(ElementBase):
def delBcc(self): def delBcc(self):
self.delAddresses('bcc') self.delAddresses('bcc')
def delCc(self): def delCc(self):
self.delAddresses('cc') self.delAddresses('cc')
def delNoreply(self): def delNoreply(self):
self.delAddresses('noreply') self.delAddresses('noreply')
def delReplyroom(self): def delReplyroom(self):
self.delAddresses('replyroom') self.delAddresses('replyroom')
def delReplyto(self): def delReplyto(self):
self.delAddresses('replyto') self.delAddresses('replyto')
def delTo(self): def delTo(self):
self.delAddresses('to') self.delAddresses('to')
# -------------------------------------------------------------- # --------------------------------------------------------------
def getBcc(self): def getBcc(self):
return self.getAddresses('bcc') return self.getAddresses('bcc')
def getCc(self): def getCc(self):
return self.getAddresses('cc') return self.getAddresses('cc')
def getNoreply(self): def getNoreply(self):
return self.getAddresses('noreply') return self.getAddresses('noreply')
def getReplyroom(self): def getReplyroom(self):
return self.getAddresses('replyroom') return self.getAddresses('replyroom')
def getReplyto(self): def getReplyto(self):
return self.getAddresses('replyto') return self.getAddresses('replyto')
def getTo(self): def getTo(self):
return self.getAddresses('to') return self.getAddresses('to')
# -------------------------------------------------------------- # --------------------------------------------------------------
def setBcc(self, addresses): def setBcc(self, addresses):
self.setAddresses(addresses, 'bcc') self.setAddresses(addresses, 'bcc')
def setCc(self, addresses): def setCc(self, addresses):
self.setAddresses(addresses, 'cc') self.setAddresses(addresses, 'cc')
def setNoreply(self, addresses): def setNoreply(self, addresses):
self.setAddresses(addresses, 'noreply') self.setAddresses(addresses, 'noreply')
def setReplyroom(self, addresses): def setReplyroom(self, addresses):
self.setAddresses(addresses, 'replyroom') self.setAddresses(addresses, 'replyroom')
def setReplyto(self, addresses): def setReplyto(self, addresses):
self.setAddresses(addresses, 'replyto') self.setAddresses(addresses, 'replyto')
def setTo(self, addresses): def setTo(self, addresses):
self.setAddresses(addresses, 'to') self.setAddresses(addresses, 'to')
@ -123,9 +123,9 @@ class Address(ElementBase):
name = 'address' name = 'address'
plugin_attrib = 'address' plugin_attrib = 'address'
interfaces = set(('delivered', 'desc', 'jid', 'node', 'type', 'uri')) interfaces = set(('delivered', 'desc', 'jid', 'node', 'type', 'uri'))
address_types = set(('bcc', 'cc', 'noreply', 'replyroom', 'replyto', 'to')) address_types = set(('bcc', 'cc', 'noreply', 'replyroom', 'replyto', 'to'))
def getDelivered(self): def getDelivered(self):
return self.attrib.get('delivered', False) return self.attrib.get('delivered', False)
def setDelivered(self, delivered): def setDelivered(self, delivered):
@ -134,7 +134,7 @@ class Address(ElementBase):
else: else:
del self['delivered'] del self['delivered']
def setUri(self, uri): def setUri(self, uri):
if uri: if uri:
del self['jid'] del self['jid']
del self['node'] del self['node']