geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
45 stars 27 forks source link

Using Select directory doesn't work on windows #112

Closed stephanbracke closed 2 years ago

stephanbracke commented 2 years ago

Trying to open up a Directory doesn't work in windows, after a look in the code I found a link with issue #111. Looking at this code https://github.com/geomagpy/magpy/blob/ae91462f1644ebf89fbe570ce1cf67d1d89eb926/magpy/gui/magpy_gui.py#L2236-L2243

the old and new are using the method wx.DateTimeFromT(etc) which in issue #111 I found out that it didn't always work in windows. So after replacing it by

old =  wx.DateTime.FromDMY(day=oldest.day,month=oldest.month-1,year=oldest.year)
new = wx.DateTime.FromDMY(day=newest.day,month=newest.month-1,year=newest.year)

It works on windows and linux. In linux the deprication warning disappear which is nice as well

leonro commented 2 years ago

All references to DateTimeFromTimeT(...mktime...) where replaced using DateTime.fromDMY. Solved with a9352b4d65f00c8be2cb196c4512934e72e9f8c0 and 429e3425fe1ad4b77830a4f5cad2b34172b02418