Skip to content

Commit

Permalink
Further constant string clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
htormey committed Mar 28, 2010
1 parent c7bbe96 commit 2dc3e80
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions snaptic.py
Expand Up @@ -201,14 +201,16 @@ class Api(object):
>> fout.write(d)
>> fout.close()
'''
API_SERVER = "api.snaptic.com"
API_VERSION = "v1"
HTTP_GET = "GET"
HTTP_POST = "POST"
HTTP_DELETE = "DELETE"
API_ENDPOINT_NOTES_JSON = "/notes.json"
API_ENDPOINT_NOTES = "/notes/"
API_ENDPOINT_IMAGES = "/images/"

API_SERVER = "api.snaptic.com"
API_VERSION = "v1"
HTTP_GET = "GET"
HTTP_POST = "POST"
HTTP_DELETE = "DELETE"
API_ENDPOINT_NOTES_JSON = "/notes.json"
API_ENDPOINT_NOTES = "/notes/"
API_ENDPOINT_IMAGES = "/images/"
API_ENDPOINT_IMAGES_VIEW = "/viewImage.action?viewNodeId="

def __init__(self, username, password=None, url=API_SERVER, use_ssl=True, port=443, timeout=10):
self._url = url
Expand Down Expand Up @@ -344,7 +346,7 @@ def get_image_with_id(self, id):
Get image data using the following id
'''
if id:
url = "/viewImage.action?viewNodeId=" + id
url = self.API_ENDPOINT_IMAGES_VIEW + id
return self._fetch_url(url)
else:
raise SnapticError("Error user id not set, try calling GetNotes.")
Expand Down

0 comments on commit 2dc3e80

Please sign in to comment.