[152537] trunk/dports/python/py-magpy

mojca at macports.org mojca at macports.org
Sun Sep 11 22:24:28 PDT 2016


Revision: 152537
          https://trac.macports.org/changeset/152537
Author:   mojca at macports.org
Date:     2016-09-11 22:24:28 -0700 (Sun, 11 Sep 2016)
Log Message:
-----------
py-magpy: bugfixes, optional runtime dependencies

Modified Paths:
--------------
    trunk/dports/python/py-magpy/Portfile

Added Paths:
-----------
    trunk/dports/python/py-magpy/files/
    trunk/dports/python/py-magpy/files/patch-magpy-gui-dialogclaes.py.diff

Modified: trunk/dports/python/py-magpy/Portfile
===================================================================
--- trunk/dports/python/py-magpy/Portfile	2016-09-12 05:17:35 UTC (rev 152536)
+++ trunk/dports/python/py-magpy/Portfile	2016-09-12 05:24:28 UTC (rev 152537)
@@ -5,9 +5,10 @@
 PortGroup           python 1.0
 PortGroup           github 1.0
 
-github.setup        geomagpy magpy b5882f5
+github.setup        geomagpy magpy 511d1f2
 name                py-magpy
 version             0.3.1
+revision            1
 platforms           darwin
 license             GPL-3
 maintainers         mojca openmaintainer
@@ -15,29 +16,29 @@
 description         Geomagnetic analysis tools.
 long_description    ${description}
 
-checksums           rmd160  1c18138ade91255207943c2d9199bcac18b1eb73 \
-                    sha256  ab87e66336827cd734363e9d88dba49784f15590bc9c8e04ebef99ba1c4640c0
+checksums           rmd160  9bd4d5c48cbad3b52276038b2c851174806592fe \
+                    sha256  9181cd92deb05a14611e0d144575360bc012f93ee61a19df59d79efd7195c394
 
 python.versions     27 35
 
 # TODO:
-# - add a port py-spacepy
 # - add a port py-autobahn
