params: remove params_pxd.pxd (#22723)
parent
257d2b447d
commit
92682cb8e0
|
@ -1,28 +0,0 @@
|
|||
from libcpp.string cimport string
|
||||
from libcpp cimport bool
|
||||
|
||||
cdef extern from "selfdrive/common/params.cc":
|
||||
pass
|
||||
|
||||
cdef extern from "selfdrive/common/util.cc":
|
||||
pass
|
||||
|
||||
cdef extern from "selfdrive/common/params.h":
|
||||
cpdef enum ParamKeyType:
|
||||
PERSISTENT
|
||||
CLEAR_ON_MANAGER_START
|
||||
CLEAR_ON_PANDA_DISCONNECT
|
||||
CLEAR_ON_IGNITION_ON
|
||||
CLEAR_ON_IGNITION_OFF
|
||||
ALL
|
||||
|
||||
cdef cppclass Params:
|
||||
Params() nogil
|
||||
Params(string) nogil
|
||||
string get(string, bool) nogil
|
||||
bool getBool(string) nogil
|
||||
int remove(string) nogil
|
||||
int put(string, string) nogil
|
||||
int putBool(string, bool) nogil
|
||||
bool checkKey(string) nogil
|
||||
void clearAll(ParamKeyType)
|
|
@ -2,27 +2,31 @@
|
|||
# cython: language_level = 3
|
||||
from libcpp cimport bool
|
||||
from libcpp.string cimport string
|
||||
from common.params_pxd cimport Params as c_Params, ParamKeyType as c_ParamKeyType
|
||||
|
||||
import os
|
||||
import threading
|
||||
from common.basedir import BASEDIR
|
||||
|
||||
cdef extern from "selfdrive/common/params.h":
|
||||
cpdef enum ParamKeyType:
|
||||
PERSISTENT
|
||||
CLEAR_ON_MANAGER_START
|
||||
CLEAR_ON_PANDA_DISCONNECT
|
||||
CLEAR_ON_IGNITION_ON
|
||||
CLEAR_ON_IGNITION_OFF
|
||||
ALL
|
||||
|
||||
cdef cppclass c_Params "Params":
|
||||
c_Params() nogil
|
||||
c_Params(string) nogil
|
||||
string get(string, bool) nogil
|
||||
bool getBool(string) nogil
|
||||
int remove(string) nogil
|
||||
int put(string, string) nogil
|
||||
int putBool(string, bool) nogil
|
||||
bool checkKey(string) nogil
|
||||
void clearAll(ParamKeyType)
|
||||
|
||||
cdef class ParamKeyType:
|
||||
PERSISTENT = c_ParamKeyType.PERSISTENT
|
||||
CLEAR_ON_MANAGER_START = c_ParamKeyType.CLEAR_ON_MANAGER_START
|
||||
CLEAR_ON_PANDA_DISCONNECT = c_ParamKeyType.CLEAR_ON_PANDA_DISCONNECT
|
||||
CLEAR_ON_IGNITION_ON = c_ParamKeyType.CLEAR_ON_IGNITION_ON
|
||||
CLEAR_ON_IGNITION_OFF = c_ParamKeyType.CLEAR_ON_IGNITION_OFF
|
||||
ALL = c_ParamKeyType.ALL
|
||||
|
||||
def ensure_bytes(v):
|
||||
if isinstance(v, str):
|
||||
return v.encode()
|
||||
else:
|
||||
return v
|
||||
|
||||
return v.encode() if isinstance(v, str) else v;
|
||||
|
||||
class UnknownKeyName(Exception):
|
||||
pass
|
||||
|
|
|
@ -26,7 +26,6 @@ common/file_helpers.py
|
|||
common/logging_extra.py
|
||||
common/numpy_fast.py
|
||||
common/params.py
|
||||
common/params_pxd.pxd
|
||||
common/params_pyx.pyx
|
||||
common/xattr.py
|
||||
common/profiler.py
|
||||
|
|
Loading…
Reference in New Issue