diff --git a/.travis.yml b/.travis.yml index e2b5565..f405e08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,7 @@ before_script: - chmod +x ./ci-helpers/travis/mysql_setup.sh # - chmod +x ./ci-helpers/travis/postgres_setup.sh - chmod +x ./ci-helpers/travis/freetds.sh + - ./ci-helpers/travis/mysql_setup.sh # - ./ci-helpers/travis/postgres_setup.sh - ./ci-helpers/travis/freetds.sh diff --git a/appveyor.yml b/appveyor.yml index 7c426ab..b80ffc6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -93,7 +93,7 @@ install: # the parent CMD process). - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" # add databases - - "SET PATH=%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH%" + - "SET PATH=%POSTGRES_PATH%\\bin;%MYSQL_PATH%\\bin;%PATH%" - "activate test" # Check that we have the expected version and architecture for Python @@ -110,12 +110,12 @@ build_script: - sqlcmd -S localhost,1433 -U sa -P Password12! -Q "CREATE DATABASE odm" -d "master" - sqlcmd -S localhost,1433 -U sa -P Password12! -i tests\data\sampledb\odm_mssql.sql -d "odm" - sqlcmd -S localhost,1433 -U sa -P Password12! -Q "select table_name from information_schema.tables" -d "odm" -# # postgres -# - psql createdb odm -# - psql -d odm -a -f tests\data\sampledb\odm_postgres.sql -# # mysql -# - mysql -e "drop database test; create database odm;" --user=root -# - mysql odm < tests\data\sampledb\odm_mysql.sql --user=root + # postgres + - psql createdb odm + - psql -d odm -a -f tests\data\sampledb\odm_postgres.sql + # mysql + - mysql -e "drop database test; create database odm;" --user=root + - mysql odm < tests\data\sampledb\odm_mysql.sql --user=root test_script: # Run the project tests diff --git a/odmtools/gui/frmODMTools.py b/odmtools/gui/frmODMTools.py index d3615df..d48f642 100755 --- a/odmtools/gui/frmODMTools.py +++ b/odmtools/gui/frmODMTools.py @@ -12,6 +12,7 @@ from odmtools.controller.frmDataTable import FrmDataTable import mnuRibbon import pnlPlot +import pnlPlot import pnlDataTable import wx.lib.agw.aui as aui import wx.py.crust @@ -55,6 +56,7 @@ def __init__(self, **kwargs): self.service_manager = ServiceManager() self.record_service = None + self.scriptcreate = False series_service = self._init_database() if series_service: @@ -384,7 +386,7 @@ def onSetScriptTitle(self, title): def addEdit(self, event): with wx.BusyInfo("Please wait for a moment while ODMTools fetches the data and stores it in our database", parent=self): - + self.scriptcreate = True isSelected, seriesID = self.pnlSelector.onReadyToEdit() logger.info("Beginning editing seriesID: %s"%str(seriesID)) @@ -496,6 +498,15 @@ def onClose(self, event): Closes ODMTools Python Closes AUI Manager then closes MainWindow """ + + #check to see if a script has been created + if self.scriptcreate: + msg = wx.MessageDialog(None, 'Would you like to save your editing script?', + 'Save Script', wx.YES_NO | wx.ICON_QUESTION) + value = msg.ShowModal() + if value == wx.ID_YES: + self.txtPythonScript.OnSaveAs(event) + # deinitialize the frame manager self.pnlPlot.Close() try: diff --git a/toolsenvironment.yml b/toolsenvironment.yml index bfb1a59..da0934b 100644 --- a/toolsenvironment.yml +++ b/toolsenvironment.yml @@ -29,4 +29,3 @@ dependencies: - pyodbc==3.0.7 - python-dateutil==2.4.1 - wxpython-common==3.0.0.0 -