[NeXus-code-svn] r1806 - trunk/bindings/python/nxs

apache at nexusformat.org apache at nexusformat.org
Sun Jan 22 23:08:00 GMT 2012


Author: Ray Osborn
Date: Sun Jan 22 23:07:59 2012
New Revision: 1806

Modified:
   trunk/bindings/python/nxs/tree.py

Log:
Refs #322: Further improvements to make file saves work more intuitively.

* Added three NeXus object flags, 'infile', 'saved', and 'changed' to record whether
the NXobject currently exists in the file, whether its current value has been saved,
and whether it has been changed. The third flag is for third-party scripts that need
to keep track of when a variable has been changed. It can be reset using the 
'set_unchanged' method.

* Added write methods to the NXobjects to write the object directly to the NeXus file. 
This required moving the context routines (__enter__ and __exit__) to the NXobject 
class. The use of the 'with ... as ...' syntax means that the API now requires 
Python 2.5.

* Used the new 'walk' methods in conjunction with the 'write' methods to allow
incremental saves (when no file name is specified) without needing to reload the
entire file.

* Debugged the reading and writing of NXlink objects to NeXus files. 



Modified: trunk/bindings/python/nxs/tree.py
Url: http://svn.nexusformat.org/viewvc/NeXusCode/trunk/bindings/python/nxs/tree.py?r1=1805&r2=1806


More information about the NeXus-code-svn mailing list