~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Aaron Bentley
  • Date: 2012-01-11 13:31:08 UTC
  • Revision ID: aaron@canonical.com-20120111133108-9ijvfo7quc49wmm8
Retrieve messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
    def archive_url(self, archive_name, query):
19
19
        path = '/%s' % quote(archive_name)
20
 
        query_string = urlencode(query)
21
 
        return urlunparse(('http', self.netloc, path, '', query_string, ''))
 
20
        query = urlencode(query)
 
21
        return urlunparse(('http', self.netloc, path, '', query, ''))
22
22
 
23
23
    def _get_connection(self):
 
24
        print 'Connecting to %s' % self.port
24
25
        return httplib.HTTPConnection(self.host, self.port)
25
26
 
26
27
    def _verb_archive(self, verb, archive_name, query, body=None):
27
28
        url = self.archive_url(archive_name, query)
 
29
        print "URL: %s" % url
28
30
        connection = self._get_connection()
29
31
        connection.request(verb, url, body)
30
32
        return connection.getresponse()