Created
February 18, 2015 15:56
-
-
Save jsbain/43b74fe87ad7cb0c6998 to your computer and use it in GitHub Desktop.
world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class world (object): | |
def webview_should_start_load(self,webview, url, nav_type): | |
if url.startswith('world://'): | |
print 'country selected:', urlparse.unquote(urlparse.urlparse(url).netloc) | |
return False | |
else: | |
return True | |
import ui,os | |
w=ui.WebView() | |
w.delegate=world() | |
p=os.path.abspath('world/index.html') | |
w.load_url(p) | |
w.present('panel') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment