tagreader 6.1.0__tar.gz → 6.2.0__tar.gz

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.
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: tagreader
3
- Version: 6.1.0
3
+ Version: 6.2.0
4
4
  Summary: Tagreader is a Python package for reading trend data from the OSIsoft PI and Aspen Infoplus.21 IMS systems.
5
- License: MIT
5
+ License-Expression: MIT
6
+ License-File: LICENSE
6
7
  Keywords: Aspen InfoPlus.21,OSIsoft PI
7
8
  Author: Einar S. Idsø
8
9
  Author-email: eiids@equinor.com
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tagreader"
3
- version = "6.1.0"
3
+ version = "6.2.0"
4
4
  description = "Tagreader is a Python package for reading trend data from the OSIsoft PI and Aspen Infoplus.21 IMS systems."
5
5
  authors = [
6
6
  { name = "Einar S. Idsø", email = "eiids@equinor.com" },
@@ -117,7 +117,7 @@ def add_equinor_root_certificate() -> bool:
117
117
  logger.debug(
118
118
  "Unable to locate Equinor Root CA certificate on this host. Downloading from Equinor server."
119
119
  )
120
- response = requests.get("http://pki.equinor.com/aia/ecpr.crt")
120
+ response = requests.get("http://pki.equinor.com/aia/ecpr.crt", timeout=20)
121
121
 
122
122
  if response.status_code != 200:
123
123
  logger.error(
@@ -230,7 +230,8 @@ def is_equinor() -> bool:
230
230
  if hostname.lower().startswith("eqdev") or hostname.lower().startswith("eqpc"):
231
231
  return True
232
232
  with winreg.OpenKey( # type: ignore
233
- winreg.HKEY_LOCAL_MACHINE, r"SYSTEM\ControlSet001\Services\Tcpip\Parameters" # type: ignore
233
+ winreg.HKEY_LOCAL_MACHINE,
234
+ r"SYSTEM\ControlSet001\Services\Tcpip\Parameters", # type: ignore
234
235
  ) as key:
235
236
  domain = winreg.QueryValueEx(key, "Domain") # type: ignore
236
237
  if "statoil" in domain[0] or "equinor" in domain[0]:
@@ -282,7 +283,7 @@ def is_equinor() -> bool:
282
283
  return True
283
284
 
284
285
  s = subprocess.run(
285
- ["security", "find-certificate", "-a", "-c" "client.statoil.net"],
286
+ ["security", "find-certificate", "-a", "-cclient.statoil.net"],
286
287
  stdout=subprocess.PIPE,
287
288
  ).stdout
288
289
 
@@ -107,7 +107,7 @@ def list_aspenone_sources(
107
107
  url_ = urljoin(url, "DataSources")
108
108
  params = {"service": "ProcessData", "allQuotes": 1}
109
109
 
110
- res = requests.get(url_, params=params, auth=auth, verify=verify_ssl)
110
+ res = requests.get(url_, params=params, auth=auth, verify=verify_ssl, timeout=300)
111
111
  res.raise_for_status()
112
112
  try:
113
113
  source_list = [r["n"] for r in res.json()["data"] if r["t"] == "IP21"]
@@ -134,7 +134,7 @@ def list_piwebapi_sources(
134
134
  urllib3.disable_warnings(InsecureRequestWarning)
135
135
 
136
136
  url_ = urljoin(url, "dataservers")
137
- res = requests.get(url_, auth=auth, verify=verify_ssl)
137
+ res = requests.get(url_, auth=auth, verify=verify_ssl, timeout=300)
138
138
 
139
139
  res.raise_for_status()
140
140
  try:
@@ -162,7 +162,7 @@ def get_piwebapi_source_to_webid_dict(
162
162
  urllib3.disable_warnings(InsecureRequestWarning)
163
163
 
164
164
  url_ = urljoin(url, "dataservers")
165
- res = requests.get(url_, auth=auth, verify=verify_ssl)
165
+ res = requests.get(url_, auth=auth, verify=verify_ssl, timeout=300)
166
166
 
167
167
  res.raise_for_status()
168
168
  try:
@@ -316,12 +316,12 @@ class AspenHandlerWeb(BaseHandlerWeb):
316
316
  else:
317
317
  query = '<Q f="d" allQuotes="1">'
318
318
 
319
- query += "<Tag>" f"<N><![CDATA[{tagname}]]></N>"
319
+ query += f"<Tag><N><![CDATA[{tagname}]]></N>"
320
320
 
321
321
  if mapname:
322
322
  query += f"<M><![CDATA[{mapname}]]></M>"
323
323
 
324
- query += f"<D><![CDATA[{self.datasource}]]></D>" "<F><![CDATA[VAL]]></F>"
324
+ query += f"<D><![CDATA[{self.datasource}]]></D><F><![CDATA[VAL]]></F>"
325
325
 
326
326
  if read_type == ReaderType.SNAPSHOT:
327
327
  query += "<VS>1</VS>"
@@ -843,10 +843,10 @@ class PIHandlerWeb(BaseHandlerWeb):
843
843
  if self._is_summary(read_type):
844
844
  params["selectedFields"] = "Links;Items.Value.Timestamp;Items.Value.Value"
845
845
  if get_status:
846
- params["selectedFields"] += (
847
- ";Items.Value.Good"
848
- ";Items.Value.Questionable"
849
- ";Items.Value.Substituted"
846
+ params[
847
+ "selectedFields"
848
+ ] += (
849
+ ";Items.Value.Good;Items.Value.Questionable;Items.Value.Substituted"
850
850
  )
851
851
  elif read_type in [ReaderType.INT, ReaderType.RAW, ReaderType.SHAPEPRESERVING]:
852
852
  params["selectedFields"] = "Links;Items.Timestamp;Items.Value"
File without changes
File without changes
File without changes
File without changes