Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2f11a2

Browse filesBrowse files
committed
fix var names
1 parent cdece35 commit e2f11a2
Copy full SHA for e2f11a2

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed

‎dlp/dlp_inspect_image_file.py

Copy file name to clipboardExpand all lines: dlp/dlp_inspect_image_file.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
def inspect_image_file(
2222
project_id='YOUR_PROJECT_ID',
23-
filepath='path/to/image.png'):
23+
file_path='path/to/image.png'):
2424
# Instantiate a client
2525
dlp = google.cloud.dlp.DlpServiceClient()
2626

2727
# Get the bytes of the file
28-
with open(filepath, mode='rb') as f:
29-
file_bytes = f.read()
28+
with open(file_path, mode='rb') as fh:
29+
file_bytes = fh.read()
3030

3131
# Construct request
3232
parent = dlp.project_path(project_id)
@@ -57,4 +57,4 @@ def inspect_image_file(
5757

5858

5959
if __name__ == '__main__':
60-
inspect_image_file(project_id=sys.argv[1], filepath=sys.argv[2])
60+
inspect_image_file(project_id=sys.argv[1], file_path=sys.argv[2])

‎dlp/dlp_inspect_text_file.py

Copy file name to clipboardExpand all lines: dlp/dlp_inspect_text_file.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
def inspect_text_file(
2222
project_id='YOUR_PROJECT_ID',
23-
filepath='path/to/file.txt'):
23+
file_path='path/to/file.txt'):
2424
# Instantiate a client
2525
dlp = google.cloud.dlp.DlpServiceClient()
2626

2727
# Get the bytes of the file
28-
with open(filepath, mode='rb') as f:
29-
file_bytes = f.read()
28+
with open(file_path, mode='rb') as fh:
29+
file_bytes = fh.read()
3030

3131
# Construct request
3232
parent = dlp.project_path(project_id)
@@ -57,4 +57,4 @@ def inspect_text_file(
5757

5858

5959
if __name__ == '__main__':
60-
inspect_text_file(project_id=sys.argv[1], filepath=sys.argv[2])
60+
inspect_text_file(project_id=sys.argv[1], file_path=sys.argv[2])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.