Ignore:
Timestamp:
03/02/09 16:16:41 (3 years ago)
Author:
Peter Peterson
Message:

Added feature to opengroup where the nxclass does not need to be specifed. Supplying it will speed up the execution though. Refs #101.

File:
1 edited

Legend:

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

    r1184 r1185  
    520520    nxlib.nxiopengroup_.restype = c_int 
    521521    nxlib.nxiopengroup_.argtypes = [c_void_p, c_char_p, c_char_p] 
    522     def opengroup(self, name, nxclass): 
    523         """ 
    524         Open the group nxclass:name. 
     522    def opengroup(self, name, nxclass=None): 
     523        """ 
     524        Open the group nxclass:name. If the nxclass is not specified 
     525        this will search for it. 
    525526 
    526527        Raises ValueError if the group could not be opened. 
     
    529530        """ 
    530531        #print "open group",nxclass,name 
     532        if nxclass is None: 
     533            listing = self.getentries() 
     534            if not listing.has_key(name): 
     535                raise KeyError("file does not have \"%s\" at this level" \ 
     536                               % name) 
     537            nxclass = listing[name] 
    531538        status = nxlib.nxiopengroup_(self.handle, name, nxclass) 
    532539        if status == ERROR: 
Note: See TracChangeset for help on using the changeset viewer.