From 7a59224ad54ff5f5fe28c187c1d52fe5a1942e90 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 3 May 2011 15:43:23 +0200 Subject: damn unicode --- src/meetingtools/ac/api.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/meetingtools/ac/api.py b/src/meetingtools/ac/api.py index 62ae26c..59aa2d8 100644 --- a/src/meetingtools/ac/api.py +++ b/src/meetingtools/ac/api.py @@ -5,7 +5,7 @@ Created on Jan 31, 2011 ''' import httplib2 -from urllib import quote +from urllib import quote, urlencode import logging from pprint import pformat import os @@ -71,16 +71,11 @@ class ACPClient(): self._cache = {'login':{},'group':{}} def request(self,method,p={},raise_error=False): - url = self.url+"?"+"action=%s" % method if self.session: - url = url + "&session=%s" % self.session + p['session'] = self.session + p['action'] = method - u = [] - for (k,v) in p.items(): - if v: - kv = "%s=%s" % (k,quote(v)) - u.append(kv) - url = url + "&" + "&".join(u) + url = self.url + '?' + urlencode(p) h = httplib2.Http(tempfile.gettempdir()+os.sep+".cache"); logging.debug(url) -- cgit v1.1