Skip to content

Commit db5a860

Browse files
committed
Bump v0.6.5
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 75309e7 commit db5a860

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

labstack/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import requests
2-
from .connect import _Connect
2+
from .queue import _Queue
33
from .email import _Email
44
from .log import _Log
55
from .store import _Store
@@ -19,8 +19,8 @@ def __init__(self, account_id, api_key):
1919
self.api_key = api_key
2020
self.interceptor = _Interceptor(api_key)
2121

22-
def connect(self, client_id):
23-
return _Connect(self.account_id, self.api_key, client_id)
22+
def queue(self, client_id):
23+
return _Queue(self.account_id, self.api_key, client_id)
2424

2525
def email(self):
2626
return _Email(self.interceptor)

labstack/connect.py renamed to labstack/queue.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import paho.mqtt.client as mqtt
22

3-
class _Connect():
3+
class _Queue():
44
def __init__(self, account_id, api_key, client_id):
55
self.account_id = account_id
66
self.client = mqtt.Client(client_id=client_id, clean_session=True)
@@ -20,8 +20,11 @@ def on_message(client, userdata, msg):
2020
def publish(self, topic, message):
2121
self.client.publish('{}/{}'.format(self.account_id, topic), message)
2222

23-
def subscribe(self, topic):
24-
self.client.subscribe('{}/{}'.format(self.account_id, topic))
23+
def subscribe(self, topic, shared=False):
24+
topic = '{}/{}'.format(self.account_id, topic)
25+
if shared:
26+
topic = '$queue/' + topic
27+
self.client.subscribe(topic)
2528

2629
def disconnect(self):
2730
self.client.disconnect()

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.6.4',
5+
version='0.6.5',
66
description='Official Python client library for the LabStack platform',
77
long_description='`<https://github.com/labstack/labstack-python>`_',
88
keywords='labstack cube email log mqtt store',

0 commit comments

Comments
 (0)