Ignore:
Timestamp:
14/11/08 21:19:43 (4 years ago)
Author:
Paul Kienzle
Message:

python: use NeXusError rather than RuntimeError. Refs #101.

File:
1 edited

Legend:

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

    r1122 r1124  
    126126import nxs.napi 
    127127import nxs.unit 
     128from nxs.napi import NeXusError 
    128129 
    129130 
     
    403404            try: 
    404405                gid[target] = self.getdataID() 
    405             except RuntimeError: 
     406            except NeXusError: 
    406407                gid[target] = self.getgroupID() 
    407408 
     
    718719    """ 
    719720    def plot(self, signal, axes, entry, title, **opts): 
     721        """ 
     722        Plot the data entry. 
     723         
     724        Raises NeXusError if the data cannot be plotted. 
     725        """ 
    720726        import pylab 
    721727        pylab.cla() 
     
    755761        # No support for higher dimensions yet 
    756762        else: 
    757             raise RuntimeError, "Cannot plot a dataset of rank 3 or greater." 
     763            raise NeXusError, "Cannot plot a dataset of rank 3 or greater." 
    758764    @staticmethod 
    759765    def show(): 
     
    798804        """ 
    799805        Plot data contained within the group. 
     806         
     807        Raises NeXusError if the data could not be plotted. 
    800808        """ 
    801809         
     
    806814                break 
    807815        else: 
    808             raise RuntimeError('No plottable signal') 
     816            raise NeXusError('No plottable signal') 
    809817         
    810818        # Find the associated axes 
     
    812820            axes = [getattr(self,a) for a in signal.Aaxes.nxdata.split(':')] 
    813821        else: 
    814             raise RuntimeError('Axes attribute missing from signal') 
     822            raise NeXusError('Axes attribute missing from signal') 
    815823 
    816824        # Construct title 
Note: See TracChangeset for help on using the changeset viewer.