diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:59:36 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 16:59:36 +0200 |
| commit | edca8b7407d7c9b1497ba1722d1b66ffa4b4c234 (patch) | |
| tree | d544987379415ac557751401ea0b0c7de81530b7 /client/app_utils.py | |
| parent | 890a5798fcf7f9b9dc06529aa4bc7fe903d7ca1a (diff) | |
| parent | 804da384bff556d3caedf9ad01d57f2460aee151 (diff) | |
| download | jasper-client-edca8b7407d7c9b1497ba1722d1b66ffa4b4c234.tar.gz jasper-client-edca8b7407d7c9b1497ba1722d1b66ffa4b4c234.zip | |
Merge pull request #217 from Holzhaus/style-fixes
Style fixes
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): |
