當前位置: 首頁>>代碼示例>>Python>>正文


Python base.BaseElement類代碼示例

本文整理匯總了Python中useless.xmlgen.base.BaseElement的典型用法代碼示例。如果您正苦於以下問題:Python BaseElement類的具體用法?Python BaseElement怎麽用?Python BaseElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BaseElement類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _make_table

 def _make_table(self, context, fields, rows, **atts):
     table = BaseElement("table", bgcolor="MediumOrchid3", **atts)
     table.context = context
     self._add_table_header(table, fields + ["command"])
     for row in rows:
         self._add_table_row(table, fields, row)
     return table
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:7,代碼來源:main.py

示例2: __init__

 def __init__(self, troubleid, info):
     BaseElement.__init__(self, 'p')
     self.created = TextElement('h4', 'Created: %s' % info['posted'])
     self.appendChild(self.created)
     p = BaseElement('p')
     refresh = Anchor('refresh.page.%d' % troubleid, 'refresh')
     p.appendChild(refresh)
     self.appendChild(p)
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:8,代碼來源:xmlgen.py

示例3: _add_table_header

 def _add_table_header(self, table, fields, **atts):
     th = BaseElement('th', **atts)
     trow = TR()
     th.appendChild(trow)
     for field in fields:
         trow.appendChild(TxtTD(Bold(field)))
     table.appendChild(th)
     table.header = th
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:8,代碼來源:xmlgen.py

示例4: __init__

 def __init__(self, rows, **atts):
     BaseElement.__init__(self, 'table', **atts)
     for row in rows:
         trow = TR()
         p = TxtTD(row.package)
         trow.appendChild(p)
         a = TxtTD(row.action)
         trow.appendChild(a)
         self.appendChild(trow)
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:9,代碼來源:xmlgen.py

示例5: __init__

 def __init__(self, rows, **atts):
     BaseElement.__init__(self, "table", **atts)
     hrow = TR()
     hrow.appendChild(TxtTD(Bold("Trait")))
     hrow.appendChild(TxtTD(Bold("Order")))
     self.appendChild(hrow)
     for row in rows:
         trow = TR()
         trow.appendChild(TxtTD(row.trait))
         trow.appendChild(TxtTD(row.ord))
         self.appendChild(trow)
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:11,代碼來源:main.py

示例6: append_row

 def append_row(self, name, value):
     tr = BaseElement('tr')
     self.appendChild(tr)
     ttd = BaseElement('td')
     vtd = BaseElement('td')
     ttd.appendChild(Bold(name))
     vtd.appendChild(TextElement('p', value))
     tr.appendChild(ttd)
     tr.appendChild(vtd)
     row = self.firstChild
     row.setAttribute('bgcolor', 'cornsilk')
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:11,代碼來源:xmlgen.py

示例7: __init__

 def __init__(self, clientid, section, text):
     BaseElement.__init__(self, 'h4')
     node = Text()
     node.data = text
     self.appendChild(node)
     p = BaseElement('p')
     self.new = Anchor('new.%s.%s' % (section, clientid), 'new')
     self.edit = Anchor('edit.%s.%s' % (section, clientid), 'edit')
     p.appendChild(self.new)
     p.appendChild(BaseElement('br'))
     p.appendChild(self.edit)
     self.appendChild(p)
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:12,代碼來源:xmlgen.py

