From ea8cbdcb670dcda1eb452564f59bbc8a6fdb30d8 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Wed, 4 Sep 2013 23:27:58 -0700 Subject: [PATCH] using wakatime package v0.4.3 --- plugin/packages/wakatime/HISTORY.rst | 6 ++++++ plugin/packages/wakatime/README.rst | 8 ++++---- plugin/packages/wakatime/wakatime/__init__.py | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugin/packages/wakatime/HISTORY.rst b/plugin/packages/wakatime/HISTORY.rst index eeb9475..5de1b64 100644 --- a/plugin/packages/wakatime/HISTORY.rst +++ b/plugin/packages/wakatime/HISTORY.rst @@ -3,6 +3,12 @@ History ------- +0.4.3 (2013-09-04) +++++++++++++++++++ + +- Encoding json as utf-8 before making request + + 0.4.2 (2013-09-04) ++++++++++++++++++ diff --git a/plugin/packages/wakatime/README.rst b/plugin/packages/wakatime/README.rst index 82c0fc9..ee5be89 100644 --- a/plugin/packages/wakatime/README.rst +++ b/plugin/packages/wakatime/README.rst @@ -1,8 +1,8 @@ -Wakati.Me -========= +WakaTime +======== -Wakati.Me is a time tracking api for text editors. This is the command line -action event appender for the Wakati.Me api. You shouldn't need to directly +Automatic time tracking for your text editor. This is the command line +event appender for the WakaTime api. You shouldn't need to directly use this outside of a text editor plugin. diff --git a/plugin/packages/wakatime/wakatime/__init__.py b/plugin/packages/wakatime/wakatime/__init__.py index 9f07af1..123a0e5 100644 --- a/plugin/packages/wakatime/wakatime/__init__.py +++ b/plugin/packages/wakatime/wakatime/__init__.py @@ -12,7 +12,7 @@ from __future__ import print_function __title__ = 'wakatime' -__version__ = '0.4.2' +__version__ = '0.4.3' __author__ = 'Alan Hamlett' __license__ = 'BSD' __copyright__ = 'Copyright 2013 Alan Hamlett' @@ -146,9 +146,12 @@ def send_action(project=None, branch=None, key=None, targetFile=None, 'Authorization': auth, } + # json request content + content = json.dumps(data).encode('utf-8') + # send action to api try: - response = requests.post(url, data=str(json.dumps(data)), headers=headers) + response = requests.post(url, data=content, headers=headers) except requests.exceptions.RequestException as exc: exception_data = { sys.exc_info()[0].__name__: str(sys.exc_info()[1]),