Skip to content

Commit 7b877be

Browse files
committed
bug fix
1 parent 6c13c32 commit 7b877be

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

devsimpy/Container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,9 @@ def draw(self, dc):
13471347
dc.SetPen(wx.Pen(*pen_args))
13481348

13491349
if self.dashed:
1350-
self.pen[2] = wx.PENSTYLE_DOT_DASH
1350+
self.pen[2] = 104 # wx.PENSTYLE_DOT_DASH
13511351
else:
1352-
self.pen[2] = wx.PENSTYLE_SOLID
1352+
self.pen[2] = 100 # wx.PENSTYLE_SOLID
13531353

13541354
# Set the brush color
13551355
dc.SetBrush(wx.Brush(brushclr))
@@ -2981,7 +2981,7 @@ def OnMotion(self, event):
29812981

29822982
### dot trace to prepare connection
29832983
if len(s.pen)>2:
2984-
s.pen[2]= wx.PENSTYLE_DOT
2984+
s.pen[2]= 101 #wx.PENSTYLE_DOT
29852985

29862986
if cursor != wx.StockCursor(wx.CURSOR_HAND):
29872987
cursor = wx.StockCursor(wx.CURSOR_HAND)

devsimpy/InteractionYAML.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ def to_Python(val):
2626
return val
2727
elif str(val).replace('.','').replace('-','').isdigit():
2828
return eval(str(val))
29-
elif isinstance(eval(val),list) or isinstance(eval(val),tuple):
30-
return eval(val)
29+
elif isinstance(eval(val), (list, tuple)):
30+
return eval(val)
31+
elif isinstance(val, (list, tuple)):
32+
val = [to_Python(v) for v in val]
33+
return val
3134

3235
return val
3336

devsimpy/Mixins/Savable.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def Save(self, obj_dumped, fileName=None) -> bool:
517517
yaml.register_class(PickledCollection)
518518

519519
with open(fileName, 'w') as yf:
520-
yaml.dump(PickledCollection(obj_dumped), stream=yf, default_flow_style=False)
520+
yaml.dump(PickledCollection(obj_dumped), stream=yf)
521521

522522
except (AttributeError, Exception) as error:
523523
sys.stderr.write(f"Warning: First attempt to save YAML failed, retrying in 'unsafe' mode: {error}\n")
@@ -548,6 +548,7 @@ def Open(fileName:str):
548548
Args:
549549
fileName (str): YAML filename
550550
"""
551+
global _
551552

552553
## try to open f with compressed mode
553554
try:
@@ -595,8 +596,12 @@ def Load(self, obj_loaded, fileName=None) -> bool:
595596
sys.stderr.write(f"Problem loading file '{fileName}': {tb}\n")
596597
return False
597598

599+
if not dsp:
600+
sys.stderr.write(f"Failed to load data from file '{fileName}'.\n")
601+
return False
602+
598603
# Vérification de la correspondance des longueurs
599-
if len(dsp) != len(obj_loaded.dump_attributes):
604+
if (len(dsp) != len(obj_loaded.dump_attributes)):
600605
raise ValueError(f"Mismatch between attributes and dumped data: {len(obj_loaded.dump_attributes)} != {len(dsp)}")
601606

602607
# Assignation des attributs en utilisant zip

0 commit comments

Comments
 (0)