File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 20
20
21
21
def inspect_image_file (
22
22
project_id = 'YOUR_PROJECT_ID' ,
23
- filepath = 'path/to/image.png' ):
23
+ file_path = 'path/to/image.png' ):
24
24
# Instantiate a client
25
25
dlp = google .cloud .dlp .DlpServiceClient ()
26
26
27
27
# 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 ()
30
30
31
31
# Construct request
32
32
parent = dlp .project_path (project_id )
@@ -57,4 +57,4 @@ def inspect_image_file(
57
57
58
58
59
59
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 ])
Original file line number Diff line number Diff line change 20
20
21
21
def inspect_text_file (
22
22
project_id = 'YOUR_PROJECT_ID' ,
23
- filepath = 'path/to/file.txt' ):
23
+ file_path = 'path/to/file.txt' ):
24
24
# Instantiate a client
25
25
dlp = google .cloud .dlp .DlpServiceClient ()
26
26
27
27
# 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 ()
30
30
31
31
# Construct request
32
32
parent = dlp .project_path (project_id )
@@ -57,4 +57,4 @@ def inspect_text_file(
57
57
58
58
59
59
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 ])
You can’t perform that action at this time.
0 commit comments