# Path: pyoracc/model/oraccobject.py
# class OraccObject(object):
# 
#     template = Template(r"""@${objecttype}
# % for child in children:
# ${child.serialize()}
# % endfor""", output_encoding='utf-8')
# 
#     def __init__(self, objecttype):
#         self.objecttype = objecttype
#         self.children = []
#         self.query = False
#         self.broken = False
#         self.remarkable = False
#         self.collated = False
# 
#     def __str__(self):
#         return OraccObject.template.render_unicode(**vars(self))
# 
#     def serialize(self):
#         return OraccObject.template.render_unicode(**vars(self))


from mako.template import Template
from .oraccobject import OraccObject
'''




class Text(object):
    template = Template("""&${code} = ${description}
#project: ${project}
#atf: lang ${language}
% for child in children:
${child.serialize()}
% endfor""")

    def __init__(self):
        self.children = []
        self.composite = False
        self.links = []
        self.score = None
        self.code = None
        self.description = None
        self.project = None
        self.language = None

    def __str__(self):
        return Text.template.render_unicode(**vars(self))

    def serialize(self):
        return Text.template.render_unicode(**vars(self))

    def objects(self):

# Path: pyoracc/model/oraccobject.py
# class OraccObject(object):
# 
#     template = Template(r"""@${objecttype}
# % for child in children:
# ${child.serialize()}
# % endfor""", output_encoding='utf-8')
# 
#     def __init__(self, objecttype):
#         self.objecttype = objecttype
#         self.children = []
#         self.query = False
#         self.broken = False
#         self.remarkable = False
#         self.collated = False
# 
#     def __str__(self):
#         return OraccObject.template.render_unicode(**vars(self))
# 
#     def serialize(self):
#         return OraccObject.template.render_unicode(**vars(self))


# Path: pyoracc/model/text.py
from mako.template import Template
from .oraccobject import OraccObject

'''




class Text(object):
    template = Template("""&${code} = ${description}
#project: ${project}
#atf: lang ${language}
% for child in children:
${child.serialize()}
% endfor""")

    def __init__(self):
        self.children = []
        self.composite = False
        self.links = []
        self.score = None
        self.code = None
        self.description = None
        self.project = None
        self.language = None

    def __str__(self):
        return Text.template.render_unicode(**vars(self))

    def serialize(self):
        return Text.template.render_unicode(**vars(self))

    def objects(self):

        return [x for x in self.children if isinstance(x, OraccObject)]