-# - properly enable and test MySQL
 if {${name} ne ${subport}} {
-    # TODO: mysql
     depends_build-append \
                     port:py${python.version}-setuptools
-    # mysql and scipy are optional
-    # xmagpy needs py-wxpython-3.0
-    # py-matplotlib is often needed
     depends_run-append \
                     port:py${python.version}-numpy \
                     port:py${python.version}-netcdf4 \
                     port:py${python.version}-pexpect
-                    # port:py${python.version}-scipy \
-                    # port:py${python.version}-mysql
+    # optional
+    depends_run-append \
+                    port:py${python.version}-mysql \
+                    port:py${python.version}-matplotlib \
+                    port:py${python.version}-scipy \
+                    port:py${python.version}-wxpython-3.0
 
+    patchfiles      patch-magpy-gui-dialogclaes.py.diff
+
     post-patch {
         reinplace "s|/usr/bin/env python|${python.bin}|" ${worksrcpath}/magpy/gui/xmagpy.py
     }

Added: trunk/dports/python/py-magpy/files/patch-magpy-gui-dialogclaes.py.diff
===================================================================
--- trunk/dports/python/py-magpy/files/patch-magpy-gui-dialogclaes.py.diff	                        (rev 0)
+++ trunk/dports/python/py-magpy/files/patch-magpy-gui-dialogclaes.py.diff	2016-09-12 05:24:28 UTC (rev 152537)
@@ -0,0 +1,366 @@
+https://github.com/geomagpy/magpy/issues/29
+
+--- magpy/gui/dialogclasses.py.orig
++++ magpy/gui/dialogclasses.py
+@@ -113,7 +113,7 @@ class OpenWebAddressDialog(wx.Dialog):
+             self.getFavsComboBox.Append(elem)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class LoadDataDialog(wx.Dialog):
+@@ -193,7 +193,7 @@ class LoadDataDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class ExportDataDialog(wx.Dialog):
+@@ -335,7 +335,7 @@ class ExportDataDialog(wx.Dialog):
+         self.filenameTextCtrl.SetValue(self.filename)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ class ExportModifyNameDialog(wx.Dialog):
+     """
+@@ -418,7 +418,7 @@ class ExportModifyNameDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ class DatabaseConnectDialog(wx.Dialog):
+     """
+@@ -485,7 +485,7 @@ class DatabaseConnectDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class DatabaseContentDialog(wx.Dialog):
+@@ -543,7 +543,7 @@ class DatabaseContentDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class OptionsInitDialog(wx.Dialog):
+@@ -668,7 +668,7 @@ class OptionsInitDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class OptionsDIDialog(wx.Dialog):
+@@ -827,7 +827,7 @@ class OptionsDIDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ # ###################################################
+ #    Stream page
+@@ -931,7 +931,7 @@ class StreamExtractValuesDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamSelectKeysDialog(wx.Dialog):
+@@ -992,7 +992,7 @@ class StreamSelectKeysDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamPlotOptionsDialog(wx.Dialog):
+@@ -1051,7 +1051,7 @@ class StreamPlotOptionsDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamFlagOutlierDialog(wx.Dialog):
+@@ -1121,7 +1121,7 @@ class StreamFlagOutlierDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamFlagRangeDialog(wx.Dialog):
+@@ -1275,7 +1275,7 @@ class StreamFlagRangeDialog(wx.Dialog):
+             pass
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def SetValue(self):
+             self.UpperLimitTextCtrl.Enable()
+@@ -1370,7 +1370,7 @@ class StreamFlagSelectionDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamLoadFlagDialog(wx.Dialog):
+@@ -1433,14 +1433,14 @@ class StreamLoadFlagDialog(wx.Dialog):
+         self.loadFileButton.Bind(wx.EVT_BUTTON, self.OnLoadFile)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnLoadDB(self, e):
+         self.flaglist = db2flaglist(self.db, self.sensorid)
+         dlg = wx.MessageDialog(self, "Flags for {} loaded from DB!\nFLAGS table contained {} inputs\n".format(self.sensorid,len(self.flaglist)),"FLAGS obtained from DB", wx.OK|wx.ICON_INFORMATION)
+         dlg.ShowModal()
+         dlg.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnLoadFile(self, e):
+         openFileDialog = wx.FileDialog(self, "Open", "", "", 
+@@ -1453,7 +1453,7 @@ class StreamLoadFlagDialog(wx.Dialog):
+         except:
+             self.flaglist = [] 
+         openFileDialog.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class StreamSaveFlagDialog(wx.Dialog):
+@@ -1515,14 +1515,14 @@ class StreamSaveFlagDialog(wx.Dialog):
+         self.saveFileButton.Bind(wx.EVT_BUTTON, self.OnSaveFile)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnSaveDB(self, e):
+         flaglist2db(self.db, self.flaglist)
+         dlg = wx.MessageDialog(self, "Flags stored in connected DB!\nFLAGS table extended with {} inputs\n".format(len(self.flaglist)),"FLAGS added to DB", wx.OK|wx.ICON_INFORMATION)
+         dlg.ShowModal()
+         dlg.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnSaveFile(self, e):
+         saveFileDialog = wx.FileDialog(self, "Save As", "", "", 
+@@ -1533,7 +1533,7 @@ class StreamSaveFlagDialog(wx.Dialog):
+         saveFileDialog.Destroy()
+         print (flagname)
+         saveflags(self.flaglist,flagname)
+-        self.Destroy()
++        self.Close(True)
+ 
+ # ###################################################
+ #    Meta page
+@@ -1648,7 +1648,7 @@ class MetaDataDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def AppendLabel(self, key,label):
+         from magpy.lib.magpy_formats import IAFMETA, IAGAMETA, IMAGCDFMETA
+@@ -1739,7 +1739,7 @@ class AnalysisFitDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class AnalysisFilterDialog(wx.Dialog):
+@@ -1826,7 +1826,7 @@ class AnalysisFilterDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class AnalysisOffsetDialog(wx.Dialog):
+@@ -1931,7 +1931,7 @@ class AnalysisOffsetDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnChangeRange(self, e):
+         val = self.offsetRadioBox.GetStringSelection()
+@@ -2003,7 +2003,7 @@ class AnalysisRotationDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class AnalysisBaselineDialog(wx.Dialog):
+@@ -2089,7 +2089,7 @@ class AnalysisBaselineDialog(wx.Dialog):
+         self.parameterButton.Bind(wx.EVT_BUTTON, self.OnParameter)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnParameter(self, e):
+         # open fit dlg
+@@ -2177,7 +2177,7 @@ class LoadDIDialog(wx.Dialog):
+         self.loadRemoteButton.Bind(wx.EVT_BUTTON, self.OnLoadDIRemote)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnLoadDIFiles(self,e):
+         self.difiledirname = ''
+@@ -2186,7 +2186,7 @@ class LoadDIDialog(wx.Dialog):
+         if dlg.ShowModal() == wx.ID_OK:
+             self.pathlist = dlg.GetPaths()
+         dlg.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnLoadDIDB(self,e):
+         #self.dirname = ''
+@@ -2195,7 +2195,7 @@ class LoadDIDialog(wx.Dialog):
+         if dlg.ShowModal() == wx.ID_OK:
+             self.pathlist = dlg.GetPaths()
+         dlg.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnLoadDIRemote(self,e):
+         self.dirname = ''
+@@ -2204,7 +2204,7 @@ class LoadDIDialog(wx.Dialog):
+         if dlg.ShowModal() == wx.ID_OK:
+             self.pathlist = dlg.GetPaths()
+         dlg.Destroy()
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class DefineVarioDialog(wx.Dialog):
+@@ -2267,7 +2267,7 @@ class DefineVarioDialog(wx.Dialog):
+         self.loadFileButton.Bind(wx.EVT_BUTTON, self.OnDefineVario)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnDefineVario(self,e):
+         dialog = wx.DirDialog(None, "Choose a directory with variometer data:",self.variopath,style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
+@@ -2337,7 +2337,7 @@ class DefineScalarDialog(wx.Dialog):
+         self.loadFileButton.Bind(wx.EVT_BUTTON, self.OnDefineScalar)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+     def OnDefineScalar(self,e):
+@@ -2423,7 +2423,7 @@ class DISetParameterDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ 
+@@ -3508,7 +3508,7 @@ class AGetMARCOSDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ class BGetMARCOSDialog(wx.Dialog):
+     """
+@@ -3564,7 +3564,7 @@ class BGetMARCOSDialog(wx.Dialog):
+         self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ 
+ class AGetMARTASDialog(wx.Dialog):
+@@ -3634,10 +3634,10 @@ class AGetMARTASDialog(wx.Dialog):
+         self.addButton.Bind(wx.EVT_BUTTON, self.OnAdd)
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnAdd(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+ class MultiStreamDialog(wx.Dialog):
+     """
+@@ -3761,7 +3761,7 @@ class MultiStreamDialog(wx.Dialog):
+             exec('self.'+name+'KeyButton.Bind(wx.EVT_BUTTON, partial( self.OnGetKeys, name = idx ) )')
+ 
+     def OnClose(self, e):
+-        self.Destroy()
++        self.Close(True)
+ 
+     def OnGetKeys(self, e, name):
+         print ("Stream", name)
+@@ -3810,7 +3810,7 @@ class MultiStreamDialog(wx.Dialog):
+             #self.streamlist.append(self.result)
+             #self.streamkeylist.append(self.result._get_key_headers())
+             #
+-            self.Destroy()
++            self.Close(True)
+         else:
+             dlg = wx.MessageDialog(self, "Merge requires two records\n"
+                             " - not less, not more\n",
+@@ -3836,7 +3836,7 @@ class MultiStreamDialog(wx.Dialog):
+             self.result = subtractStreams(substreamlist[0],substreamlist[1])
+             self.resultkeys = self.result._get_key_headers()
+             self.modify = True
+-            self.Destroy()
++            self.Close(True)
+         else:
+             dlg = wx.MessageDialog(self, "Subtract requires two records\n"
+                             " - not less, not more\n",
+@@ -3875,7 +3875,7 @@ class MultiStreamDialog(wx.Dialog):
+             self.result = joinStreams(substreamlist[0],substreamlist[1])
+             self.resultkeys = self.result._get_key_headers()
+             self.modify = True
+-            self.Destroy()
++            self.Close(True)
+         else:
+             dlg = wx.MessageDialog(self, "Subtract requires two records\n"
+                             " - not less, not more\n",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160911/e6e4cdaa/attachment-0001.html>


More information about the macports-changes mailing list