How to use _performAction method in pyatom

Best Python code snippet using pyatom_python

amazon_ses.py

Source:amazon_ses.py Github

copy

Full Screen

...43 signature = self._getSignature(dateValue)44 headers['X-Amzn-Authorization'] = 'AWS3-HTTPS AWSAccessKeyId=%s, Algorithm=HMACSHA256, Signature=%s' % (self._accessKeyID, signature)45 return headers46 47 def _performAction(self, actionName, params=None):48 if not params:49 params = {}50 params['Action'] = actionName 51 #https://email.us-east-1.amazonaws.com/52 conn = httplib.HTTPSConnection('email.us-east-1.amazonaws.com')53 params = urllib.urlencode(params)54 conn.request('POST', '/', params, self._getHeaders())55 response = conn.getresponse()56 responseResult = response.read()57 conn.close()58 return self._responseParser.parse(actionName, response.status, response.reason, responseResult)59 60 def verifyEmailAddress(self, emailAddress):61 params = { 'EmailAddress': emailAddress }62 return self._performAction('VerifyEmailAddress', params)63 64 def deleteVerifiedEmailAddress(self, emailAddress):65 params = { 'EmailAddress': emailAddress }66 return self._performAction('DeleteVerifiedEmailAddress', params)67 68 def getSendQuota(self):69 return self._performAction('GetSendQuota')70 71 def getSendStatistics(self):72 return self._performAction('GetSendStatistics')73 74 def listVerifiedEmailAddresses(self):75 return self._performAction('ListVerifiedEmailAddresses')76 77 def sendEmail(self, source, toAddresses, message, replyToAddresses=None, returnPath=None, ccAddresses=None, bccAddresses=None, headers={}):78 params = { 'Source': source }79 for objName, addresses in zip(["ToAddresses", "CcAddresses", "BccAddresses"], [toAddresses, ccAddresses, bccAddresses]):80 if addresses:81 if not isinstance(addresses, basestring) and getattr(addresses, '__iter__', False):82 for i, address in enumerate(addresses, 1):83 params['Destination.%s.member.%d' % (objName, i)] = address84 else:85 params['Destination.%s.member.1' % objName] = addresses 86 if not returnPath:87 returnPath = source88 params['ReturnPath'] = returnPath 89 params['Message.Subject.Charset'] = message.charset90 params['Message.Subject.Data'] = message.subject91 if message.bodyText:92 params['Message.Body.Text.Charset'] = message.charset93 params['Message.Body.Text.Data'] = message.bodyText94 if message.bodyHtml:95 params['Message.Body.Html.Charset'] = message.charset96 params['Message.Body.Html.Data'] = message.bodyHtml97 if headers:98 params.update(headers)99 return self._performAction('SendEmail', params)100class EmailMessage:101 def __init__(self):102 self.charset = 'UTF-8'103 self.subject = None104 self.bodyHtml = None105 self.bodyText = None 106class AmazonError(Exception):107 def __init__(self, errorType, code, message):108 self.errorType = errorType109 self.code = code110 self.message = message111 def __unicode__(self):112 return '%s %s %s' % (str(self.errorType), str(self.code), str(self.message))113 def __str__(self):...

Full Screen

Full Screen

boolean.py

Source:boolean.py Github

copy

Full Screen

...42 contours = glyph.contours43 subjectContours = contours[:1]44 clipContours = contours[1:]45 return subjectContours, clipContours46 def _performAction(self, glyph, action):47 subjectContours, clipContours = self._getContours(glyph)48 action(glyph, subjectContours, clipContours)49 def unionActionCallback(self, glyph):50 self._performAction(glyph, booleanOperations.union)51 def differenceActionCallback(self, glyph):52 self._performAction(glyph, booleanOperations.difference)53 def intersectionActionCallback(self, glyph):54 self._performAction(glyph, booleanOperations.intersection)55 def xorActionCallback(self, glyph):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyatom automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful