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 2020
2121def 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
5959if __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 2020
2121def 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
5959if __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