logs-py 3.0.5__py3-none-any.whl → 3.0.6__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.

Potentially problematic release.


This version of logs-py might be problematic. Click here for more details.

@@ -12,6 +12,17 @@ class DateTimeConverter:
12
12
  utc_offset_re = re.compile(r"([\+-])(\d+)$")
13
13
  multiSpace_re = re.compile(r"( {2,})")
14
14
 
15
+ @classmethod
16
+ def _getLocalTime(cls):
17
+ import platform
18
+
19
+ if platform.system() == "Windows":
20
+ from tzlocal.win32 import get_localzone_name
21
+ return pytz.timezone(get_localzone_name())
22
+ else:
23
+ return pytz.timezone(time.tzname[0])
24
+
25
+
15
26
  @classmethod
16
27
  def convertDateTime(cls, entry: str):
17
28
  entry = re.sub(cls.multiSpace_re, " ", entry)
@@ -30,7 +41,7 @@ class DateTimeConverter:
30
41
 
31
42
  d = dates[0]
32
43
  if d.tzinfo == pytz.UTC or d.tzinfo is None:
33
- local_tz = pytz.timezone(time.tzname[0]) # Change to your local timezone
44
+ local_tz = cls._getLocalTime()
34
45
  d = d.replace(tzinfo=pytz.utc).astimezone(local_tz)
35
46
 
36
47
  return d
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: logs-py
3
- Version: 3.0.5
3
+ Version: 3.0.6
4
4
  Summary: A python interface for the LOGS public API
5
5
  Home-page: https://docs.logs-python.com
6
6
  Author: Sina Kazemi
@@ -19,6 +19,7 @@ Requires-Dist: regex>=2019.12.9
19
19
  Requires-Dist: Pillow
20
20
  Requires-Dist: deprecation
21
21
  Requires-Dist: pytz
22
+ Requires-Dist: tzlocal; platform_system == "Windows"
22
23
  Dynamic: author
23
24
  Dynamic: author-email
24
25
  Dynamic: classifier
@@ -4,7 +4,7 @@ LOGS/LOGSOptions.py,sha256=eDymNMLvms_DcM_71poUxcn7FkUH5K-zSZw28gMsVzs,271
4
4
  LOGS/ServerMetaData.py,sha256=WdXCCiCSFqER6s9c3N3v0O273OvxygxBzmE6_C8FmXs,3361
5
5
  LOGS/__init__.py,sha256=zFHOekiFfVI2SnyMhBJCCofrKTn1gXXC-rUk8A9mRw4,260
6
6
  LOGS/Auxiliary/Constants.py,sha256=jKsThb6TS6b1adgnv1uAoqohBJi8ySGo7fULHlE2Es0,2504
7
- LOGS/Auxiliary/DateTimeConverter.py,sha256=4yKS22tSnShDeEEHKMu_rgdtMYkkShEVftoReVwDDmQ,1178
7
+ LOGS/Auxiliary/DateTimeConverter.py,sha256=reUNCFNc4Bi3zHcwlnVzfR-YPRZXaQG5ShpvzLwB5M4,1433
8
8
  LOGS/Auxiliary/Decorators.py,sha256=dzuIa6eTi-iOwhD9A8eICum9XIFeh6QdcKrNWKQ4LEo,3572
9
9
  LOGS/Auxiliary/Exceptions.py,sha256=aurztbezP3RHKL8EaFDnGItDPnjkVugr2sagNWMeBKs,10084
10
10
  LOGS/Auxiliary/LOGSErrorResponse.py,sha256=5dm3Tv7tFtlo8ktuN1fQ1ScIHQWrAHlEtP6zg4_IO2E,1339
@@ -258,7 +258,7 @@ LOGS/Parameters/ParameterElement.py,sha256=fr6AlO_flKRygZZFx1OILP4P-2lV2Tx4PAe6W
258
258
  LOGS/Parameters/ParameterList.py,sha256=ijukB1__iKI5cefmOIIWz0wKaPz9Cx8KpD7Y7Gz2Pn0,1478
259
259
  LOGS/Parameters/ParameterTable.py,sha256=7Lew4DPgWmKcpV1T-1Pvt00kEI05FB383QqO-LHAjds,1758
260
260
  LOGS/Parameters/__init__.py,sha256=KpMSuBPx964v2YMZ1BqVp8vjrgSpuiW9KYBm-aejRuc,312
261
- logs_py-3.0.5.dist-info/METADATA,sha256=RO_xG6SgntQBnlTu9RnA9mpR5ULG30WN_25GGoCM3k4,2286
262
- logs_py-3.0.5.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
263
- logs_py-3.0.5.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
264
- logs_py-3.0.5.dist-info/RECORD,,
261
+ logs_py-3.0.6.dist-info/METADATA,sha256=LnTxXoCq_ClxYxHz-Kn5GpsYctPWilR-QetHeuSVSXk,2339
262
+ logs_py-3.0.6.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
263
+ logs_py-3.0.6.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
264
+ logs_py-3.0.6.dist-info/RECORD,,