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:
|
struct OBIDMS_t:
|
||||||
const_char_p dms_name
|
const_char_p dms_name
|
||||||
|
const_char_p directory_path
|
||||||
OBIDMS_infos_p infos
|
OBIDMS_infos_p infos
|
||||||
|
|
||||||
ctypedef OBIDMS_t* OBIDMS_p
|
ctypedef OBIDMS_t* OBIDMS_p
|
||||||
|
@ -38,10 +38,12 @@ cdef class DMS(OBIWrapper):
|
|||||||
cdef inline OBIDMS_p pointer(self) :
|
cdef inline OBIDMS_p pointer(self) :
|
||||||
return <OBIDMS_p>(self._pointer)
|
return <OBIDMS_p>(self._pointer)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def obi_atexit() :
|
def obi_atexit() :
|
||||||
atexit(obi_close_atexit)
|
atexit(obi_close_atexit)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def open_or_new(object dms_name) :
|
def open_or_new(object dms_name) :
|
||||||
cdef OBIDMS_p pointer
|
cdef OBIDMS_p pointer
|
||||||
@ -56,6 +58,7 @@ cdef class DMS(OBIWrapper):
|
|||||||
dms = OBIWrapper.new_wrapper(DMS, pointer)
|
dms = OBIWrapper.new_wrapper(DMS, pointer)
|
||||||
return dms
|
return dms
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def exists(object dms_name) :
|
def exists(object dms_name) :
|
||||||
cdef bytes dms_name_b = tobytes(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")
|
raise RuntimeError("Error checking if a DMS exists")
|
||||||
else :
|
else :
|
||||||
return bool(rep)
|
return bool(rep)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def new(object dms_name) :
|
def new(object dms_name) :
|
||||||
@ -114,6 +118,17 @@ cdef class DMS(OBIWrapper):
|
|||||||
return <bytes> self.pointer().dms_name
|
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
|
# command history DOT graph property getter in the form of a bytes string
|
||||||
@property
|
@property
|
||||||
def dot_history_graph(self):
|
def dot_history_graph(self):
|
||||||
|
Reference in New Issue
Block a user