28 |
# |
# |
29 |
|
|
30 |
from gnue.designer.TemplateBase import * |
from gnue.designer.TemplateBase import * |
31 |
try: |
import Incubator |
|
import Incubator |
|
|
except: |
|
|
print 'Incubator import failed' |
|
32 |
from gnue.reports.GRReport import GRReport |
from gnue.reports.GRReport import GRReport |
33 |
|
from gnue.common import GParserHelpers |
34 |
|
from gnue.reports import GRLayout |
35 |
# TODO |
# TODO |
36 |
def createRootObject(instance): |
def createRootObject(instance): |
37 |
return GRReport.GRReport() |
return GRReport.GRReport() |
50 |
pass |
pass |
51 |
|
|
52 |
|
|
53 |
|
def AddContent(self, parent, content): |
54 |
|
GParserHelpers.GContent(parent, content) |
55 |
|
|
56 |
|
def AddElement(self, tag, parent, attributes={}, ns=None): |
57 |
|
if ns: |
58 |
|
o = GRLayout.GRPassThru(parent) |
59 |
|
o._xmltag = tag |
60 |
|
o._xmlnamespace = ns |
61 |
|
o._listedAttributes = attributes.keys() |
62 |
|
else: |
63 |
|
o = self.parser.elements[tag]['BaseClass'](parent) |
64 |
|
|
65 |
|
o.__dict__.update(attributes) |
66 |
|
o._buildObject() |
67 |
|
self.parser.instance.onCreateObject(o, __name__) |
68 |
|
return o |
69 |
|
|