Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@ language: python
python:
- "3.7"

#services:
# - xvfb

env:
-DISPLAY=:99.0

before_install:
- sh -e /etc/init.d/xvfb start

#before_script:
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 3 # give xvfb some time to start
services:
- xvfb

sudo: true

Expand Down Expand Up @@ -53,4 +42,4 @@ install:
- pip install PyPubSub==3.3.0 pyyaml ruamel.yaml

# command to run
script: travis_wait 20 python devsimpy.py examples/model0.dsp stop
script: travis_wait 20 python devsimpy.py examples/model0.dsp quit
13 changes: 10 additions & 3 deletions Components.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,17 @@ class PyComponent:
def Load(filename, label):
""" Load python file from filename
"""
filename = filename.strip()
assert(filename.endswith(('.py','.pyc')))
#fn = filename.strip()

return BlockFactory.CreateBlock( python_file = filename, label = label)

fn = filename.replace(" ", "")

assert(fn.endswith(('.py','.pyc','.pyd'))),"File %s is not python file!"%fn

if os.path.exists(fn):
return BlockFactory.CreateBlock(python_file = fn, label = label)
else:
return None

class GenericComponent:
"""
Expand Down
5 changes: 4 additions & 1 deletion LibraryTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,10 @@ def InsertNewDomain(self, dName, parent, L = []):
if D != []:
self.InsertNewDomain(dName, parent, D)

self.SortChildren(parent)
try:
self.SortChildren(parent)
except:
pass

return self.InsertNewDomain(dName, parent, L)

Expand Down
9 changes: 6 additions & 3 deletions devsimpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,9 +2155,12 @@ def OnClose(self, event):

self.app.SetExceptionHook()

# Call after the loading diagram method whic depends on the invocked command line
wx.CallAfter(self.app.frame.OnLoadDiagram)

# Call after the loading diagram method which depends on the invocked command line
try:
wx.CallAfter(self.app.frame.OnLoadDiagram)
except:
pass

def ShowMain(self):
""" Shows the main application (DEVSimPy). """

Expand Down
2 changes: 2 additions & 0 deletions wxPyMail.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import urllib.request, urllib.parse, urllib.error
import wx

_ = wx.GetTranslation

try:
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
Expand Down