wcp-library 1.0.1__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {wcp_library-1.0.1 → wcp_library-1.0.3}/PKG-INFO +1 -1
  2. {wcp_library-1.0.1 → wcp_library-1.0.3}/pyproject.toml +1 -1
  3. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_credentials/oracle.py +1 -1
  4. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_credentials/postgres.py +1 -1
  5. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_sql/oracle.py +1 -1
  6. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/emailing.py +4 -3
  7. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/sql/oracle.py +1 -1
  8. {wcp_library-1.0.1 → wcp_library-1.0.3}/README.md +0 -0
  9. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/__init__.py +0 -0
  10. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_credentials/__init__.py +0 -0
  11. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_credentials/api.py +0 -0
  12. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_sql/__init__.py +0 -0
  13. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/async_sql/postgres.py +0 -0
  14. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/credentials/__init__.py +0 -0
  15. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/credentials/api.py +0 -0
  16. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/credentials/oracle.py +0 -0
  17. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/credentials/postgres.py +0 -0
  18. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/informatica.py +0 -0
  19. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/logging.py +0 -0
  20. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/sql/__init__.py +0 -0
  21. {wcp_library-1.0.1 → wcp_library-1.0.3}/wcp_library/sql/postgres.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wcp-library
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Common utilites for internal development at WCP
5
5
  Home-page: https://github.com/Whitecap-DNA/WCP-Library
6
6
  Author: Mitch-Petersen
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wcp-library"
3
- version = "1.0.1"
3
+ version = "1.0.3"
4
4
  description = "Common utilites for internal development at WCP"
5
5
  authors = ["Mitch-Petersen <mitch.petersen@wcap.ca>"]
6
6
  readme = "README.md"
@@ -122,7 +122,7 @@ class AsyncOracleCredentialManager:
122
122
  }
123
123
 
124
124
  async with aiohttp.ClientSession() as session:
125
- async with session.put(str(self.password_url), json=data, headers=self.headers) as response:
125
+ async with session.post(str(self.password_url), json=data, headers=self.headers) as response:
126
126
  if response.status == 201:
127
127
  logger.debug(f"New credentials for {credentials_dict['UserName']} created")
128
128
  return True
@@ -121,7 +121,7 @@ class AsyncPostgresCredentialManager:
121
121
  }
122
122
 
123
123
  async with aiohttp.ClientSession() as session:
124
- async with session.put(str(self.password_url), json=data, headers=self.headers) as response:
124
+ async with session.post(str(self.password_url), json=data, headers=self.headers) as response:
125
125
  if response.status == 201:
126
126
  logger.debug(f"New credentials for {credentials_dict['UserName']} created")
127
127
  return True
@@ -78,7 +78,7 @@ class AsyncOracleConnection(object):
78
78
  :return: None
79
79
  """
80
80
 
81
- if not any([self._database, self._sid]):
81
+ if not all([credentials_dict['Service'], credentials_dict['SID']]):
82
82
  raise ValueError("Either Service or SID must be provided")
83
83
 
84
84
  self._username: Optional[str] = credentials_dict['UserName']
@@ -2,6 +2,7 @@ import smtplib
2
2
  from email import encoders
3
3
  from email.mime.base import MIMEBase
4
4
  from email.mime.multipart import MIMEMultipart
5
+ from email.mime.text import MIMEText
5
6
  from email.utils import formatdate
6
7
  from pathlib import Path
7
8
 
@@ -22,7 +23,7 @@ def send_email(sender: str, recipients: list, subject: str, message=None):
22
23
  msg['To'] = ", ".join(recipients)
23
24
  msg['Date'] = formatdate(localtime=True)
24
25
  msg['Subject'] = subject
25
- msg.attach(message)
26
+ msg.attach(MIMEText(message))
26
27
 
27
28
  smtpServer = 'mail.wcap.ca'
28
29
  server = smtplib.SMTP(smtpServer, 25)
@@ -45,7 +46,7 @@ def email_reporting(subject: str, message: str):
45
46
  msg['To'] = "Reporting@wcap.ca"
46
47
  msg['Date'] = formatdate(localtime=True)
47
48
  msg['Subject'] = subject
48
- msg.attach(message)
49
+ msg.attach(MIMEText(message))
49
50
 
50
51
  smtpServer = 'mail.wcap.ca'
51
52
  server = smtplib.SMTP(smtpServer, 25)
@@ -73,7 +74,7 @@ def email_with_attachments(sender: str, recipients: list, subject: str, message=
73
74
  msg['To'] = ", ".join(recipients)
74
75
  msg['Date'] = formatdate(localtime=True)
75
76
  msg['Subject'] = subject
76
- msg.attach(message)
77
+ msg.attach(MIMEText(message))
77
78
 
78
79
  for attachment in attachments:
79
80
  part = MIMEBase('application', "octet-stream")
@@ -76,7 +76,7 @@ class OracleConnection(object):
76
76
  :return: None
77
77
  """
78
78
 
79
- if not any([self._database, self._sid]):
79
+ if not all([credentials_dict['Service'], credentials_dict['SID']]):
80
80
  raise ValueError("Either Service or SID must be provided")
81
81
 
82
82
  self._username: Optional[str] = credentials_dict['UserName']
File without changes