/[escript]/trunk/pyvisi/py_src/datacollector.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/datacollector.py

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

revision 1967 by phornby, Wed Nov 5 08:49:39 2008 UTC revision 2009 by phornby, Mon Nov 10 10:01:50 2008 UTC
# Line 81  class DataCollector: Line 81  class DataCollector:
81          elif (self.__source == Source.ESCRIPT):          elif (self.__source == Source.ESCRIPT):
82              self.__vtk_xml_reader = vtk.vtkXMLUnstructuredGridReader()              self.__vtk_xml_reader = vtk.vtkXMLUnstructuredGridReader()
83              # Create a temporary .xml file and retrieve its path.              # Create a temporary .xml file and retrieve its path.
84                # Should raise IOError on failure, in wich case
85                # __tmp_fd will remain None.
86              fd_and_name = tempfile.mkstemp(suffix=".xml")              fd_and_name = tempfile.mkstemp(suffix=".xml")
87              self.__tmp_fd = fd_and_name[0]              self.__tmp_fd = fd_and_name[0]
88              self.__tmp_file = fd_and_name[1]              self.__tmp_file = fd_and_name[1]
89    
90      def __del__(self):      def __del__(self):
91          """          """
92          Perform some clean up of the temporary file.          Perform some clean up of ths assumese temporary file.
93          """          """
94            # remove this test and rely upon the existance of an open
95          if (self.__source == Source.ESCRIPT):          # __tmp_file to decide upon closing and unlinking.
96              if self.__tmp_fd != None :          # if (self.__source == Source.ESCRIPT):
97                  os.close(self.__tmp_fd)          if self.__tmp_fd != None :
98                  if os.access(self.__tmp_file,os.F_OK):              os.close(self.__tmp_fd)
99                      os.unlink(self.__tmp_file)              os.unlink(self.__tmp_file)
100    
101      def setFileName(self, file_name):      def setFileName(self, file_name):
102          """          """

Legend:
Removed from v.1967  
changed lines
  Added in v.2009

  ViewVC Help
Powered by ViewVC 1.1.26