コード例 #1
0
 def render(self):
     # First, we create our own variables, adapted
     # for template readability
     lb = self.names['basename'].lower()
     vars = self.templatevars
     path = '{}/'.format(lb)
     fn = '{}_rotatinglog.py'.format(lb)
     output = self.api.render(template='dbtools.tpl', variables=vars)
     retObj = FAXRender(creator=self.name,
                        relpath=path,
                        filename=fn,
                        contents=output)
     self.api.report_render_object(retObj)
     return (retObj)
コード例 #2
0
    def render(self):
        # print("This is hook render() at {}".format(self.name))
        # First, we create our own variables, adapted
        # for template readability

        fn = '{}.py'.format(self.vars['names']['basename'].lower())
        pprint(self.vars['import_lines'])

        output = self.api.render(template='entrypoint.tpl',
                                 variables=self.vars)

        retObj = FAXRender(creator=self.name, filename=fn, contents=output)
        self.api.report_render_object(retObj)
        return (retObj)
コード例 #3
0
    def render(self):
        # print("This is hook render() at {}".format(self.name))
        # First, we create our own variables, adapted
        # for template readability

        lb = self.vars['basename'].lower()
        path = '{}/'.format(lb)
        fn = '__init__.py'

        output = self.api.render(template='package.tpl', variables=self.vars)

        retObj = FAXRender(creator=self.name,
                           relpath=path,
                           filename=fn,
                           contents=output)
        self.api.report_render_object(retObj)
        return (retObj)
コード例 #4
0
 def render(self):
     t1 = self.names['basename'].lower()  # fapi
     b = self.names['backname'].lower()  # cp1fw
     # TODO: move to setupVars
     services = self.names['backname_services']  # nftables
     for s in services:
         self.templatevars['servicename'] = s
         self.templatevars['parameters'] = self.paramhelper(s)
         t1 = self.names['basename'].lower()
         path = '{}/'.format(t1)
         fn = '{}_{}.py'.format(b, s)
         output = self.api.render(template='backname_service.tpl',
                                  variables=self.templatevars)
         retObj = FAXRender(creator=self.name,
                            relpath=path,
                            filename=fn,
                            contents=output)
         self.api.report_render_object(retObj)
     return (None)