Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

Commit

Permalink
Secret key
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rusev committed Aug 4, 2012
1 parent 57bcb37 commit b6e8577
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions amonpy/config.py
@@ -1,19 +1,19 @@
class AmonConfig(dict):

def __init__(self):
self._app_key = None
self._secret_key = None
self._address = 'http://127.0.0.1:2464'
self._protocol = 'http'
self._file = None
self._offline = None

def get_application_key(self):
return self._app_key
def get_secret_key(self):
return self._secret_key

def set_application_key(self, app_key):
self._app_key = app_key
def set_secret_key(self, secret_key):
self._secret_key = secret_key

application_key = property(get_application_key, set_application_key)
secret_key = property(get_secret_key, set_secret_key)

def get_address(self):
return self._address
Expand Down
8 changes: 4 additions & 4 deletions amonpy/protocols/http.py
Expand Up @@ -14,10 +14,10 @@ def post_http(data, type=None):
elif type == 'exception':
url = "{0}/api/exception".format(url)

# Append the application key if present
application_key = config.application_key
if application_key:
url = "{0}/{1}".format(url, config.application_key)
# Append the secret key if present
secret_key = config.application_key
if secret_key:
url = "{0}/{1}".format(url, secret_key)

# Don't post the data if offline is true
if not config.offline:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
@@ -1,6 +1,6 @@
from setuptools import setup

version = '0.4.2'
version = '0.4.4'

setup(
name='amonpy',
Expand Down

0 comments on commit b6e8577

Please sign in to comment.