19 lines
444 B
Python
19 lines
444 B
Python
|
from twilio.rest import Client
|
||
|
|
||
|
from py.lib.scwrypts import getenv
|
||
|
|
||
|
CLIENT = None
|
||
|
|
||
|
def get_client():
|
||
|
global CLIENT # pylint: disable=global-statement
|
||
|
|
||
|
if CLIENT is None:
|
||
|
print('loading client')
|
||
|
CLIENT = Client(
|
||
|
username = getenv('TWILIO__API_KEY'),
|
||
|
password = getenv('TWILIO__API_SECRET'),
|
||
|
account_sid = getenv('TWILIO__ACCOUNT_SID'),
|
||
|
)
|
||
|
|
||
|
return CLIENT
|