sardana-nxsrecorder 3.26.0__py3-none-any.whl → 3.27.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sardana_nxsrecorder-3.26.0.dist-info → sardana_nxsrecorder-3.27.0.dist-info}/METADATA +1 -1
- sardana_nxsrecorder-3.27.0.dist-info/RECORD +6 -0
- sardananxsrecorder/__init__.py +1 -1
- sardananxsrecorder/nxsrecorder.py +21 -8
- sardana_nxsrecorder-3.26.0.dist-info/RECORD +0 -6
- {sardana_nxsrecorder-3.26.0.dist-info → sardana_nxsrecorder-3.27.0.dist-info}/WHEEL +0 -0
- {sardana_nxsrecorder-3.26.0.dist-info → sardana_nxsrecorder-3.27.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
sardananxsrecorder/__init__.py,sha256=OJHfgiQR7I36ICO3Lvh9KKyHE4H2vU8b4Gu_sTyR6V0,896
|
|
2
|
+
sardananxsrecorder/nxsrecorder.py,sha256=nT6o1p6F7rNUR1VJ-omEFznpgbQ3XC90w9axV9GPRXE,58593
|
|
3
|
+
sardana_nxsrecorder-3.27.0.dist-info/METADATA,sha256=WWIN6OtKX_CQpshvyk4rDksMBwpLj1nMXWyZUi39c5o,8035
|
|
4
|
+
sardana_nxsrecorder-3.27.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
5
|
+
sardana_nxsrecorder-3.27.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
|
|
6
|
+
sardana_nxsrecorder-3.27.0.dist-info/RECORD,,
|
sardananxsrecorder/__init__.py
CHANGED
|
@@ -26,7 +26,6 @@ import sys
|
|
|
26
26
|
|
|
27
27
|
import numpy
|
|
28
28
|
import json
|
|
29
|
-
import pytz
|
|
30
29
|
import time
|
|
31
30
|
import weakref
|
|
32
31
|
import socket
|
|
@@ -1175,8 +1174,16 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1175
1174
|
:returns: formatted time string
|
|
1176
1175
|
:rtype: :obj:`str`
|
|
1177
1176
|
"""
|
|
1177
|
+
fmt = '%Y-%m-%dT%H:%M:%S.%f%z'
|
|
1178
1178
|
try:
|
|
1179
|
-
|
|
1179
|
+
if sys.version_info >= (3, 9):
|
|
1180
|
+
import zoneinfo
|
|
1181
|
+
tz = zoneinfo.ZoneInfo(tzone)
|
|
1182
|
+
starttime = mtime.replace(tzinfo=tz)
|
|
1183
|
+
else:
|
|
1184
|
+
import pytz
|
|
1185
|
+
tz = pytz.timezone(tzone)
|
|
1186
|
+
starttime = tz.localize(mtime)
|
|
1180
1187
|
except Exception:
|
|
1181
1188
|
self.warning(
|
|
1182
1189
|
"Wrong TimeZone. "
|
|
@@ -1185,13 +1192,15 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1185
1192
|
self.__macro().warning(
|
|
1186
1193
|
"Wrong TimeZone. "
|
|
1187
1194
|
"The time zone set to `%s`" % self.__timezone)
|
|
1188
|
-
|
|
1195
|
+
if sys.version_info >= (3, 9):
|
|
1196
|
+
import zoneinfo
|
|
1197
|
+
tz = zoneinfo.ZoneInfo(self.__timezone)
|
|
1198
|
+
starttime = mtime.replace(tzinfo=tz)
|
|
1199
|
+
else:
|
|
1200
|
+
import pytz
|
|
1201
|
+
tz = pytz.timezone(self.__timezone)
|
|
1202
|
+
starttime = tz.localize(mtime)
|
|
1189
1203
|
|
|
1190
|
-
fmt = '%Y-%m-%dT%H:%M:%S.%f%z'
|
|
1191
|
-
if sys.version_info > (3, 6):
|
|
1192
|
-
starttime = mtime.replace(tzinfo=tz)
|
|
1193
|
-
else:
|
|
1194
|
-
starttime = tz.localize(mtime)
|
|
1195
1204
|
return str(starttime.strftime(fmt))
|
|
1196
1205
|
|
|
1197
1206
|
def _endRecordList(self, recordlist):
|
|
@@ -1336,6 +1345,8 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1336
1345
|
|
|
1337
1346
|
sid = self.__serial
|
|
1338
1347
|
fdir, fname = os.path.split(self.filename)
|
|
1348
|
+
if bool(self.__getEnvVar("ScanFileInScanNameDir", False)):
|
|
1349
|
+
fdir = os.path.dirname(os.path.abspath(fdir))
|
|
1339
1350
|
sname, fext = os.path.splitext(fname)
|
|
1340
1351
|
beamtimeid = self.beamtimeid()
|
|
1341
1352
|
defprefix = "scicat-datasets-"
|
|
@@ -1407,6 +1418,8 @@ class NXS_FileRecorder(BaseFileRecorder):
|
|
|
1407
1418
|
|
|
1408
1419
|
sid = self.__serial
|
|
1409
1420
|
fdir, fname = os.path.split(self.filename)
|
|
1421
|
+
if bool(self.__getEnvVar("ScanFileInScanNameDir", False)):
|
|
1422
|
+
fdir = os.path.dirname(os.path.abspath(fdir))
|
|
1410
1423
|
sname, fext = os.path.splitext(fname)
|
|
1411
1424
|
# beamtimeid = self.beamtimeid()
|
|
1412
1425
|
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
sardananxsrecorder/__init__.py,sha256=GktUxiQNBhdbje4E9WlYbikp7LfZxiGHRK8eBCiEf1U,896
|
|
2
|
-
sardananxsrecorder/nxsrecorder.py,sha256=n8QAbHwDbcJzHgFzR2wDhL9sdEBMqhj33T6BdKXyNvs,57947
|
|
3
|
-
sardana_nxsrecorder-3.26.0.dist-info/METADATA,sha256=1JlJrVuAujdNy7IUw-tKBo3OKAYpcPH5YnDwNExBuYA,8035
|
|
4
|
-
sardana_nxsrecorder-3.26.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
5
|
-
sardana_nxsrecorder-3.26.0.dist-info/top_level.txt,sha256=YdD3m417i-jlYyQWgiizgZ8lQQcOjM8y-bmUHrGkfY4,19
|
|
6
|
-
sardana_nxsrecorder-3.26.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|