Correct handling deleting plugins when xml:lang is active.

This commit is contained in:
Lance Stout 2012-10-10 11:07:25 -07:00
parent 4dd2c15775
commit 675c0112ac

View file

@ -662,7 +662,7 @@ class ElementBase(object):
full_attrib = attrib full_attrib = attrib
attrib_lang = ('%s|' % attrib).split('|') attrib_lang = ('%s|' % attrib).split('|')
attrib = attrib_lang[0] attrib = attrib_lang[0]
lang = attrib_lang[1] or '' lang = attrib_lang[1] or None
kwargs = {} kwargs = {}
if lang and attrib in self.lang_interfaces: if lang and attrib in self.lang_interfaces:
@ -738,7 +738,7 @@ class ElementBase(object):
full_attrib = attrib full_attrib = attrib
attrib_lang = ('%s|' % attrib).split('|') attrib_lang = ('%s|' % attrib).split('|')
attrib = attrib_lang[0] attrib = attrib_lang[0]
lang = attrib_lang[1] or '' lang = attrib_lang[1] or None
kwargs = {} kwargs = {}
if lang and attrib in self.lang_interfaces: if lang and attrib in self.lang_interfaces:
@ -824,7 +824,7 @@ class ElementBase(object):
full_attrib = attrib full_attrib = attrib
attrib_lang = ('%s|' % attrib).split('|') attrib_lang = ('%s|' % attrib).split('|')
attrib = attrib_lang[0] attrib = attrib_lang[0]
lang = attrib_lang[1] or '' lang = attrib_lang[1] or None
kwargs = {} kwargs = {}
if lang and attrib in self.lang_interfaces: if lang and attrib in self.lang_interfaces:
@ -862,7 +862,7 @@ class ElementBase(object):
del plugin[full_attrib] del plugin[full_attrib]
del self.plugins[(attrib, None)] del self.plugins[(attrib, None)]
else: else:
del self.plugins[(attrib, lang)] del self.plugins[(attrib, plugin['lang'])]
self.loaded_plugins.remove(attrib) self.loaded_plugins.remove(attrib)
try: try:
self.xml.remove(plugin.xml) self.xml.remove(plugin.xml)