예제 #1
0
파일: main.py 프로젝트: JdeH/pytigon
    def on_app_chosen(self, app="schdevtools"):
        super().on_app_chosen(app)

        def _create_webview():
            self.create_webview()

        Runnable(_create_webview)()
예제 #2
0
파일: main.py 프로젝트: JdeH/pytigon
    def on_clock(self, dt):
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        result = sock.connect_ex(("127.0.0.1", 8000))
        print("python:pytigon:clock")

        if result == 0:

            def _create_webview():
                self.create_webview()

            Runnable(_create_webview)()

            return False
        else:
            return True
예제 #3
0
파일: main.py 프로젝트: JdeH/pytigon
    def create_webview(self):
        global FRAGMENT
        callback = PytigonWebViewClientCallback(self)
        fragment = PytigonWebViewFragment()
        start_url = "file://" + self.base_path + "/static/android/loader.html"
        fragment.set_callback_info(callback, self.base_path, start_url, self.app)

        fragmentManager = ACTIVITY.getFragmentManager()
        fragmentTransaction = fragmentManager.beginTransaction()
        v = ACTIVITY.getWindow().getDecorView().getRootView()
        v.setId(1234)
        fragmentTransaction.add(1234, fragment, "PytigonWebView")
        fragmentTransaction.addToBackStack("PytigonFrag")
        fragmentTransaction.commit()
        FRAGMENT = True

        def _start_service():
            self.start_service()

        Runnable(_start_service)()
예제 #4
0
def run(f, *args, **kwargs):
    # args/kwargs to runnable was a bug, fixed in master
    Runnable(f)(args, kwargs)