print 'template modified'
            self.save_template(template, tmp)
        os.remove(path)
        
if __name__ == '__main__':
    #f = file('tmp/trait.xml')
    #tx = TraitXml(f)
    import sys
    ct = convert_text_to_cheetah_template
    text = file('/etc/adduser.conf').read()
    text = file('/etc/bash.bashrc').read()
    ctest = file('ctest').read()
    from paella.db import PaellaConnection
    conn = PaellaConnection()
    tt = TraitTemplate(conn, 'etch')
    from paella.db.trait.main import Trait
    trait = Trait(conn)
    traits = trait.get_trait_list()
    
    def ptraits():
        for trait in traits:
            print 'trait', trait
            print '-'*30
            tt.set_trait(trait)
            for template in [r.template for r in tt.templates()]:
                print 'processing template', template
                text = tt.templatedata(template)
                ct(text)
                print
            print '='*30
Exemple #2
0
            self.save_template(template, tmp)
        os.remove(path)


if __name__ == '__main__':
    #f = file('tmp/trait.xml')
    #tx = TraitXml(f)
    import sys
    ct = convert_text_to_cheetah_template
    text = file('/etc/adduser.conf').read()
    text = file('/etc/bash.bashrc').read()
    ctest = file('ctest').read()
    from paella.db import PaellaConnection
    conn = PaellaConnection()
    tt = TraitTemplate(conn, 'etch')
    from paella.db.trait.main import Trait
    trait = Trait(conn)
    traits = trait.get_trait_list()

    def ptraits():
        for trait in traits:
            print 'trait', trait
            print '-' * 30
            tt.set_trait(trait)
            for template in [r.template for r in tt.templates()]:
                print 'processing template', template
                text = tt.templatedata(template)
                ct(text)
                print
            print '=' * 30