diff --git a/.travis.yml b/.travis.yml index ebe47839..f872394d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,32 +2,55 @@ language: python python: - "3.7" -services: - - xvfb +#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 +sudo: true + +#cache: pip + +#on_success: never +#on_failure: change + git: submodules: false addons: apt: packages: - # - libwebkitgtk-dev - # - libjpeg-dev - # - libtiff-dev - - libgtk-3-dev - # - libsdl1.2-dev - # - libgstreamer-plugins-base0.10-dev - # - freeglut3 - # - freeglut3-dev - # - libnotify-dev + - dpkg-dev + - build-essential + - python-dev + - libjpeg-dev + - libtiff5-dev + - libsdl1.2-dev + - libgstreamer-plugins-base0.10-dev + - libnotify-dev + - freeglut3 + - freeglut3-dev + - libsm-dev + - libgtk-3-dev + - libpng16-16 + - libwebkitgtk-3.0-dev + - libgstreamer-plugins-base1.0-dev + - at-spi2-core # command to install dependencies install: - - pip install -r requirements.txt + - travis_wait 50 pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 wxPython + - travis_wait 50 python setup.py install + - pip install PyPubSub==3.3.0 pyyaml ruamel.yaml + # command to run -script: python devsimpy.py \ No newline at end of file +script: travis_wait 20 python devsimpy.py examples/model0.dsp stop \ No newline at end of file diff --git a/PlotGUI.py b/PlotGUI.py index cd1fce0b..192e4229 100644 --- a/PlotGUI.py +++ b/PlotGUI.py @@ -445,7 +445,7 @@ def OnPlotLine(self, event=None): m = max([a[1] for a in dd]) dd = [(b[0], b[1]/m) for b in dd] - L.append(plot.PolyLine(d, legend = 'Port %d %s'%(ind,self.legend), colour = cc, width=1)) + L.append(plot.PolyLine(dd, legend = 'Port %d %s'%(ind,self.legend), colour = cc, width=1)) a,b,c,d = get_limit(dd) diff --git a/devsimpy.py b/devsimpy.py index bb56d1f3..be144505 100644 --- a/devsimpy.py +++ b/devsimpy.py @@ -1674,6 +1674,16 @@ def StartSimulationGUIWin(self, arg, diagrams): evt = wx.PyCommandEvent(wx.EVT_BUTTON.typeId, sf._btn1.GetId()) wx.PostEvent(sf._btn1, evt) + finally: + ### Force to close DEVSimPy + try: + arg = sys.argv[-1] + except IndexError: + pass + else: + if arg in ('close','quit'): + self.Close() + ##---------------------------------------------- #def AdjustTab(self, evt): ## clic sur simulation @@ -2384,6 +2394,7 @@ def SetExceptionHook(self): sys.stdout.write(_('\t To load an existing dsp with a simulation frame initialized with no time limit: \n\t\t$ python devsimpy.py ntl/inf/infinity\n')) sys.stdout.write(_('\t To start simulation: \n\t\t$ python devsimpy.py ntl/inf/infinity start/go\n')) sys.stdout.write(_('\t To execute DEVSimPy cleaner: python devsimpy.py -c|-clean\n')) + sys.stdout.write(_('\t To close DEVSimPy: python devsimpy.py close|quit\n')) sys.stdout.write(_('Authors: L. Capocchi (capocchi@univ-corse.fr)\n')) sys.exit()