Changeset 4126


Ignore:
Timestamp:
Dec 28, 2006, 6:29:54 PM (18 years ago)
Author:
ole
Message:

Added some verbosity about using default attribute names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/geospatial_data/geospatial_data.py

    r4104 r4126  
    219219
    220220    def set_verbose(self, verbose=False):
    221         if verbose is not False:
    222             verbose = True
     221        if verbose in [False, True]:
     222            self.verbose = verbose
    223223        else:
    224             verbose = False
     224            msg = 'Illegal value: %s' %str(verbose)
     225            raise Exception, msg
    225226
    226227    def clip(self, polygon, closed=True):
     
    384385                attribute_name = self.attributes.keys()[0]
    385386                # above line takes the first one from keys
    386                
     387       
     388        if self.verbose is True:
     389            print 'Using attribute %s' %attribute_name
     390            print 'Available attributes: %s' %(self.attributes.keys())       
    387391
    388392        msg = 'Attribute name %s does not exist in data set' %attribute_name
Note: See TracChangeset for help on using the changeset viewer.