@@ -25,6 +25,9 @@ from ..string_mixin import StringMixIn | |||||
__all__ = ["Node"] | __all__ = ["Node"] | ||||
class Node(StringMixIn): | class Node(StringMixIn): | ||||
def __unicode__(self): | |||||
raise NotImplementedError() | |||||
def __iternodes__(self, getter): | def __iternodes__(self, getter): | ||||
yield None, self | yield None, self | ||||
@@ -26,6 +26,7 @@ __all__ = ["Attribute"] | |||||
class Attribute(StringMixIn): | class Attribute(StringMixIn): | ||||
def __init__(self, name, value=None, quoted=True): | def __init__(self, name, value=None, quoted=True): | ||||
super(Attribute, self).__init__(self) | |||||
self._name = name | self._name = name | ||||
self._value = value | self._value = value | ||||
self._quoted = quoted | self._quoted = quoted | ||||
@@ -27,6 +27,7 @@ __all__ = ["Parameter"] | |||||
class Parameter(StringMixIn): | class Parameter(StringMixIn): | ||||
def __init__(self, name, value, showkey=True): | def __init__(self, name, value, showkey=True): | ||||
super(Parameter, self).__init__(self) | |||||
self._name = name | self._name = name | ||||
self._value = value | self._value = value | ||||
self._showkey = showkey | self._showkey = showkey | ||||
@@ -26,6 +26,7 @@ __all__ = ["Heading"] | |||||
class Heading(Node): | class Heading(Node): | ||||
def __init__(self, title, level): | def __init__(self, title, level): | ||||
super(Heading, self).__init__(self) | |||||
self._title = title | self._title = title | ||||
self._level = level | self._level = level | ||||
@@ -28,6 +28,7 @@ __all__ = ["HTMLEntity"] | |||||
class HTMLEntity(Node): | class HTMLEntity(Node): | ||||
def __init__(self, value, named=None, hexadecimal=False): | def __init__(self, value, named=None, hexadecimal=False): | ||||
super(HTMLEntity, self).__init__(self) | |||||
self._value = value | self._value = value | ||||
if named is None: # Try to guess whether or not the entity is named | if named is None: # Try to guess whether or not the entity is named | ||||
try: | try: | ||||
@@ -69,6 +69,7 @@ class Tag(Node): | |||||
def __init__(self, type_, tag, contents, attrs=None, showtag=True, | def __init__(self, type_, tag, contents, attrs=None, showtag=True, | ||||
self_closing=False, open_padding=0, close_padding=0): | self_closing=False, open_padding=0, close_padding=0): | ||||
super(Tag, self).__init__(self) | |||||
self._type = type_ | self._type = type_ | ||||
self._tag = tag | self._tag = tag | ||||
self._contents = contents | self._contents = contents | ||||
@@ -33,6 +33,7 @@ FLAGS = re.DOTALL | re.UNICODE | |||||
class Template(Node): | class Template(Node): | ||||
def __init__(self, name, params=None): | def __init__(self, name, params=None): | ||||
super(Template, self).__init__(self) | |||||
self._name = name | self._name = name | ||||
if params: | if params: | ||||
self._params = params | self._params = params | ||||
@@ -26,6 +26,7 @@ __all__ = ["Text"] | |||||
class Text(Node): | class Text(Node): | ||||
def __init__(self, value): | def __init__(self, value): | ||||
super(Text, self).__init__(self) | |||||
self._value = value | self._value = value | ||||
def __unicode__(self): | def __unicode__(self): | ||||
@@ -100,7 +100,7 @@ class SmartList(list): | |||||
del self[index] | del self[index] | ||||
return item | return item | ||||
def remove(item): | |||||
def remove(self, item): | |||||
del self[self.index(item)] | del self[self.index(item)] | ||||
def reverse(self): | def reverse(self): | ||||
@@ -33,6 +33,7 @@ FLAGS = re.IGNORECASE | re.DOTALL | re.UNICODE | |||||
class Wikicode(StringMixIn): | class Wikicode(StringMixIn): | ||||
def __init__(self, nodes): | def __init__(self, nodes): | ||||
super(Wikicode, self).__init__(self) | |||||
self._nodes = nodes | self._nodes = nodes | ||||
def __unicode__(self): | def __unicode__(self): | ||||