Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
three_legged removed from __init__
Browse files Browse the repository at this point in the history
urls as a static
  • Loading branch information
zalun committed Oct 8, 2012
1 parent 58fdf42 commit 4c36ff5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions marketplace/client.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
MARKETPLACE_DOMAIN = 'marketplace.mozilla.org' MARKETPLACE_DOMAIN = 'marketplace.mozilla.org'
MARKETPLACE_PROTOCOL = 'https' MARKETPLACE_PROTOCOL = 'https'


urls = {'validate': '/apps/validation/', URLS = {'validate': '/apps/validation/',
'validation_result': '/apps/validation/%s/', 'validation_result': '/apps/validation/%s/',
'create': '/apps/app/', 'create': '/apps/app/',
'app': '/apps/app/%s/', 'app': '/apps/app/%s/',
Expand All @@ -42,13 +42,12 @@ class Client:
def __init__(self, domain=MARKETPLACE_DOMAIN, def __init__(self, domain=MARKETPLACE_DOMAIN,
protocol=MARKETPLACE_PROTOCOL, protocol=MARKETPLACE_PROTOCOL,
port=MARKETPLACE_PORT, port=MARKETPLACE_PORT,
prefix='', three_legged=False, prefix='',
consumer_key=None, consumer_secret=None): consumer_key=None, consumer_secret=None):
self.domain = domain self.domain = domain
self.protocol = protocol self.protocol = protocol
self.port = port self.port = port
self.prefix = prefix self.prefix = prefix
self.three_legged = three_legged
self.conn = None self.conn = None
if consumer_secret and consumer_key: if consumer_secret and consumer_key:
self.conn = self.get_connection(consumer_key, consumer_secret) self.conn = self.get_connection(consumer_key, consumer_secret)
Expand All @@ -61,7 +60,7 @@ def url(self, key):
"""Creates a full URL to the API using urls dict """Creates a full URL to the API using urls dict
""" """
return urlunparse((self.protocol, '%s:%s' % (self.domain, self.port), return urlunparse((self.protocol, '%s:%s' % (self.domain, self.port),
'%s/api%s' % (self.prefix, urls[key]), '%s/api%s' % (self.prefix, URLS[key]),
'', '', '')) '', '', ''))


def validate_manifest(self, manifest_url): def validate_manifest(self, manifest_url):
Expand Down

0 comments on commit 4c36ff5

Please sign in to comment.