mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
fix params on PC and when reading path from env (#2340)
* fix params when reading path from env * fix pc old-commit-hash: 707a670f42dc87c322c6d27eb147ba260b149e23
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
# distutils: langauge = c++
|
||||
import threading
|
||||
import os
|
||||
# cython: language_level = 3
|
||||
from libcpp cimport bool
|
||||
from libcpp.string cimport string
|
||||
from params_pxd cimport Params as c_Params
|
||||
|
||||
import os
|
||||
import threading
|
||||
from common.basedir import PARAMS
|
||||
|
||||
cdef enum TxType:
|
||||
PERSISTENT = 1
|
||||
CLEAR_ON_MANAGER_START = 2
|
||||
@@ -81,11 +84,11 @@ class UnknownKeyName(Exception):
|
||||
cdef class Params:
|
||||
cdef c_Params* p
|
||||
|
||||
def __cinit__(self, d=None, persistent_params=False):
|
||||
if d is not None:
|
||||
self.p = new c_Params(<string>d.encode())
|
||||
def __cinit__(self, d=PARAMS, bool persistent_params=False):
|
||||
if persistent_params:
|
||||
self.p = new c_Params(True)
|
||||
else:
|
||||
self.p = new c_Params(<bool>persistent_params)
|
||||
self.p = new c_Params(<string>d.encode())
|
||||
|
||||
def __dealloc__(self):
|
||||
del self.p
|
||||
|
||||
Reference in New Issue
Block a user