Skip to content

Commit

Permalink
Merge pull request #130 from MaRDI4NFDI/string_fixes
Browse files Browse the repository at this point in the history
string fixes
  • Loading branch information
LizzAlice authored Mar 18, 2024
2 parents 92a4925 + 874b62b commit 76b54d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mardi_importer/mardi_importer/zbmath/ZBMathSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,13 @@ def push(self):
time_string = None

if not self.conflict_string in info_dict["links"]:
pattern = re.compile(r'^([a-z][a-z\d+.-]*):([^][<>\"\x00-\x20\x7F])+$')
pattern = re.compile(
r"^([a-z][a-z\d+.-]*):([^][<>\"\x00-\x20\x7F])+$"
)
links = info_dict["links"].split(";")
links = [ x.strip() for x in links if (pattern.match(x) and "http" in x)]
links = [
x.strip() for x in links if (pattern.match(x) and "http" in x)
]
else:
links = []

Expand Down Expand Up @@ -441,6 +445,7 @@ def push(self):
and info_dict["review_sign"].strip() != "None"
and not self.conflict_string in info_dict["reviewer_id"]
and info_dict["reviewer_id"].strip() != "None"
and info_dict["reviewer_id"].strip() != ""
):
reviewer_id = info_dict["reviewer_id"].strip()
reviewer_name = (
Expand Down Expand Up @@ -485,6 +490,7 @@ def push(self):
if (
not self.conflict_string in info_dict["classifications"]
and info_dict["classifications"].strip() != "None"
and info_dict["classifications"].strip() != ""
):
classifications = info_dict["classifications"].strip().split(";")
else:
Expand All @@ -498,6 +504,7 @@ def push(self):
if (
not self.conflict_string in info_dict["keywords"]
and info_dict["keywords"].strip() != "None"
and info_dict["keywords"].strip() != ""
):
keywords = info_dict["keywords"].strip().split(";")
keywords = [x.strip() for x in keywords]
Expand Down

0 comments on commit 76b54d0

Please sign in to comment.