Skip to content

Commit

Permalink
PEP8 friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Burch authored and Jacob Burch committed Jul 8, 2009
1 parent 6255141 commit 2ecee60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prowlpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
API_DOMAIN = 'https://prowl.weks.net/publicapi'

class Prowl(object):
def __init__(self,apikey,username=None,password=None):
def __init__(self, apikey, username=None, password=None):
self.apikey = apikey
self.username = username #Currently not in use
self.password = password #Currently not in use

def post(self,application=None,event=None,description=None):
def post(self, application=None, event=None, description=None):
# Create the http object
h = httplib2.Http(".cache")
#h.add_credentials(self.username,self.password)
Expand All @@ -36,7 +36,7 @@ def post(self,application=None,event=None,description=None):
verify_resp,verify_content = h.request("%s/verify?apikey=%s" % \
(API_DOMAIN,self.apikey))

if verify_resp['status']!='200':
if verify_resp['status'] != '200':
raise Exception("Invalid API Key %s" % verify_content)

# Perform the request and get the response headers and content
Expand All @@ -45,9 +45,9 @@ def post(self,application=None,event=None,description=None):
url = "%s/add?application=%s&event=%s&description=%s&apikey=%s" \
% (API_DOMAIN,application, event, description,self.apikey)

if resp['status']=='200':
if resp['status'] == '200':
return True
elif resp['status']=='401':
elif resp['status'] == '401':
raise Exception("Auth Failed %s" % url)
else:
raise Exception("Failed")

0 comments on commit 2ecee60

Please sign in to comment.