Cython API: added a function to get the full path to the DMS directory
This commit is contained in:
@ -16,6 +16,7 @@ cdef extern from "obidms.h" nogil:
|
||||
|
||||
struct OBIDMS_t:
|
||||
const_char_p dms_name
|
||||
const_char_p directory_path
|
||||
OBIDMS_infos_p infos
|
||||
|
||||
ctypedef OBIDMS_t* OBIDMS_p
|
||||
|
@ -38,10 +38,12 @@ cdef class DMS(OBIWrapper):
|
||||
cdef inline OBIDMS_p pointer(self) :
|
||||
return <OBIDMS_p>(self._pointer)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def obi_atexit() :
|
||||
atexit(obi_close_atexit)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def open_or_new(object dms_name) :
|
||||
cdef OBIDMS_p pointer
|
||||
@ -56,6 +58,7 @@ cdef class DMS(OBIWrapper):
|
||||
dms = OBIWrapper.new_wrapper(DMS, pointer)
|
||||
return dms
|
||||
|
||||
|
||||
@staticmethod
|
||||
def exists(object dms_name) :
|
||||
cdef bytes dms_name_b = tobytes(dms_name)
|
||||
@ -65,6 +68,7 @@ cdef class DMS(OBIWrapper):
|
||||
raise RuntimeError("Error checking if a DMS exists")
|
||||
else :
|
||||
return bool(rep)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def new(object dms_name) :
|
||||
@ -114,6 +118,17 @@ cdef class DMS(OBIWrapper):
|
||||
return <bytes> self.pointer().dms_name
|
||||
|
||||
|
||||
# DMS full path property getter
|
||||
@property
|
||||
def full_path(self) :
|
||||
'''
|
||||
Returns the full path of the DMS directory
|
||||
|
||||
@rtype: bytes
|
||||
'''
|
||||
return <bytes> self.pointer().directory_path
|
||||
|
||||
|
||||
# command history DOT graph property getter in the form of a bytes string
|
||||
@property
|
||||
def dot_history_graph(self):
|
||||
|
Reference in New Issue
Block a user