예제 #1
0
파일: pydom.py 프로젝트: 2014c2g10/2014c2
def createCSSClass(csstext):
    """ Create style element and attach css text """

    _style=doc.createElement('style')
    _style.type='text/css'
    _style.innerHTML = csstext
    doc.get(tag='head')[0].appendChild(_style)
예제 #2
0
 def draw(self):
     div = doc.createElement('div')
     div.style.width = self.width
     div.style.height = self.height
     doc['me'].appendChild(div)
     myechart = window.echarts.init(div)
     myechart.setOption(self.options)
예제 #3
0
파일: pydom.py 프로젝트: mdecourse/2014c2
def createCSSClass(csstext):
    """ Create style element and attach css text """

    _style = doc.createElement('style')
    _style.type = 'text/css'
    _style.innerHTML = csstext
    doc.get(tag='head')[0].appendChild(_style)
예제 #4
0
파일: pydom.py 프로젝트: 2014c2g10/2014c2
  def _toDOM(self, s):
      "takes an HTML string and returns a DOM representation"

      if isinstance(s,Node):
         return s

      #assert isinstance(s, str), "pydom.py:_toDOM s should be a string"

      #print("in _toDOM")
      #print(s)
      _dom=doc.createElement('div')
      _dom.innerHTML=s
      #return JSObject({'elt':_dom.elt.firstChild})
      return _dom.elt.firstChild
예제 #5
0
파일: pydom.py 프로젝트: mdecourse/2014c2
    def _toDOM(self, s):
        "takes an HTML string and returns a DOM representation"

        if isinstance(s, Node):
            return s

        #assert isinstance(s, str), "pydom.py:_toDOM s should be a string"

        #print("in _toDOM")
        #print(s)
        _dom = doc.createElement('div')
        _dom.innerHTML = s
        #return JSObject({'elt':_dom.elt.firstChild})
        return _dom.elt.firstChild