diff --git a/.travis.yml b/.travis.yml index f872394d..460aee40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 \ No newline at end of file +script: travis_wait 20 python devsimpy.py examples/model0.dsp quit \ No newline at end of file diff --git a/Components.py b/Components.py index 3042bf10..8d0b70e3 100644 --- a/Components.py +++ b/Components.py @@ -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: """ diff --git a/LibraryTree.py b/LibraryTree.py index bb6200ac..37f1084b 100644 --- a/LibraryTree.py +++ b/LibraryTree.py @@ -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) diff --git a/devsimpy.py b/devsimpy.py index be144505..931f6035 100644 --- a/devsimpy.py +++ b/devsimpy.py @@ -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). """ diff --git a/wxPyMail.py b/wxPyMail.py index 56325e4d..fa877cbc 100644 --- a/wxPyMail.py +++ b/wxPyMail.py @@ -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