Ignore:
Timestamp:
08/04/09 01:14:55 (3 years ago)
Author:
Paul Kienzle
Message:

python binding requires matched open/close data to maintain path. Refs #101.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bindings/python/nxs/napi.py

    r1221 r1222  
    577577        """ 
    578578        #print "closegroup" 
     579        if self._indata: 
     580            raise NeXusError, "Close data before group at %s"%(self._loc()) 
    579581        status = nxlib.nxiclosegroup_(self.handle) 
    580582        if status == ERROR: 
    581             raise NeXusError, "Could not close group at %s"%(name,self._loc()) 
     583            raise NeXusError, "Could not close group at %s"%(self._loc()) 
    582584        self._path.pop() 
    583585 
     
    809811        """ 
    810812        #print "opendata",self._loc(),name 
    811         status = nxlib.nxiopendata_(self.handle, name) 
     813        if self._indata: 
     814            status = ERROR 
     815        else: 
     816            status = nxlib.nxiopendata_(self.handle, name) 
    812817        if status == ERROR: 
    813818            raise ValueError, "Could not open data %s: %s"%(name, self._loc()) 
     
    830835        if status == ERROR: 
    831836            raise NeXusError,\ 
    832                 "Could not close data at %s"%(name,self._loc()) 
     837                "Could not close data at %s"%(self._loc()) 
    833838        self._path.pop() 
    834839        self._indata = False 
Note: See TracChangeset for help on using the changeset viewer.