How to use the thug.DOM.W3C.HTML.bool_property.bool_property 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 / HTMLInputElement.py View on Github external
import six

from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
from .form_property import form_property


class HTMLInputElement(HTMLElement):
    accept         = attr_property("accept")
    accessKey      = attr_property("accesskey")
    align          = attr_property("align")
    alt            = attr_property("alt")
    checked        = bool_property("checked")
    defaultChecked = bool_property("checked")
    defaultValue   = bool_property("value")
    disabled       = bool_property("disabled")
    form           = form_property()
    maxLength      = attr_property("maxlength", int, default = six.MAXSIZE)
    name           = attr_property("name")
    readOnly       = bool_property("readonly")
    size           = attr_property("size", int)
    src            = attr_property("src")
    tabIndex       = attr_property("tabindex", int)
    type           = attr_property("type", default = "text")
    useMap         = attr_property("usermap")
    _value         = attr_property("value")

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLInputElement.py View on Github external
from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
from .form_property import form_property


class HTMLInputElement(HTMLElement):
    accept         = attr_property("accept")
    accessKey      = attr_property("accesskey")
    align          = attr_property("align")
    alt            = attr_property("alt")
    checked        = bool_property("checked")
    defaultChecked = bool_property("checked")
    defaultValue   = bool_property("value")
    disabled       = bool_property("disabled")
    form           = form_property()
    maxLength      = attr_property("maxlength", int, default = six.MAXSIZE)
    name           = attr_property("name")
    readOnly       = bool_property("readonly")
    size           = attr_property("size", int)
    src            = attr_property("src")
    tabIndex       = attr_property("tabindex", int)
    type           = attr_property("type", default = "text")
    useMap         = attr_property("usermap")
    _value         = attr_property("value")

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

    def getValue(self):
        return self._value
github buffer / thug / thug / DOM / W3C / HTML / HTMLOListElement.py View on Github external
#!/usr/bin/env python

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


class HTMLOListElement(HTMLElement):
    compact = bool_property("compact")
    start   = attr_property("start", int)
    type    = attr_property("type")

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

from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
from .form_property import form_property


class HTMLInputElement(HTMLElement):
    accept         = attr_property("accept")
    accessKey      = attr_property("accesskey")
    align          = attr_property("align")
    alt            = attr_property("alt")
    checked        = bool_property("checked")
    defaultChecked = bool_property("checked")
    defaultValue   = bool_property("value")
    disabled       = bool_property("disabled")
    form           = form_property()
    maxLength      = attr_property("maxlength", int, default = six.MAXSIZE)
    name           = attr_property("name")
    readOnly       = bool_property("readonly")
    size           = attr_property("size", int)
    src            = attr_property("src")
    tabIndex       = attr_property("tabindex", int)
    type           = attr_property("type", default = "text")
    useMap         = attr_property("usermap")
    _value         = attr_property("value")

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

    def getValue(self):
github buffer / thug / thug / DOM / W3C / HTML / HTMLTableCellElement.py View on Github external
from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property


class HTMLTableCellElement(HTMLElement):
    abbr    = attr_property("abbr")
    align   = attr_property("align")
    axis    = attr_property("axis")
    bgColor = attr_property("bgcolor")
    ch      = attr_property("char")
    chOff   = attr_property("charoff")
    colSpan = attr_property("colspan", int)
    headers = attr_property("headers")
    height  = attr_property("height")
    noWrap  = bool_property("nowrap")
    rowSpan = attr_property("rowspan", int)
    scope   = attr_property("scope")
    vAlign  = attr_property("valign")
    width   = attr_property("width")

    def __init__(self, doc, tag, index = 0):
        HTMLElement.__init__(self, doc, tag)
        self._cellIndex = index

    @property
    def cellIndex(self):
        return self._cellIndex
github buffer / thug / thug / DOM / W3C / HTML / HTMLInputElement.py View on Github external
from .form_property import form_property


class HTMLInputElement(HTMLElement):
    accept         = attr_property("accept")
    accessKey      = attr_property("accesskey")
    align          = attr_property("align")
    alt            = attr_property("alt")
    checked        = bool_property("checked")
    defaultChecked = bool_property("checked")
    defaultValue   = bool_property("value")
    disabled       = bool_property("disabled")
    form           = form_property()
    maxLength      = attr_property("maxlength", int, default = six.MAXSIZE)
    name           = attr_property("name")
    readOnly       = bool_property("readonly")
    size           = attr_property("size", int)
    src            = attr_property("src")
    tabIndex       = attr_property("tabindex", int)
    type           = attr_property("type", default = "text")
    useMap         = attr_property("usermap")
    _value         = attr_property("value")

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

    def getValue(self):
        return self._value

    def setValue(self, value):
        self._value = value
github buffer / thug / thug / DOM / W3C / HTML / HTMLUListElement.py View on Github external
#!/usr/bin/env python

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


class HTMLUListElement(HTMLElement):
    compact = bool_property("compact")
    type    = attr_property("type")

    def __init__(self, doc, tag):
        HTMLElement.__init__(self, doc, tag)
github buffer / thug / thug / DOM / W3C / HTML / HTMLScriptElement.py View on Github external
from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
from .text_property import text_property

log = logging.getLogger("Thug")


class HTMLScriptElement(HTMLElement):
    _async  = bool_property("async", readonly = True, novalue = True)
    text    = text_property()
    htmlFor = None
    event   = None
    charset = attr_property("charset", default = "")
    defer   = bool_property("defer", readonly = True, novalue = True)
    _src    = attr_property("src", default = "")
    type    = attr_property("type")

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

    def __getattr__(self, name):
        if name in ("async", ):
            return self._async

        raise AttributeError

    def get_src(self):
        return self._src

    def set_src(self, src):
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"

    @property
    def length(self):
        return len(self.options)
github buffer / thug / thug / DOM / W3C / HTML / HTMLInputElement.py View on Github external
#!/usr/bin/env python

import six

from .HTMLElement import HTMLElement
from .attr_property import attr_property
from .bool_property import bool_property
from .form_property import form_property


class HTMLInputElement(HTMLElement):
    accept         = attr_property("accept")
    accessKey      = attr_property("accesskey")
    align          = attr_property("align")
    alt            = attr_property("alt")
    checked        = bool_property("checked")
    defaultChecked = bool_property("checked")
    defaultValue   = bool_property("value")
    disabled       = bool_property("disabled")
    form           = form_property()
    maxLength      = attr_property("maxlength", int, default = six.MAXSIZE)
    name           = attr_property("name")
    readOnly       = bool_property("readonly")
    size           = attr_property("size", int)
    src            = attr_property("src")
    tabIndex       = attr_property("tabindex", int)
    type           = attr_property("type", default = "text")
    useMap         = attr_property("usermap")
    _value         = attr_property("value")

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