Skip to content

Commit

Permalink
re commit mp3 fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nkan-aot2 authored Jan 29, 2025
1 parent c8378bb commit 063e581
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions computingservices/ZippingServices/services/zipperservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import json
import traceback
import PyPDF2
from os import path

def processmessage(message):
try:
Expand Down Expand Up @@ -113,16 +114,18 @@ def __zipfilesandupload(_message, s3credentials):

_docbytes = __getdocumentbytearray(fileobj, s3credentials)
_formattedbytes = None

try:
_formattedbytes = __removesensitivecontent(_docbytes)
if _formattedbytes is not None:
print("_formattedbytes length is {0}".format(len(_formattedbytes)))
else:
print("_formattedbytes is none")
except Exception:
print("error happened while removing sensitive content of {0} ".format(filename))
print(traceback.format_exc())
_filename, extension = path.splitext(fileobj["s3uripath"])

if extension.lower() == '.pdf':
try:
_formattedbytes = __removesensitivecontent(_docbytes)
if _formattedbytes is not None:
print("_formattedbytes length is {0}".format(len(_formattedbytes)))
else:
print("_formattedbytes is none")
except Exception:
print("error happened while removing sensitive content of {0} ".format(filename))
print(traceback.format_exc())
#added a space to try out code merge on git. 18-Sept-2024
zip.writestr(
filename, _docbytes if _formattedbytes is None else _formattedbytes
Expand Down

0 comments on commit 063e581

Please sign in to comment.