From a015d0c27182bd27c353e06bd7ba2fe18b29d2c9 Mon Sep 17 00:00:00 2001 From: Chris Seymour Date: Sat, 13 May 2017 14:54:22 +0100 Subject: [PATCH] v0.3.0 screenshot support --- chromote/__init__.py | 9 ++++++--- setup.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/chromote/__init__.py b/chromote/__init__.py index d521dda..d24195c 100644 --- a/chromote/__init__.py +++ b/chromote/__init__.py @@ -8,13 +8,16 @@ https://chromedevtools.github.io/devtools-protocol/1-2 """ -import base64 + import json +from base64 import b64decode + import requests import websocket from requests.exceptions import ConnectionError -version = "0.2.0" + +version = "0.3.0" __version__ = version __all__ = ['Chromote', 'ChromeTab'] @@ -94,7 +97,7 @@ def screenshot(self, format='png', quality=85, fromSurface=False): data = json.loads(result) if data.has_key('error'): raise ValueError(data['error']['data']) - return base64.b64decode(data.get('result',{}).get('data', '')) + return b64decode(data.get('result', {}).get('data', '')) def __str__(self): return '%s - %s' % (self.title, self.url) diff --git a/setup.py b/setup.py index 4ac3093..adbcf30 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='chromote', - version='0.2.0', + version='0.3.0', description="Python Wrapper for the Google Chrome Remote Debugging Protocol", author='Chris Seymour', packages=find_packages(),