Skip to content

Commit

Permalink
client: replace dirty hack by usage of standard library
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Allard committed Jul 3, 2012
1 parent e9dffc0 commit 9b2271a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/fitbit_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import sys
import urllib
import urllib2
import urlparse
import base64
import xml.etree.ElementTree as et
from fitbit import FitBit
Expand All @@ -65,7 +66,8 @@ def __init__(self, response):
self.path = self.root.find("response").attrib["path"]
if self.root.find("response").text:
# Quick and dirty url encode split
self.response = dict([x.split("=") for x in urllib.unquote(self.root.find("response").text).split("&")])
response = self.root.find("response").text
self.response = dict(urlparse.parse_qsl(response))

for opcode in self.root.findall("device/remoteOps/remoteOp"):
op = {}
Expand Down

0 comments on commit 9b2271a

Please sign in to comment.