Skip to content

Commit 701228d

Browse files
committed
Bumped v0.10.1
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 6ab59f3 commit 701228d

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

labstack/client.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,30 @@ def download(self, id, path):
2323
f.write(chunk)
2424
f.flush()
2525

26-
def barcode_generate(self, format=None, content=None):
26+
def barcode_generate(self, format=None, content=None, size=None):
2727
json = {
2828
'format': format,
29-
'content': content
29+
'content': content,
30+
'size': size
3031
}
31-
r = requests.post('{}/barcode/generate'.format(API_URL), auth=self.interceptor, json=json)
32+
r = requests.post(API_URL + '/barcode/generate', auth=self.interceptor,
33+
json=json)
34+
data = r.json()
35+
if not 200 <= r.status_code < 300:
36+
raise APIError(data['code'], data['message'])
37+
return data
38+
39+
def barcode_scan(self, file=None):
40+
files = {'file': open(file, 'rb')}
41+
r = requests.post(API_URL + '/barcode/scan', auth=self.interceptor, files=files)
3242
data = r.json()
3343
if not 200 <= r.status_code < 300:
3444
raise APIError(data['code'], data['message'])
3545
return data
3646

3747
def image_compress(self, file=None):
3848
files = {'file': open(file, 'rb')}
39-
r = requests.post('{}/image/compress'.format(API_URL), auth=self.interceptor, files=files)
49+
r = requests.post(API_URL + '/image/compress', auth=self.interceptor, files=files)
4050
data = r.json()
4151
if not 200 <= r.status_code < 300:
4252
raise APIError(data['code'], data['message'])

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='labstack',
5-
version='0.10.0',
5+
version='0.10.1',
66
description='Official Python client library for the LabStack API',
77
long_description='`<https://github.com/labstack/labstack-python>`_',
88
keywords='image compress, image resize, text summary, barcode generate, barcode scan',

0 commit comments

Comments
 (0)