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)
|
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.
|
* 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
|
* afws_client now uses the "happy eyeballs" algorithm (RFC 6555) for a faster and more
|
||||||
reliable connection to the server.
|
reliable connection to the server.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import logging
|
import logging
|
||||||
|
import shutil
|
||||||
|
|
||||||
from sipyco.asyncio_tools import TaskObject
|
from sipyco.asyncio_tools import TaskObject
|
||||||
from sipyco import pyon
|
from sipyco import pyon
|
||||||
|
@ -45,6 +46,8 @@ class StateManager(TaskObject):
|
||||||
logger.info("State database '%s' not found, using defaults",
|
logger.info("State database '%s' not found, using defaults",
|
||||||
self.filename)
|
self.filename)
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
shutil.copy2(self.filename, self.filename + ".backup")
|
||||||
# The state of one object may depend on the state of another,
|
# The state of one object may depend on the state of another,
|
||||||
# e.g. the display state may create docks that are referenced in
|
# e.g. the display state may create docks that are referenced in
|
||||||
# the area state.
|
# the area state.
|
||||||
|
|
Loading…
Reference in New Issue