summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-09-13 18:16:17 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-09-13 18:16:17 +0300
commit5543852d5492a8a15c35fe1790f34f116b3af684 (patch)
treeb530e4b1e6b5afea3cc7f0a296e087e3fba97c65
parentcf358655c079fb13ecf0f28e212f1ba20d443f61 (diff)
Examples: Add description to elm web exceptions, trivial updates to test
-rw-r--r--efl/elementary/web.pyx18
-rw-r--r--examples/elementary/test_web.py13
2 files changed, 15 insertions, 16 deletions
diff --git a/efl/elementary/web.pyx b/efl/elementary/web.pyx
index c33b677..16ff955 100644
--- a/efl/elementary/web.pyx
+++ b/efl/elementary/web.pyx
@@ -508,7 +508,7 @@ cdef class Web(Object):
508 def __set__(self, url): 508 def __set__(self, url):
509 if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url) 509 if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
510 if not elm_web_url_set(self.obj, url): 510 if not elm_web_url_set(self.obj, url):
511 raise RuntimeWarning 511 raise RuntimeWarning("Cannot set url")
512 512
513 def __get__(self): 513 def __get__(self):
514 return _ctouni(elm_web_url_get(self.obj)) 514 return _ctouni(elm_web_url_get(self.obj))
@@ -516,7 +516,7 @@ cdef class Web(Object):
516 def url_set(self, url): 516 def url_set(self, url):
517 if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url) 517 if isinstance(url, unicode): url = PyUnicode_AsUTF8String(url)
518 if not elm_web_url_set(self.obj, url): 518 if not elm_web_url_set(self.obj, url):
519 raise RuntimeWarning 519 raise RuntimeWarning("Cannot set url")
520 520
521 def url_get(self): 521 def url_get(self):
522 return _ctouni(elm_web_url_get(self.obj)) 522 return _ctouni(elm_web_url_get(self.obj))
@@ -670,7 +670,7 @@ cdef class Web(Object):
670 670
671 """ 671 """
672 if not elm_web_text_matches_unmark_all(self.obj): 672 if not elm_web_text_matches_unmark_all(self.obj):
673 raise RuntimeWarning 673 raise RuntimeWarning("Cannot clear marked matches")
674 674
675 property text_matches_highlight: 675 property text_matches_highlight:
676 """ 676 """
@@ -685,7 +685,7 @@ cdef class Web(Object):
685 """ 685 """
686 def __set__(self, bint highlight): 686 def __set__(self, bint highlight):
687 if not elm_web_text_matches_highlight_set(self.obj, highlight): 687 if not elm_web_text_matches_highlight_set(self.obj, highlight):
688 raise RuntimeWarning 688 raise RuntimeWarning("Cannot set matched marks highlighting")
689 689
690 def __get__(self): 690 def __get__(self):
691 return bool(elm_web_text_matches_highlight_get(self.obj)) 691 return bool(elm_web_text_matches_highlight_get(self.obj))
@@ -719,7 +719,7 @@ cdef class Web(Object):
719 719
720 """ 720 """
721 if not elm_web_stop(self.obj): 721 if not elm_web_stop(self.obj):
722 raise RuntimeWarning 722 raise RuntimeWarning("Cannot stop")
723 723
724 def reload(self): 724 def reload(self):
725 """ 725 """
@@ -730,7 +730,7 @@ cdef class Web(Object):
730 730
731 """ 731 """
732 if not elm_web_reload(self.obj): 732 if not elm_web_reload(self.obj):
733 raise RuntimeWarning 733 raise RuntimeWarning("Cannot reload")
734 734
735 def reload_full(self): 735 def reload_full(self):
736 """ 736 """
@@ -741,7 +741,7 @@ cdef class Web(Object):
741 741
742 """ 742 """
743 if not elm_web_reload_full(self.obj): 743 if not elm_web_reload_full(self.obj):
744 raise RuntimeWarning 744 raise RuntimeWarning("Cannot reload without caches")
745 745
746 def back(self): 746 def back(self):
747 """ 747 """
@@ -759,7 +759,7 @@ cdef class Web(Object):
759 759
760 """ 760 """
761 if not elm_web_back(self.obj): 761 if not elm_web_back(self.obj):
762 raise RuntimeWarning 762 raise RuntimeWarning("Cannot go back")
763 763
764 def forward(self): 764 def forward(self):
765 """ 765 """
@@ -777,7 +777,7 @@ cdef class Web(Object):
777 777
778 """ 778 """
779 if not elm_web_forward(self.obj): 779 if not elm_web_forward(self.obj):
780 raise RuntimeWarning 780 raise RuntimeWarning("Cannot go forward")
781 781
782 def navigate(self, int steps): 782 def navigate(self, int steps):
783 """ 783 """
diff --git a/examples/elementary/test_web.py b/examples/elementary/test_web.py
index 5c220fe..98ec635 100644
--- a/examples/elementary/test_web.py
+++ b/examples/elementary/test_web.py
@@ -2,7 +2,6 @@
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL 4from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
5from efl import ecore
6from efl import elementary 5from efl import elementary
7from efl.elementary.window import StandardWindow 6from efl.elementary.window import StandardWindow
8from efl.elementary.box import Box 7from efl.elementary.box import Box
@@ -133,14 +132,14 @@ def web_clicked(obj):
133 en.show() 132 en.show()
134 133
135 # Sync navigation entry and current URI 134 # Sync navigation entry and current URI
136 def do_change_uri(en): 135 def do_change_url(en):
137 web.uri = en.entry 136 web.url = en.entry
138 137
139 def did_change_uri(web, uri, en): 138 def did_change_url(web, url, en):
140 en.entry = uri 139 en.entry = url
141 140
142 en.callback_activated_add(do_change_uri) 141 en.callback_activated_add(do_change_url)
143 web.callback_uri_changed_add(did_change_uri, en) 142 web.callback_url_changed_add(did_change_url, en)
144 143
145 # Sync title 144 # Sync title
146 def did_change_title(web, title, win): 145 def did_change_title(web, title, win):