How to use the thug.DOM.W3C.HTML.HTMLElement.HTMLElement function in thug

To help you get started, we’ve selected a few thug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buffer / thug / thug / DOM / W3C / HTML / HTMLSelectElement.py View on Github external
#!/usr/bin/env python

from thug.DOM.W3C.Core.DOMException import DOMException

from .HTMLElement import HTMLElement
from .HTMLOptionsCollection import HTMLOptionsCollection
from .attr_property import attr_property
from .bool_property import bool_property


class HTMLSelectElement(HTMLElement):
    selectedIndex = 0
    value         = None
    disabled      = bool_property("disabled", readonly = False, novalue = False)
    multiple      = bool_property("multiple")
    name          = attr_property("name")
    size          = attr_property("size", int)
    tabIndex      = attr_property("tabindex", int)

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
        self._options = [t for t in self.tag.find_all("option")]

    @property
    def type(self):
        return "select-multiple" if self.multiple else "select-one"
github buffer / thug / thug / DOM / W3C / HTML / HTMLMenuElement.py View on Github external
def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLDivElement.py View on Github external
def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLFrameSetElement.py View on Github external
def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLHtmlElement.py View on Github external
#!/usr/bin/env python

from .HTMLElement import HTMLElement
from .attr_property import attr_property


class HTMLHtmlElement(HTMLElement):
    version = attr_property("version")

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLPreElement.py View on Github external
def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLTableElement.py View on Github external
import logging
import bs4

from thug.DOM.W3C.Core.DOMException import DOMException

from .HTMLElement import HTMLElement
from .HTMLCollection import HTMLCollection
from .HTMLTableRowElement import HTMLTableRowElement
from .HTMLTableSectionElement import HTMLTableSectionElement
from .HTMLTableCaptionElement import HTMLTableCaptionElement
from .attr_property import attr_property

log = logging.getLogger("Thug")


class HTMLTableElement(HTMLElement):
    align       = attr_property("align")
    bgColor     = attr_property("bgcolor")
    border      = attr_property("border")
    cellPadding = attr_property("cellpadding")
    cellSpacing = attr_property("cellspacing")
    frame       = attr_property("frame")
    rules       = attr_property("rules")
    summary     = attr_property("summary")
    width       = attr_property("width")

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
        self._caption = None
        self._tHead   = None
        self._tFoot   = None
        self._rows    = HTMLCollection(doc, list())
github buffer / thug / thug / DOM / W3C / HTML / HTMLBaseFontElement.py View on Github external
#!/usr/bin/env python

from .HTMLElement import HTMLElement
from .attr_property import attr_property


class HTMLBaseFontElement(HTMLElement):
    color = attr_property("color")
    face  = attr_property("face")
    size  = attr_property("size", int)

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLAppletElement.py View on Github external
#!/usr/bin/env python

from .HTMLElement import HTMLElement
from .attr_property import attr_property


class HTMLAppletElement(HTMLElement):
    align    = attr_property("align")
    alt      = attr_property("alt")
    archive  = attr_property("archive")
    code     = attr_property("code")
    codeBase = attr_property("codebase")
    height   = attr_property("height")
    hspace   = attr_property("hspace", int)
    name     = attr_property("name")
    object   = attr_property("object")
    vspace   = attr_property("vspace", int)
    width    = attr_property("width")

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)