def _exists(guid): """Checks if an element with the given guid exists.""" template = _resources.get_data(__name__, 'js/_proxy.js') if six.PY3: # pkgutil.get_data returns bytes, but we want a str. template = template.decode('utf8') return _call_js_function(template, guid, {'method': 'exists'}, False)
def _proxy(guid, msg): """Makes a proxy call on an element.""" template = _resources.get_data(__name__, 'js/_proxy.js') if six.PY3: # pkgutil.get_data returns bytes, but we want a str. template = template.decode('utf8') return _call_js_function(template, guid, msg)
def _utils_url(): """Return the url to the utils script.""" global _utils_ref if not _utils_ref: src = _resources.get_data(__name__, 'js/_html.js') if six.PY3: # pkgutil.get_data returns bytes, but we want a str. src = src.decode('utf8') _utils_ref = _provide.create(content=src, extension='js') return _utils_ref.url
def _exists(guid): """Checks if an element with the given guid exists.""" template = _resources.get_data(__name__, 'js/_proxy.js') return _call_js_function(template, guid, {'method': 'exists'}, False)
def _proxy(guid, msg): """Makes a proxy call on an element.""" template = _resources.get_data(__name__, 'js/_proxy.js') return _call_js_function(template, guid, msg)
def _repr_html_(self): """Converts element to HTML string.""" self._could_exist = True view = _ElementView(self) template = _resources.get_data(__name__, 'templates/_element.mustache') return pystache.render(template, view)