Skip to content

Commit e2f11a2

Browse files
committed
fix var names
1 parent cdece35 commit e2f11a2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dlp/dlp_inspect_image_file.py

Lines 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

Lines 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)