Skip to content

use raw python strings to eliminate python warnings #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scripts/generate_controls_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# File Header:
def GetHeader():
return """# How to Use the Intercept Layer for OpenCL Applications
return r"""# How to Use the Intercept Layer for OpenCL Applications

This file is automatically generated using the script `generate_controls_doc.py`.
Please do not edit it manually!
Expand Down Expand Up @@ -145,7 +145,7 @@ def GetHeader():

# File Footer:
def GetFooter():
return """
return r"""
---

\* Other names and brands may be claimed as the property of others.
Expand Down Expand Up @@ -184,7 +184,7 @@ def GetFooter():
numberOfControls = 0

for line in srcFile:
separator = re.search("^CLI_CONTROL_SEPARATOR\((.*)\)$", line)
separator = re.search(r"^CLI_CONTROL_SEPARATOR\((.*)\)$", line)
if separator:
full = separator.group(1).strip()

Expand All @@ -198,7 +198,7 @@ def GetFooter():
numberOfSeparators = numberOfSeparators + 1
continue

control = re.search("^CLI_CONTROL\((.*)\)$", line)
control = re.search(r"^CLI_CONTROL\((.*)\)$", line)
if control:
full = control.group(1).strip()

Expand All @@ -218,8 +218,8 @@ def GetFooter():
# Replace underscores with escaped underscores:
description = description.replace("_", "\\_")
# Escape angle brackets:
description = description.replace("<", "\<")
description = description.replace(">", "\>")
description = description.replace("<", r"\<")
description = description.replace(">", r"\>")

docFile.write('##### `' + name + '` (' + type + ')\n\n')
docFile.write(description + '\n\n')
Expand Down