Skip to content

Commit

Permalink
Fix RE backslashes (raw strings)
Browse files Browse the repository at this point in the history
  • Loading branch information
eudoxos committed May 13, 2024
1 parent cb077ee commit ee563aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mupifDB/restApiControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def updateWorkflow(data):

def fix_json(val):
import re
val = re.sub(",[ \t\r\n]+}", "}", val)
val = re.sub(",[ \t\r\n]+\]", "]", val)
val = re.sub(r",[ \t\r\n]+}", "}", val)
val = re.sub(r",[ \t\r\n]+\]", "]", val)
val = val.replace("False", "false").replace("True", "true")
val
return val
Expand Down
8 changes: 4 additions & 4 deletions mupifDB/workflowmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def checkInputs(eid):
valueType = input_template['ValueType']
data_id = input_template['TypeID']
# try to get raw PID from typeID
match = re.search('\w+\Z', data_id)
match = re.search(r'\w+\Z', data_id)
if match:
data_id = match.group()

Expand Down Expand Up @@ -731,7 +731,7 @@ def mapInputs(app, eid):
object_type = input_template.get('Type', '')
data_id = input_template.get('TypeID', input_template.get('Type_ID'))
# try to get raw PID from typeID
match = re.search('\w+\Z', data_id)
match = re.search(r'\w+\Z', data_id)
if match:
data_id = match.group()

Expand Down Expand Up @@ -775,7 +775,7 @@ def getEDMListLength(app, eid, edm_name, outputs):
object_type = outitem['Type']
typeID = outitem.get('TypeID', outitem.get('Type_ID'))
# try to get raw PID from typeID
match = re.search('\w+\Z', typeID)
match = re.search(r'\w+\Z', typeID)
if match:
typeID = match.group()

Expand Down Expand Up @@ -1114,7 +1114,7 @@ def mapOutputs(app, eid, time):
object_type = outitem['Type']
typeID = outitem.get('TypeID', outitem.get('Type_ID'))
# try to get raw PID from typeID
match = re.search('\w+\Z', typeID)
match = re.search(r'\w+\Z', typeID)
if match:
typeID = match.group()

Expand Down

0 comments on commit ee563aa

Please sign in to comment.