Skip to content

Commit

Permalink
Merge pull request #210 from tableau/development
Browse files Browse the repository at this point in the history
Merge changes for VizAlerts 2.2.1
  • Loading branch information
mcoles authored Oct 10, 2023
2 parents 6855bf3 + fb43c68 commit 7da5975
Show file tree
Hide file tree
Showing 8 changed files with 1,776 additions and 857 deletions.
2 changes: 1 addition & 1 deletion .idea/VizAlerts.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

253 changes: 172 additions & 81 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2,358 changes: 1,590 additions & 768 deletions config/VizAlertsConfig.twb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

includes = []
includefiles = os.listdir('C:\\Python38\\Lib\\site-packages\\phonenumbers\\data')
includefiles = os.listdir('C:\\Users\\mcoles\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\phonenumbers\\data')
for file in includefiles:
if file.endswith('.py'):
includes.append('phonenumbers.data.' + file.replace('.py', ''))
Expand Down
2 changes: 1 addition & 1 deletion tabUtil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_yaml_file(yaml_file):
logger = logging.getLogger()
try:
f = codecs.open(yaml_file, encoding='utf-8')
yaml_opts = yaml.load(f)
yaml_opts = yaml.safe_load(f)
f.close()
return yaml_opts
except:
Expand Down
4 changes: 3 additions & 1 deletion version_history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Version 2.2.1
=================================
-Fixed issue where mixed action flag values used with consolidate lines can cause no emails to send (Issue #198)
-Fixed unsafe yaml.load call (Issue #195)
-Updated config workbook to use new projects_contents mapping table (Issue #203)
-Fixed MyPDF2 library issue (Issue #205)
=================================

Version 2.2.0
Expand Down Expand Up @@ -168,4 +170,4 @@ Version 1.0.1

Version 1.0.0
=================================
=================================
=================================
10 changes: 7 additions & 3 deletions vizalert/vizalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import threading
import datetime
import time
from PyPDF2 import PdfFileReader, PdfFileMerger
from PyPDF2 import PdfReader, PdfMerger
from collections import OrderedDict
from os.path import abspath, basename, expanduser
from operator import itemgetter
Expand Down Expand Up @@ -1927,14 +1927,18 @@ def merge_pdf_attachments(appendattachments):
# we know all attachments in a given list have the same filename due to the loop above
# so we can just pull the first one

merger = PdfFileMerger()
try:
merger = PdfMerger()
except Exception as e:
log.logger.error('Could not instantiate PdfMerger class. May indicate an issue with module incompatibility: {}'.format(mergedfilename, e))
raise e

i = 0
for attachment in mergedfilenames[listtomerge]:
if i == 0:
mergedfilename = mergedfilenames[listtomerge][attachment]['filename']

merger.append(PdfFileReader(mergedfilenames[listtomerge][attachment]['imagepath'], "rb"))
merger.append(PdfReader(mergedfilenames[listtomerge][attachment]['imagepath'], "rb"))
i = i + 1

# make the temp filename for the merged pdf
Expand Down

0 comments on commit 7da5975

Please sign in to comment.