moved PersistableWidget marker class to other persistence code

This commit is contained in:
2021-07-26 17:10:25 +02:00
parent b71f14a004
commit e543e95cbd
5 changed files with 11 additions and 9 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ import wx
from slic.utils.reprate import get_pvname_reprate
from ..widgets import LabeledMathEntry, LabeledEntry, LabeledFilenameEntry, TwoButtons, make_filled_hbox, make_filled_vbox, STRETCH, EXPANDING, PersistableWidget
from ..widgets import LabeledMathEntry, LabeledEntry, LabeledFilenameEntry, TwoButtons, make_filled_hbox, make_filled_vbox, STRETCH, EXPANDING
from ..persist import PersistableWidget
from .tools import AdjustableComboBox, ETADisplay, correct_n_pulses, run, post_event
+6 -2
View File
@@ -1,6 +1,5 @@
from pathlib import Path
from slic.utils import typename, json_save, json_load
from slic.gui import widgets as ws
def skip_on_error(f):
@@ -15,6 +14,11 @@ def skip_on_error(f):
class PersistableWidget:
pass
class Persistence:
def __init__(self, fname, managed):
@@ -58,7 +62,7 @@ def set_values(values, obj):
def get_good_children(obj):
return [c for c in recurse(obj) if isinstance(c, ws.PersistableWidget)]
return [c for c in recurse(obj) if isinstance(c, PersistableWidget)]
def recurse(obj):
children = obj.GetChildren()
+1 -1
View File
@@ -3,7 +3,7 @@ from .completers import ContainsTextCompleter, FuzzyTextCompleter
from .entries import LabeledEntry, LabeledFilenameEntry, LabeledMathEntry, LabeledTweakEntry
from .lists import AutoWidthListCtrl, show_list, show_two_lists
from .mods import MainPanel, NotebookDX
from .tools import EXPANDING, STRETCH, PersistableWidget, make_filled_vbox, make_filled_hbox, copy_to_clipboard, post_event
from .tools import EXPANDING, STRETCH, make_filled_vbox, make_filled_hbox, copy_to_clipboard, post_event
from .twobuttons import TwoButtons
+2 -1
View File
@@ -2,7 +2,8 @@ import wx
from slic.utils import arithmetic_eval, typename
from .tools import ADJUSTMENTS, PersistableWidget, make_filled_hbox
from .tools import ADJUSTMENTS, make_filled_hbox
from ..persist import PersistableWidget
class LabeledTweakEntry(wx.BoxSizer):
-4
View File
@@ -6,10 +6,6 @@ from .fname import increase, decrease
WX_DEFAULT_RESIZABLE_DIALOG_STYLE = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX
class PersistableWidget:
pass
class EXPANDING: pass
class STRETCH: pass