commonlib-reader 1.0.1__tar.gz → 1.0.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commonlib-reader
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Reader for Equinor commonlibapi.
5
5
  Home-page: https://github.com/equinor/commonlib-reader.git
6
6
  Author: Åsmund Våge Fannemel
@@ -103,17 +103,25 @@ class Facility:
103
103
  if isinstance(code, str):
104
104
  for f in cls._get_all_facility_data():
105
105
  if (
106
- f["identity"] == code
107
- or f["name"] == code
108
- or f["description"] == code
106
+ f["identity"].upper() == code.upper()
107
+ or f["name"].upper() == code.upper()
108
+ or f["description"].upper() == code.upper()
109
109
  ):
110
110
  return f
111
111
 
112
112
  for f in cls._get_all_facility_data():
113
+ check_sap = False
114
+ check_gov_fac_name = False
113
115
  for a in f["attributes"]:
114
116
  if a["definitionName"] == "SAPPlant":
115
117
  if a["displayValue"] == str(code):
116
118
  return f
119
+ check_sap = True
120
+ elif a["definitionName"] == "GovernmentalName":
121
+ if a["displayValue"].upper() == str(code).upper():
122
+ return f
123
+ check_gov_fac_name = True
124
+ if check_sap and check_gov_fac_name:
117
125
  break
118
126
 
119
127
  raise ValueError(f"No data found for {code}")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "commonlib-reader"
3
- version = "1.0.1"
3
+ version = "1.0.2"
4
4
  description = "Reader for Equinor commonlibapi."
5
5
  authors = ["Åsmund Våge Fannemel <asmf@equinor.com>"]
6
6
  readme = "README.md"