示例#1
0
 def set_profile(self, profile):
     self.clear_body()
     self.profile.set_profile(profile)
     title = SimpleTitleElement('Profile:  %s' % profile,
                                bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     rows = self.profile.get_trait_rows()
     ptitle = Anchor('edit.traits.%s' % self.profile.current.profile,
                     'Traits')
     self.body.appendChild(SectionTitle(ptitle))
     #self.body.appendChild(SectionTitle('Traits'))
     if len(rows):
         self.body.appendChild(TraitTable(rows, bgcolor='IndianRed1'))
     vtitle = Anchor('edit.variables.%s' % self.profile.current.profile,
                     'Variables')
     self.body.appendChild(SectionTitle(vtitle))
     erows = self.profile._env.get_rows()
     if len(erows):
         self.body.appendChild(PVarTable(erows, bgcolor='MistyRose2'))
     etitle = Anchor('edit.families.%s' % self.profile.current.profile,
                     'Families')
     self.body.appendChild(SectionTitle(etitle))
     families = self.profile.get_families()
     flist = UnorderedList()
     for f in families:
         flist.appendChild(ListItem(f))
     self.body.appendChild(flist)
示例#2
0
 def __init__(self, parent, actions, trows, crows):
     UnorderedList.__init__(self)
     self._actiondata = {}
     for a in actions:
         self._actiondata[a.actionid] = a
     self.actions = {}
     for row in trows:
         element = UnorderedList()
         # li = ListItem('action-%d' % row.actionid)
         li = ActionItem(self._actiondata[row.actionid])
         element.appendChild(li)
         self.actions[row.actionid] = element
         self.appendChild(element)
     self.make_threads(parent, crows)
示例#3
0
 def make_threads(self, parent, rows):
     while len(rows):
         row = rows[0]
         element = UnorderedList()
         # element = ListItem('actionid %d' % row.actionid)
         if not row.parent:
             parent.appendChild(element)
             # element.appendChild(ListItem('actionid--%d' % row.actionid))
         elif not self.actions.has_key(row.parent):
             rows.append(row)
         else:
             self.actions[row.parent].appendChild(element)
             element.appendChild(ActionItem(self._actiondata[row.actionid]))
         self.actions[row.actionid] = element
         del rows[0]
示例#4
0
 def set_family(self, family):
     self.family.set_family(family)
     parents = self.family.parents()
     erows = self.family.environment_rows()
     self.clear_body()
     title = SimpleTitleElement('Family:  %s' % family, bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     self.body.appendChild(SectionTitle('Parents'))
     if len(parents):
         plist = UnorderedList()
         for p in parents:
             plist.appendChild(ListItem(p))
         self.body.appendChild(plist)
     self.body.appendChild(SectionTitle('Variables'))
     if len(erows):
         self.body.appendChild(PVarTable(erows, bgcolor='MistyRose2'))
示例#5
0
 def set_family(self, family):
     self.family.set_family(family)
     parents = self.family.parents()
     erows = self.family.environment_rows()
     self.clear_body()
     title = SimpleTitleElement('Family:  %s' % family, bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     self.body.appendChild(SectionTitle('Parents'))
     if len(parents):
         plist = UnorderedList()
         for p in parents:
             plist.appendChild(ListItem(p))
         self.body.appendChild(plist)
     self.body.appendChild(SectionTitle('Variables'))
     if len(erows):
         self.body.appendChild(PVarTable(erows, bgcolor='MistyRose2'))
示例#6
0
 def set_family(self, family):
     self.family.set_family(family)
     parents = self.family.parents()
     erows = self.family.environment_rows()
     self.clear_body()
     title = SimpleTitleElement("Family:  %s" % family, bgcolor="IndianRed", width="100%")
     self.body.appendChild(title)
     self.body.appendChild(SectionTitle("Parents"))
     if len(parents):
         plist = UnorderedList()
         for p in parents:
             plist.appendChild(ListItem(p))
         self.body.appendChild(plist)
     vtitle = Anchor("edit.variables.%s" % self.family.current, "Variables")
     self.body.appendChild(SectionTitle(vtitle))
     if len(erows):
         self.body.appendChild(PVarTable(erows, bgcolor="MistyRose2"))
示例#7
0
 def set_trait(self, trait):
     self.clear_body()
     self.trait.set_trait(trait)
     title = SimpleTitleElement('Trait: %s' % trait,
                                bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     self.body.appendChild(HR())
     plist = UnorderedList()
     parents = self.trait.parents(trait=trait)
     parent_section = SectionTitle('Parents')
     parent_section.create_rightside_table()
     parent_section.append_rightside_anchor(
         Anchor('hello.there.dude', 'edit'))
     parent_section.append_rightside_anchor(
         Anchor('hello.there.dudee', 'edit2'))
     self.body.appendChild(parent_section)
     for parent in parents:
         pp = Anchor('show.parent.%s' % parent, parent)
         plist.appendChild(ListItem(pp))
     self.body.appendChild(plist)
     #ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages')
     ptitle = SectionTitle('Packages')
     ptitle_anchor = Anchor('new.package.%s' % trait, '(new)')
     td = TD()
     td.appendChild(ptitle_anchor)
     ptitle.row.appendChild(td)
     self.body.appendChild(ptitle)
     rows = self.trait.packages(trait=trait, action=True)
     self.body.appendChild(PackageTable(rows, bgcolor='SkyBlue3'))
     ttitle = Anchor('edit.templates.%s' % trait, 'Templates')
     self.body.appendChild(SectionTitle(ttitle))
     rows = self.trait.templates(
         trait=trait, fields=['package', 'template', 'templatefile'])
     if len(rows):
         self.body.appendChild(TemplateTable(rows, bgcolor='DarkSeaGreen3'))
     self.body.appendChild(SectionTitle('Variables', href='foo.var.ick'))
     if len(self.trait.environ.keys()):
         env = TraitEnvTable(trait,
                             self.trait.environ,
                             bgcolor='MistyRose3')
         self.body.appendChild(env)
     self.body.appendChild(SectionTitle('Scripts'))
     slist = UnorderedList()
     for row in self.trait._scripts.scripts(trait=trait):
         script = row.script
         sa = Anchor('show.script.%s' % script, script)
         slist.appendChild(ListItem(sa))
     self.body.appendChild(slist)
示例#8
0
 def set_profile(self, profile):
     self.clear_body()
     self.profile.set_profile(profile)
     title = SimpleTitleElement("Profile:  %s" % profile, bgcolor="IndianRed", width="100%")
     self.body.appendChild(title)
     rows = self.profile.get_trait_rows()
     ptitle = Anchor("edit.traits.%s" % self.profile.current.profile, "Traits")
     self.body.appendChild(SectionTitle(ptitle))
     # self.body.appendChild(SectionTitle('Traits'))
     if len(rows):
         self.body.appendChild(TraitTable(rows, bgcolor="IndianRed1"))
     vtitle = Anchor("edit.variables.%s" % self.profile.current.profile, "Variables")
     self.body.appendChild(SectionTitle(vtitle))
     erows = self.profile._env.get_rows()
     if len(erows):
         self.body.appendChild(PVarTable(erows, bgcolor="MistyRose2"))
     etitle = Anchor("edit.families.%s" % self.profile.current.profile, "Families")
     self.body.appendChild(SectionTitle(etitle))
     families = self.profile.get_families()
     flist = UnorderedList()
     for f in families:
         flist.appendChild(ListItem(f))
     self.body.appendChild(flist)
示例#9
0
 def set_trait(self, trait):
     self.clear_body()
     self.trait.set_trait(trait)
     title = SimpleTitleElement('Trait: %s' % trait, bgcolor='IndianRed', width='100%')
     self.body.appendChild(title)
     self.body.appendChild(HR())
     plist = UnorderedList()
     parents = self.trait.parents(trait=trait)
     parent_section = SectionTitle('Parents')
     parent_section.create_rightside_table()
     parent_section.append_rightside_anchor(Anchor('hello.there.dude', 'edit'))
     parent_section.append_rightside_anchor(Anchor('hello.there.dudee', 'edit2'))
     self.body.appendChild(parent_section)
     for parent in parents:
         pp = Anchor('show.parent.%s' % parent, parent)
         plist.appendChild(ListItem(pp))
     self.body.appendChild(plist)
     #ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages')
     ptitle = SectionTitle('Packages')
     ptitle_anchor = Anchor('new.package.%s' % trait, '(new)')
     td = TD()
     td.appendChild(ptitle_anchor)
     ptitle.row.appendChild(td)
     self.body.appendChild(ptitle)
     rows = self.trait.packages(trait=trait, action=True)
     self.body.appendChild(PackageTable(rows, bgcolor='SkyBlue3'))
     ttitle = Anchor('edit.templates.%s' % trait, 'Templates')
     self.body.appendChild(SectionTitle(ttitle))
     rows = self.trait.templates(trait=trait, fields=['package', 'template', 'templatefile'])
     if len(rows):
         self.body.appendChild(TemplateTable(rows, bgcolor='DarkSeaGreen3'))
     self.body.appendChild(SectionTitle('Variables', href='foo.var.ick'))
     if len(self.trait.environ.keys()):
         env = TraitEnvTable(trait, self.trait.environ, bgcolor='MistyRose3')
         self.body.appendChild(env)
     self.body.appendChild(SectionTitle('Scripts'))
     slist = UnorderedList()
     for row in self.trait._scripts.scripts(trait=trait):
         script  = row.script
         p = Paragraph()
         sa = Anchor('show.script.%s' % script, script)
         ea = Anchor('edit.script.%s' % script, '  (edit)')
         p.appendChild(sa)
         p.appendChild(ea)
         slist.appendChild(ListItem(p))
     self.body.appendChild(slist)
示例#10
0
 def set_trait(self, trait):
     self.clear_body()
     self.trait.set_trait(trait)
     title = SimpleTitleElement("Trait: %s" % trait, bgcolor="IndianRed", width="100%")
     self.body.appendChild(title)
     self.body.appendChild(HR())
     plist = UnorderedList()
     parents = self.trait.parents(trait=trait)
     parent_section = SectionTitle("Parents")
     parent_section.create_rightside_table()
     parent_section.append_rightside_anchor(Anchor("hello.there.dude", "edit"))
     parent_section.append_rightside_anchor(Anchor("hello.there.dudee", "edit2"))
     self.body.appendChild(parent_section)
     for parent in parents:
         pp = Anchor("show.parent.%s" % parent, parent)
         plist.appendChild(ListItem(pp))
     self.body.appendChild(plist)
     # ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages')
     ptitle = SectionTitle("Packages")
     ptitle_anchor = Anchor("new.package.%s" % trait, "(new)")
     td = TD()
     td.appendChild(ptitle_anchor)
     ptitle.row.appendChild(td)
     self.body.appendChild(ptitle)
     rows = self.trait.packages(trait=trait, action=True)
     self.body.appendChild(PackageTable(rows, bgcolor="SkyBlue3"))
     ttitle = Anchor("edit.templates.%s" % trait, "Templates")
     self.body.appendChild(SectionTitle(ttitle))
     rows = self.trait.templates(trait=trait, fields=["package", "template", "templatefile"])
     if len(rows):
         self.body.appendChild(TemplateTable(rows, bgcolor="DarkSeaGreen3"))
     self.body.appendChild(SectionTitle("Variables", href="foo.var.ick"))
     if len(self.trait.environ.keys()):
         env = TraitEnvTable(trait, self.trait.environ, bgcolor="MistyRose3")
         self.body.appendChild(env)
     self.body.appendChild(SectionTitle("Scripts"))
     slist = UnorderedList()
     for row in self.trait._scripts.scripts(trait=trait):
         script = row.script
         sa = Anchor("show.script.%s" % script, script)
         slist.appendChild(ListItem(sa))
     self.body.appendChild(slist)