示例8: set_machine

 def set_machine(self, machine):
     self.machine.set_machine(machine)
     self.clear_body()
     title = SimpleTitleElement('Machine:  %s' % machine, bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     mtable = BaseElement('table')
     for k,v in self.machine.current.items():
         trow = TR()
         trow.appendChild(TxtTD(Bold(k)))
         trow.appendChild(TxtTD(v))
         mtable.appendChild(trow)
     self.body.appendChild(mtable)
     self.body.appendChild(SectionTitle('Machine Type'))
     self.body.appendChild(SectionTitle('Kernel'))
     self.body.appendChild(SectionTitle('Profile'))
     self.body.appendChild(SectionTitle('Filesystem'))
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:17,代碼來源:xmlgen.py

示例9: set_machine

 def set_machine(self, machine):
     self.machine.set_machine(machine)
     self.clear_body()
     title = SimpleTitleElement("Machine:  %s" % machine, bgcolor="IndianRed", width="100%")
     self.body.appendChild(title)
     mtable = BaseElement("table")
     for k, v in self.machine.current.items():
         trow = TR()
         trow.appendChild(TxtTD(Bold(k)))
         trow.appendChild(TxtTD(v))
         mtable.appendChild(trow)
     self.body.appendChild(mtable)
     newanchor = Anchor("new.machine.foo", "new")
     editanchor = Anchor("edit.machine.%s" % machine, "edit")
     self.body.appendChild(HR())
     self.body.appendChild(editanchor)
     self.body.appendChild(BR())
     self.body.appendChild(newanchor)
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:18,代碼來源:main.py

示例10: set_machine

 def set_machine(self, machine):
     self.machine.set_machine(machine)
     self.clear_body()
     title = SimpleTitleElement('Machine:  %s' % machine, bgcolor='IndianRed',
                                width='100%')
     self.body.appendChild(title)
     mtable = BaseElement('table')
     for k,v in self.machine.current.items():
         trow = TR()
         trow.appendChild(TxtTD(Bold(k)))
         trow.appendChild(TxtTD(v))
         mtable.appendChild(trow)
     self.body.appendChild(mtable)
     newanchor = Anchor('new.machine.foo', 'new')
     editanchor = Anchor('edit.machine.%s' % machine, 'edit')
     self.body.appendChild(HR())
     self.body.appendChild(editanchor)
     self.body.appendChild(BR())
     self.body.appendChild(newanchor)
開發者ID:BackupTheBerlios,項目名稱:paella-svn,代碼行數:19,代碼來源:xmlgen.py

示例11: setID

 def setID(self, clientid):
     cdata = self.manager.getClientInfo(clientid)
     cdata['addresses'].set_refobject('address', AddressRecord)
     self.current = clientid
     self.clear_body()
     #make header
     #self.header = ClientHeaderElement(cdata['client'])
     self.header = ClientTitleElement(cdata['client'])
     self.body.appendChild(self.header)
     #make main table
     self.mtable = BaseElement('table')
     self.mtable.appendChild(BaseElement('tr'))
     self.body.appendChild(self.mtable)
     #append contacts header
     conheader = ClientSectionHeader(self.current, 'contact', 'Contacts:')
     self.mtable.firstChild.appendChild(TextElement('td', conheader))
     self.contacts = ContactDoc(self.app)
     self.mtable.firstChild.appendChild(TextElement('td', self.contacts))
     #append locations header
     row = BaseElement('tr')
     locheader = ClientSectionHeader(self.current, 'location', 'Locations:')
     row.appendChild(TextElement('td', locheader))
     self.locations = LocationDoc(self.app)
     self.mtable.appendChild(row)
     row.appendChild(TextElement('td', self.locations))
     #insert the contacts, locations and tickets
     self.contacts.set_records(cdata['contacts'], action=None)
     self.locations.set_records(cdata['locations'], action=None)
     for node in self.contacts.records.values():
         node.setAttribute('bgcolor', 'DarkSeaGreen3')
     for node in self.locations.records.values():
         node.setAttribute('bgcolor', 'DarkSeaGreen3')
     self.records = cdata
     #append tag data
     #check for tag data
     tags = self.manager.getTags(clientid)
     row = BaseElement('tr')
     tagdoc = ClientTagTableElement(clientid, tags)
     row.appendChild(tagdoc)
     self.mtable.appendChild(row)
     newtrouble = Anchor('new.trouble.%s' % clientid, 'new trouble')
     
     self.body.appendChild(newtrouble)
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:43,代碼來源:xmlgen.py

示例12: __init__

 def __init__(self, record, **atts):
     BaseElement.__init__(self, 'p', **atts)
     node = Text()
     node.data = self.makeParagraph(record)
     self.appendChild(node)
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:5,代碼來源:xmlgen.py

示例13: _subjectdata

    def _subjectdata(self, subject, action):
        td = BaseElement("td")

        font = BaseElement("font")
        font.setAttribute("color", "gold")
        element = TextElement("b", subject)
        font.appendChild(element)
        td.appendChild(font)

        font = BaseElement("font")
        font.setAttribute("color", "yellow")
        element = Text()
        font.appendChild(element)
        element.data = "(%s)" % action
        td.appendChild(font)
        return td
開發者ID:BackupTheBerlios,項目名稱:konsultant-svn,代碼行數:16,代碼來源:xmlgen.py


注:本文中的useless.xmlgen.base.BaseElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。