Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed May 7, 2019
1 parent 66c6156 commit 145e8e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apstools/filewriters.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ def __init__(self, filename=None, auto_write=True, RE=None, reset_scan_id=False)
self._datetime = None # most recent document time as datetime object
self._streams = {} # descriptor documents, keyed by uid
self.RE = RE

if reset_scan_id == True:
reset_scan_id = SCAN_ID_RESET_VALUE
self.reset_scan_id = reset_scan_id

if filename is None or not os.path.exists(filename):
self.newfile(filename)
else:
max_scan_id = self.usefile(filename)
if RE is not None and reset_scan_id:
if RE is not None and reset_scan_id is not False:
RE.md["scan_id"] = max_scan_id

def clear(self):
Expand Down

0 comments on commit 145e8e5

Please sign in to comment.