mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-05 00:05:57 +08:00
params: remove persistent params (#21975)
* cleanup constructors * remove persistent_param * remove test_persist_params_put_and_get old-commit-hash: 3b752a307f167ad536eb53cceac76f7034f2faf9
This commit is contained in:
@@ -17,7 +17,7 @@ cdef extern from "selfdrive/common/params.h":
|
||||
ALL
|
||||
|
||||
cdef cppclass Params:
|
||||
Params(bool) nogil
|
||||
Params() nogil
|
||||
Params(string) nogil
|
||||
string get(string, bool) nogil
|
||||
bool getBool(string) nogil
|
||||
|
||||
@@ -30,11 +30,11 @@ class UnknownKeyName(Exception):
|
||||
cdef class Params:
|
||||
cdef c_Params* p
|
||||
|
||||
def __cinit__(self, d=None, bool persistent_params=False):
|
||||
def __cinit__(self, d=None):
|
||||
cdef string path
|
||||
if d is None:
|
||||
with nogil:
|
||||
self.p = new c_Params(persistent_params)
|
||||
self.p = new c_Params()
|
||||
else:
|
||||
path = <string>d.encode()
|
||||
with nogil:
|
||||
|
||||
@@ -21,11 +21,6 @@ class TestParams(unittest.TestCase):
|
||||
self.params.put("DongleId", "cb38263377b873ee")
|
||||
assert self.params.get("DongleId") == b"cb38263377b873ee"
|
||||
|
||||
def test_persist_params_put_and_get(self):
|
||||
p = Params(persistent_params=True)
|
||||
p.put("DongleId", "cb38263377b873ee")
|
||||
assert p.get("DongleId") == b"cb38263377b873ee"
|
||||
|
||||
def test_params_non_ascii(self):
|
||||
st = b"\xe1\x90\xff"
|
||||
self.params.put("CarParams", st)
|
||||
|
||||
Reference in New Issue
Block a user