Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drafthorse/models/container.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class Container:
__slots__ = ("children", "child_type")

def __init__(self, child_type):
super().__init__()
self.children = []
Expand Down Expand Up @@ -26,6 +28,8 @@ def add_from_etree(self, root, strict=True):


class SimpleContainer(Container):
__slots__ = ("children", "child_type", "namespace", "tag")

def __init__(self, child_type, namespace, tag):
super().__init__(child_type)
self.namespace = namespace
Expand All @@ -51,6 +55,8 @@ def add_from_etree(self, root, strict=True):


class CurrencyContainer(SimpleContainer):
__slots__ = ("children", "child_type", "namespace", "tag")

def empty_element(self):
from .elements import CurrencyElement

Expand All @@ -65,6 +71,8 @@ def add_from_etree(self, root, strict=True):


class IDContainer(SimpleContainer):
__slots__ = ("children", "child_type", "namespace", "tag")

def empty_element(self):
from .elements import IDElement

Expand All @@ -79,6 +87,8 @@ def add_from_etree(self, root, strict=True):


class StringContainer(SimpleContainer):
__slots__ = ("children", "child_type", "namespace", "tag")

def empty_element(self):
from .elements import StringElement

Expand Down
Loading