Exemplo n.º 1
0
 def exists(self):
     t, error_code = nxlib.get_type(self.path)
     if error_code == NXLIB_ITEM_INEXISTENT:
         return False
     elif error_code == NXLIB_OPERATION_SUCCEEDED:
         return t != NXLIB_ITEM_TYPE_INVALID
     else:
         self._check_return_code(error_code)
         return False
Exemplo n.º 2
0
 def is_object(self):
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t == NXLIB_ITEM_TYPE_OBJECT
Exemplo n.º 3
0
 def type(self):  # overrides python type keyword ... !
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t
Exemplo n.º 4
0
 def is_array(self):
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t == NXLIB_ITEM_TYPE_ARRAY
Exemplo n.º 5
0
 def is_bool(self):
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t == NXLIB_ITEM_TYPE_BOOL
Exemplo n.º 6
0
 def is_number(self):
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t == NXLIB_ITEM_TYPE_NUMBER
Exemplo n.º 7
0
 def is_string(self):
     t, error_code = nxlib.get_type(self.path)
     self._check_return_code(error_code)
     return t == NXLIB_ITEM_TYPE_STRING
Exemplo n.º 8
0
def test_set_null():
    nxlib.set_null("/test")
    node_type = nxlib.get_type("/test")
    assert (node_type[0] == NXLIB_ITEM_TYPE_NULL)
    assert (node_type[1] == 0)