diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:52:53 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:52:53 +0200 |
| commit | 2b1e8411ab5eaa7e1349b78d03270ab02ae2950d (patch) | |
| tree | ed914cbf8964bbe26ba28e80589f4c289b3fac3a /client/app_utils.py | |
| parent | 890a5798fcf7f9b9dc06529aa4bc7fe903d7ca1a (diff) | |
| download | jasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.tar.gz jasper-client-2b1e8411ab5eaa7e1349b78d03270ab02ae2950d.zip | |
Fix flake8 style nits
Diffstat (limited to 'client/app_utils.py')
| -rw-r--r-- | client/app_utils.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/client/app_utils.py b/client/app_utils.py index cea6881..edc8467 100644 --- a/client/app_utils.py +++ b/client/app_utils.py @@ -3,7 +3,6 @@ import smtplib from email.MIMEText import MIMEText import urllib2 import re -import requests from pytz import timezone @@ -31,15 +30,18 @@ def sendEmail(SUBJECT, BODY, TO, FROM, SENDER, PASSWORD, SMTP_SERVER): def emailUser(profile, SUBJECT="", BODY=""): """ - Sends an email. + sends an email. - Arguments: - profile -- contains information related to the user (e.g., email address) + Arguments: + profile -- contains information related to the user (e.g., email + address) SUBJECT -- subject line of the email BODY -- body text of the email """ def generateSMSEmail(profile): - """Generates an email from a user's phone number based on their carrier.""" + """ + Generates an email from a user's phone number based on their carrier. + """ if profile['carrier'] is None or not profile['phone_number']: return None @@ -81,10 +83,11 @@ def emailUser(profile, SUBJECT="", BODY=""): def getTimezone(profile): """ - Returns the pytz timezone for a given profile. + Returns the pytz timezone for a given profile. - Arguments: - profile -- contains information related to the user (e.g., email address) + Arguments: + profile -- contains information related to the user (e.g., email + address) """ try: return timezone(profile['timezone']) @@ -94,9 +97,9 @@ def getTimezone(profile): def generateTinyURL(URL): """ - Generates a compressed URL. + Generates a compressed URL. - Arguments: + Arguments: URL -- the original URL to-be compressed """ target = "http://tinyurl.com/api-create.php?url=" + URL @@ -106,12 +109,13 @@ def generateTinyURL(URL): def isNegative(phrase): """ - Returns True if the input phrase has a negative sentiment. + Returns True if the input phrase has a negative sentiment. - Arguments: + Arguments: phrase -- the input phrase to-be evaluated """ - return bool(re.search(r'\b(no(t)?|don\'t|stop|end)\b', phrase, re.IGNORECASE)) + return bool(re.search(r'\b(no(t)?|don\'t|stop|end)\b', phrase, + re.IGNORECASE)) def isPositive(phrase): |
