Examples: Add description to elm web exceptions, trivial updates to test
This commit is contained in:
parent
cf358655c0
commit
5543852d54
|
@ -508,7 +508,7 @@ cdef class Web(Object):
|
||||||
def __set__(self, url):
|
def __set__(self, url):
|
||||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||||
if not elm_web_url_set(self.obj, url):
|
if not elm_web_url_set(self.obj, url):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot set url")
|
||||||
|
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return _ctouni(elm_web_url_get(self.obj))
|
return _ctouni(elm_web_url_get(self.obj))
|
||||||
|
@ -516,7 +516,7 @@ cdef class Web(Object):
|
||||||
def url_set(self, url):
|
def url_set(self, url):
|
||||||
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
|
||||||
if not elm_web_url_set(self.obj, url):
|
if not elm_web_url_set(self.obj, url):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot set url")
|
||||||
|
|
||||||
def url_get(self):
|
def url_get(self):
|
||||||
return _ctouni(elm_web_url_get(self.obj))
|
return _ctouni(elm_web_url_get(self.obj))
|
||||||
|
@ -670,7 +670,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_text_matches_unmark_all(self.obj):
|
if not elm_web_text_matches_unmark_all(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot clear marked matches")
|
||||||
|
|
||||||
property text_matches_highlight:
|
property text_matches_highlight:
|
||||||
"""
|
"""
|
||||||
|
@ -685,7 +685,7 @@ cdef class Web(Object):
|
||||||
"""
|
"""
|
||||||
def __set__(self, bint highlight):
|
def __set__(self, bint highlight):
|
||||||
if not elm_web_text_matches_highlight_set(self.obj, highlight):
|
if not elm_web_text_matches_highlight_set(self.obj, highlight):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot set matched marks highlighting")
|
||||||
|
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return bool(elm_web_text_matches_highlight_get(self.obj))
|
return bool(elm_web_text_matches_highlight_get(self.obj))
|
||||||
|
@ -719,7 +719,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_stop(self.obj):
|
if not elm_web_stop(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot stop")
|
||||||
|
|
||||||
def reload(self):
|
def reload(self):
|
||||||
"""
|
"""
|
||||||
|
@ -730,7 +730,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_reload(self.obj):
|
if not elm_web_reload(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot reload")
|
||||||
|
|
||||||
def reload_full(self):
|
def reload_full(self):
|
||||||
"""
|
"""
|
||||||
|
@ -741,7 +741,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_reload_full(self.obj):
|
if not elm_web_reload_full(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot reload without caches")
|
||||||
|
|
||||||
def back(self):
|
def back(self):
|
||||||
"""
|
"""
|
||||||
|
@ -759,7 +759,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_back(self.obj):
|
if not elm_web_back(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot go back")
|
||||||
|
|
||||||
def forward(self):
|
def forward(self):
|
||||||
"""
|
"""
|
||||||
|
@ -777,7 +777,7 @@ cdef class Web(Object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not elm_web_forward(self.obj):
|
if not elm_web_forward(self.obj):
|
||||||
raise RuntimeWarning
|
raise RuntimeWarning("Cannot go forward")
|
||||||
|
|
||||||
def navigate(self, int steps):
|
def navigate(self, int steps):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
|
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
|
||||||
from efl import ecore
|
|
||||||
from efl import elementary
|
from efl import elementary
|
||||||
from efl.elementary.window import StandardWindow
|
from efl.elementary.window import StandardWindow
|
||||||
from efl.elementary.box import Box
|
from efl.elementary.box import Box
|
||||||
|
@ -133,14 +132,14 @@ def web_clicked(obj):
|
||||||
en.show()
|
en.show()
|
||||||
|
|
||||||
# Sync navigation entry and current URI
|
# Sync navigation entry and current URI
|
||||||
def do_change_uri(en):
|
def do_change_url(en):
|
||||||
web.uri = en.entry
|
web.url = en.entry
|
||||||
|
|
||||||
def did_change_uri(web, uri, en):
|
def did_change_url(web, url, en):
|
||||||
en.entry = uri
|
en.entry = url
|
||||||
|
|
||||||
en.callback_activated_add(do_change_uri)
|
en.callback_activated_add(do_change_url)
|
||||||
web.callback_uri_changed_add(did_change_uri, en)
|
web.callback_url_changed_add(did_change_url, en)
|
||||||
|
|
||||||
# Sync title
|
# Sync title
|
||||||
def did_change_title(web, title, win):
|
def did_change_title(web, title, win):
|
||||||
|
|
Loading…
Reference in New Issue