forked from M-Labs/artiq
gui/state: implement backup state file for last successful load (#2538)
This commit is contained in:
parent
83bf984216
commit
62afcdaaf6
|
@ -6,6 +6,7 @@ Release notes
|
|||
ARTIQ-9 (Unreleased)
|
||||
--------------------
|
||||
|
||||
* GUI state files are now automatically backed up upon successful loading.
|
||||
* Zotino monitoring in the dashboard now displays the values in volts.
|
||||
* afws_client now uses the "happy eyeballs" algorithm (RFC 6555) for a faster and more
|
||||
reliable connection to the server.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
from collections import OrderedDict
|
||||
import logging
|
||||
import shutil
|
||||
|
||||
from sipyco.asyncio_tools import TaskObject
|
||||
from sipyco import pyon
|
||||
|
@ -45,6 +46,8 @@ class StateManager(TaskObject):
|
|||
logger.info("State database '%s' not found, using defaults",
|
||||
self.filename)
|
||||
return
|
||||
else:
|
||||
shutil.copy2(self.filename, self.filename + ".backup")
|
||||
# The state of one object may depend on the state of another,
|
||||
# e.g. the display state may create docks that are referenced in
|
||||
# the area state.
|
||||
|
|
Loading…
Reference in New Issue