Skip to content

Commit e6225c2

Browse files
authored
Merge pull request #365 from capocchi/version-5.1
Version 5.1
2 parents a581570 + 2abe221 commit e6225c2

8 files changed

Lines changed: 18 additions & 14 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/Domain/Collector/Plotly_For_Class.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
### Specific import ------------------------------------------------------------
1515
from DomainInterface import DomainBehavior
16-
from DomainInterface import Message
1716

1817
import chart_studio.plotly as py
1918
import plotly.graph_objects as go

devsimpy/Domain/Collector/To_Stdout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
### Specific import ------------------------------------------------------------
1515
from DomainInterface import DomainBehavior
16-
from DomainInterface import Message
1716

18-
import sys
1917

2018
### Model class ----------------------------------------------------------------
2119
class To_Stdout(DomainBehavior):

devsimpy/Domain/Generator/Generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
from DomainInterface import DomainBehavior
15-
from DomainInterface import Message
15+
from DomainInterface.Object import Message
1616

1717
import os.path
1818

devsimpy/Domain/Generator/RandomGenerator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
from DomainInterface import DomainBehavior
4-
from DomainInterface import Message
4+
from DomainInterface.Object import Message
55

6-
import sys
76
import random
87

98
class RandomGenerator(DomainBehavior):

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

devsimpy/WizardGUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def atomicCode(label):
7171
7272
### Specific import ------------------------------------------------------------
7373
from DomainInterface import DomainBehavior
74-
from DomainInterface import Message
74+
from DomainInterface.Object import Message
7575
7676
### Model class ----------------------------------------------------------------
7777
class %s(DomainBehavior):

0 commit comments

Comments
 (0)