Skip to content

Commit

Permalink
fix pytest deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HotNoob committed Jul 31, 2024
1 parent 88ff1a7 commit 3bcf70a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/protocol_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def determine_delimiter(first_row) -> str:
if first_row.count(';') < first_row.count(','):
delimeter = ','

first_row = re.sub(r"\s+" + re.escape(delimeter) +"|" + re.escape(delimeter) +"\s+", delimeter, first_row) #trim values
first_row = re.sub(r"\s+" + re.escape(delimeter) +"|" + re.escape(delimeter) +r"\s+", delimeter, first_row) #trim values

csvfile = itertools.chain([first_row], csvfile) #add clean header to begining of iterator

Expand Down Expand Up @@ -379,7 +379,7 @@ def determine_delimiter(first_row) -> str:
variable_name = row['variable name'] if row['variable name'] else row['documented name']
variable_name = variable_name = variable_name.strip().lower().replace(' ', '_').replace('__', '_') #clean name

if re.search("[^a-zA-Z0-9\_]", variable_name) :
if re.search(r"[^a-zA-Z0-9\_]", variable_name) :
print("WARNING Invalid Name : " + str(variable_name) + " reg: " + str(row['register']) + " doc name: " + str(row['documented name']) + " path: " + str(path))

#convert to float
Expand Down Expand Up @@ -913,7 +913,7 @@ def validate_registry_entry(self, entry : registry_map_entry, val) -> int:
return 0

if entry.data_type == Data_Type.ASCII:
if val and not re.match('[^a-zA-Z0-9\_\-]', val): #validate ascii
if val and not re.match(r'[^a-zA-Z0-9\_\-]', val): #validate ascii
if entry.value_regex: #regex validation
if re.match(entry.value_regex, val):
if entry.concatenate:
Expand Down

0 comments on commit 3bcf70a

Please sign in to comment.