Skip to content

Commit

Permalink
Update workflow.py
Browse files Browse the repository at this point in the history
fixing bug
  • Loading branch information
passcombo authored Feb 17, 2020
1 parent 76522ed commit b44d983
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pylib/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ def download_att(json_obj,msg_id,pp,att_name,print_content=False): # OK
att_downloaded_list=mbox.download_msg_id_att(mail_from , mail_from_pswd , imap_addr, msg_id)
if print_content:
for ijk in att_downloaded_list:
if '.txt' in ijk.lower():
asdf=ijk.lower().split('.')
# print(asdf,len(asdf),asdf[-1])
if asdf[-1]=='txt' :
print('File content:\n',iop.readfile(ijk))

else:
Expand All @@ -495,9 +497,12 @@ def download_att(json_obj,msg_id,pp,att_name,print_content=False): # OK

iter+=1

if print_content and '.txt' in tmppath.lower():
asdf=tmppath.lower().split('.')
# print(asdf,len(asdf),asdf[-1])

if print_content and 'txt' ==asdf[-1]:
print('File content:\n',iop.readfile(tmppath))

return iter # number of attachments downloaded to archive - total



0 comments on commit b44d983

Please sign in to comment.