Skip to content

Commit

Permalink
revert to main code
Browse files Browse the repository at this point in the history
  • Loading branch information
nkan-aot2 authored Jan 29, 2025
1 parent 37c4b47 commit c8378bb
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions computingservices/ZippingServices/services/zipperservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import json
import traceback
import PyPDF2
from os import path

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

_docbytes = __getdocumentbytearray(fileobj, s3credentials)
_formattedbytes = None
_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())

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 Expand Up @@ -176,4 +173,3 @@ def __getzipfilepath(foldername, filename):
if foldername is not None
else filename + ".zip"
)

0 comments on commit c8378bb

Please sign in to comment.