mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-03-02 05:03:53 +08:00
* add openpilot prefix to imports
* more
* more
* fix docs
* fix linter
* bump submodules
* fix patched tests
* update dynamic imports
* debug
* Revert "debug"
This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.
* fix pm test
old-commit-hash: a9626f95b6
21 lines
486 B
Python
21 lines
486 B
Python
import os
|
|
from cffi import FFI
|
|
|
|
import sip # pylint: disable=import-error
|
|
|
|
from openpilot.common.ffi_wrapper import suffix
|
|
from openpilot.common.basedir import BASEDIR
|
|
|
|
|
|
def get_ffi():
|
|
lib = os.path.join(BASEDIR, "selfdrive", "ui", "qt", "libpython_helpers" + suffix())
|
|
|
|
ffi = FFI()
|
|
ffi.cdef("void set_main_window(void *w);")
|
|
return ffi, ffi.dlopen(lib)
|
|
|
|
|
|
def set_main_window(widget):
|
|
ffi, lib = get_ffi()
|
|
lib.set_main_window(ffi.cast('void*', sip.unwrapinstance(widget)))
|