/[escript]/trunk/escript/py_src/util.py
ViewVC logotype

Diff of /trunk/escript/py_src/util.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3282 by gross, Thu Sep 23 06:54:18 2010 UTC revision 3283 by gross, Mon Oct 18 22:39:28 2010 UTC
# Line 577  def getShape(arg): Line 577  def getShape(arg):
577    
578      if isinstance(arg,numpy.ndarray):      if isinstance(arg,numpy.ndarray):
579          return arg.shape          return arg.shape
580        elif isinstance(arg,list):
581            return numpy.array(arg).shape
582      elif isinstance(arg,escript.Data):      elif isinstance(arg,escript.Data):
583          return arg.getShape()          return arg.getShape()
584      elif isinstance(arg,float):      elif isinstance(arg,float):
# Line 6156  class FileWriter(object): Line 6158  class FileWriter(object):
6158              if e==None:              if e==None:
6159                 raise IOError,"Unable to access file %s in mode %s for %s."%(self.name,self.mode,operation)                 raise IOError,"Unable to access file %s in mode %s for %s."%(self.name,self.mode,operation)
6160              else:              else:
6161                 if hasattr(e,"message"):                 raise IOError(str(e))
                   raise IOError,e.message  
                else:  
                   raise IOError,"Unable to access file %s in mode %s for %s."%(self.name,self.mode,operation)  
6162                    
6163      def close(self):      def close(self):
6164          """          """

Legend:
Removed from v.3282  
changed lines
  Added in v.3283

  ViewVC Help
Powered by ViewVC 1.1.26