Skip to content

Commit 1c6741a

Browse files
authored
Merge pull request #66 from livechat/0-2-1-release
0.2.1 release
2 parents 39dc926 + 5944263 commit 1c6741a

File tree

8 files changed

+78
-50
lines changed

8 files changed

+78
-50
lines changed

changelog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [0.2.1] - 2022-02-16
45

5-
## [0.2.0] - 2021-01-31
6+
### Changed
7+
- Handling of configuration file.
8+
9+
## [0.2.0] - 2022-01-31
610

711
### Added
812
- API stable version 3.4 as a default.

docs/agent_rtm.html

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
3434

3535
import typing
3636
from abc import ABCMeta
37-
from configparser import ConfigParser
3837

38+
from livechat.config import CONFIG
3939
from livechat.utils.helpers import prepare_payload
4040
from livechat.utils.structures import RtmResponse
4141
from livechat.utils.ws_client import WebsocketClient
4242

43-
config = ConfigParser()
44-
config.read(&#39;configs/main.ini&#39;)
45-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
46-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
43+
stable_version = CONFIG.get(&#39;stable&#39;)
44+
api_url = CONFIG.get(&#39;url&#39;)
4745

4846

4947
class AgentRTM:
@@ -273,7 +271,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
273271
payload = prepare_payload(locals())
274272
return self.ws.send({&#39;action&#39;: &#39;follow_chat&#39;, &#39;payload&#39;: payload})
275273

276-
def unfollow_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
274+
def unfollow_chat(self,
275+
id: str = None,
276+
payload: dict = None) -&gt; RtmResponse:
277277
&#39;&#39;&#39; Removes the requester from the chat followers.
278278

279279
Args:
@@ -630,7 +630,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
630630

631631
# Customers
632632

633-
def get_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
633+
def get_customer(self,
634+
id: str = None,
635+
payload: dict = None) -&gt; RtmResponse:
634636
&#39;&#39;&#39; Returns the info about the Customer with a given ID.
635637

636638
Args:
@@ -747,7 +749,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
747749
payload = prepare_payload(locals())
748750
return self.ws.send({&#39;action&#39;: &#39;ban_customer&#39;, &#39;payload&#39;: payload})
749751

750-
def follow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
752+
def follow_customer(self,
753+
id: str = None,
754+
payload: dict = None) -&gt; RtmResponse:
751755
&#39;&#39;&#39; Marks a customer as followed.
752756

753757
Args:
@@ -763,7 +767,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
763767
payload = prepare_payload(locals())
764768
return self.ws.send({&#39;action&#39;: &#39;follow_customer&#39;, &#39;payload&#39;: payload})
765769

766-
def unfollow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
770+
def unfollow_customer(self,
771+
id: str = None,
772+
payload: dict = None) -&gt; RtmResponse:
767773
&#39;&#39;&#39; Removes the agent from the list of customer&#39;s followers.
768774

769775
Args:
@@ -871,7 +877,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
871877
&#39;payload&#39;: payload
872878
})
873879

874-
def set_away_status(self, away: bool = None, payload: dict = None) -&gt; RtmResponse:
880+
def set_away_status(self,
881+
away: bool = None,
882+
payload: dict = None) -&gt; RtmResponse:
875883
&#39;&#39;&#39; Sets an Agent&#39;s connection to the away state.
876884

877885
Args:
@@ -1024,7 +1032,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
10241032

10251033
# Chats
10261034

1027-
def deactivate_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
1035+
def deactivate_chat(self,
1036+
id: str = None,
1037+
payload: dict = None) -&gt; RtmResponse:
10281038
&#39;&#39;&#39; Deactivates a chat by closing the currently open thread.
10291039

10301040
Args:
@@ -1316,7 +1326,9 @@ <h2 id="raises">Raises</h2>
13161326

13171327
# Chats
13181328

1319-
def deactivate_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
1329+
def deactivate_chat(self,
1330+
id: str = None,
1331+
payload: dict = None) -&gt; RtmResponse:
13201332
&#39;&#39;&#39; Deactivates a chat by closing the currently open thread.
13211333

13221334
Args:
@@ -1572,7 +1584,9 @@ <h2 id="returns">Returns</h2>
15721584
<summary>
15731585
<span>Expand source code</span>
15741586
</summary>
1575-
<pre><code class="python">def deactivate_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
1587+
<pre><code class="python">def deactivate_chat(self,
1588+
id: str = None,
1589+
payload: dict = None) -&gt; RtmResponse:
15761590
&#39;&#39;&#39; Deactivates a chat by closing the currently open thread.
15771591

15781592
Args:
@@ -2236,7 +2250,9 @@ <h3>Inherited members</h3>
22362250
payload = prepare_payload(locals())
22372251
return self.ws.send({&#39;action&#39;: &#39;follow_chat&#39;, &#39;payload&#39;: payload})
22382252

2239-
def unfollow_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
2253+
def unfollow_chat(self,
2254+
id: str = None,
2255+
payload: dict = None) -&gt; RtmResponse:
22402256
&#39;&#39;&#39; Removes the requester from the chat followers.
22412257

22422258
Args:
@@ -2593,7 +2609,9 @@ <h3>Inherited members</h3>
25932609

25942610
# Customers
25952611

2596-
def get_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
2612+
def get_customer(self,
2613+
id: str = None,
2614+
payload: dict = None) -&gt; RtmResponse:
25972615
&#39;&#39;&#39; Returns the info about the Customer with a given ID.
25982616

25992617
Args:
@@ -2710,7 +2728,9 @@ <h3>Inherited members</h3>
27102728
payload = prepare_payload(locals())
27112729
return self.ws.send({&#39;action&#39;: &#39;ban_customer&#39;, &#39;payload&#39;: payload})
27122730

2713-
def follow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
2731+
def follow_customer(self,
2732+
id: str = None,
2733+
payload: dict = None) -&gt; RtmResponse:
27142734
&#39;&#39;&#39; Marks a customer as followed.
27152735

27162736
Args:
@@ -2726,7 +2746,9 @@ <h3>Inherited members</h3>
27262746
payload = prepare_payload(locals())
27272747
return self.ws.send({&#39;action&#39;: &#39;follow_customer&#39;, &#39;payload&#39;: payload})
27282748

2729-
def unfollow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
2749+
def unfollow_customer(self,
2750+
id: str = None,
2751+
payload: dict = None) -&gt; RtmResponse:
27302752
&#39;&#39;&#39; Removes the agent from the list of customer&#39;s followers.
27312753

27322754
Args:
@@ -2834,7 +2856,9 @@ <h3>Inherited members</h3>
28342856
&#39;payload&#39;: payload
28352857
})
28362858

2837-
def set_away_status(self, away: bool = None, payload: dict = None) -&gt; RtmResponse:
2859+
def set_away_status(self,
2860+
away: bool = None,
2861+
payload: dict = None) -&gt; RtmResponse:
28382862
&#39;&#39;&#39; Sets an Agent&#39;s connection to the away state.
28392863

28402864
Args:
@@ -3496,7 +3520,9 @@ <h2 id="returns">Returns</h2>
34963520
<summary>
34973521
<span>Expand source code</span>
34983522
</summary>
3499-
<pre><code class="python">def follow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
3523+
<pre><code class="python">def follow_customer(self,
3524+
id: str = None,
3525+
payload: dict = None) -&gt; RtmResponse:
35003526
&#39;&#39;&#39; Marks a customer as followed.
35013527

35023528
Args:
@@ -3582,7 +3608,9 @@ <h2 id="returns">Returns</h2>
35823608
<summary>
35833609
<span>Expand source code</span>
35843610
</summary>
3585-
<pre><code class="python">def get_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
3611+
<pre><code class="python">def get_customer(self,
3612+
id: str = None,
3613+
payload: dict = None) -&gt; RtmResponse:
35863614
&#39;&#39;&#39; Returns the info about the Customer with a given ID.
35873615

35883616
Args:
@@ -4464,7 +4492,9 @@ <h2 id="returns">Returns</h2>
44644492
<summary>
44654493
<span>Expand source code</span>
44664494
</summary>
4467-
<pre><code class="python">def set_away_status(self, away: bool = None, payload: dict = None) -&gt; RtmResponse:
4495+
<pre><code class="python">def set_away_status(self,
4496+
away: bool = None,
4497+
payload: dict = None) -&gt; RtmResponse:
44684498
&#39;&#39;&#39; Sets an Agent&#39;s connection to the away state.
44694499

44704500
Args:
@@ -4715,7 +4745,9 @@ <h2 id="returns">Returns</h2>
47154745
<summary>
47164746
<span>Expand source code</span>
47174747
</summary>
4718-
<pre><code class="python">def unfollow_chat(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
4748+
<pre><code class="python">def unfollow_chat(self,
4749+
id: str = None,
4750+
payload: dict = None) -&gt; RtmResponse:
47194751
&#39;&#39;&#39; Removes the requester from the chat followers.
47204752

47214753
Args:
@@ -4755,7 +4787,9 @@ <h2 id="returns">Returns</h2>
47554787
<summary>
47564788
<span>Expand source code</span>
47574789
</summary>
4758-
<pre><code class="python">def unfollow_customer(self, id: str = None, payload: dict = None) -&gt; RtmResponse:
4790+
<pre><code class="python">def unfollow_customer(self,
4791+
id: str = None,
4792+
payload: dict = None) -&gt; RtmResponse:
47594793
&#39;&#39;&#39; Removes the agent from the list of customer&#39;s followers.
47604794

47614795
Args:

docs/agent_web.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ <h1 class="title">Module <code>livechat.agent.web.client</code></h1>
3434

3535
import typing
3636
from abc import ABCMeta
37-
from configparser import ConfigParser
3837

3938
import httpx
4039

40+
from livechat.config import CONFIG
4141
from livechat.utils.helpers import prepare_payload
4242
from livechat.utils.httpx_logger import HttpxLogger
4343

44-
config = ConfigParser()
45-
config.read(&#39;configs/main.ini&#39;)
46-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
47-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
44+
stable_version = CONFIG.get(&#39;stable&#39;)
45+
api_url = CONFIG.get(&#39;url&#39;)
4846

4947

5048
# pylint: disable=R0903

docs/configuration_api.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ <h1 class="title">Module <code>livechat.configuration.client</code></h1>
3333
from __future__ import annotations
3434

3535
from abc import ABCMeta
36-
from configparser import ConfigParser
3736

3837
import httpx
3938

39+
from livechat.config import CONFIG
4040
from livechat.utils.helpers import prepare_payload
4141
from livechat.utils.httpx_logger import HttpxLogger
4242

43-
config = ConfigParser()
44-
config.read(&#39;configs/main.ini&#39;)
45-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
46-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
43+
stable_version = CONFIG.get(&#39;stable&#39;)
44+
api_url = CONFIG.get(&#39;url&#39;)
4745

4846

4947
class ConfigurationApi:

docs/customer_rtm.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ <h1 class="title">Module <code>livechat.customer.rtm.client</code></h1>
3434
from __future__ import annotations
3535

3636
from abc import ABCMeta
37-
from configparser import ConfigParser
3837

38+
from livechat.config import CONFIG
3939
from livechat.utils.helpers import prepare_payload
4040
from livechat.utils.structures import RtmResponse
4141
from livechat.utils.ws_client import WebsocketClient
4242

43-
config = ConfigParser()
44-
config.read(&#39;configs/main.ini&#39;)
45-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
46-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
43+
stable_version = CONFIG.get(&#39;stable&#39;)
44+
api_url = CONFIG.get(&#39;url&#39;)
4745

4846

4947
class CustomerRTM:

docs/customer_web.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ <h1 class="title">Module <code>livechat.customer.web.client</code></h1>
3434

3535
import typing
3636
from abc import ABCMeta
37-
from configparser import ConfigParser
3837

3938
import httpx
4039

40+
from livechat.config import CONFIG
4141
from livechat.utils.helpers import prepare_payload
4242
from livechat.utils.httpx_logger import HttpxLogger
4343

44-
config = ConfigParser()
45-
config.read(&#39;configs/main.ini&#39;)
46-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
47-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
44+
stable_version = CONFIG.get(&#39;stable&#39;)
45+
api_url = CONFIG.get(&#39;url&#39;)
4846

4947

5048
# pylint: disable=R0903

docs/reports_api.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ <h1 class="title">Module <code>livechat.reports.client</code></h1>
3434
from __future__ import annotations
3535

3636
from abc import ABCMeta
37-
from configparser import ConfigParser
3837

3938
import httpx
4039

40+
from livechat.config import CONFIG
4141
from livechat.utils.helpers import prepare_payload
4242
from livechat.utils.httpx_logger import HttpxLogger
4343

44-
config = ConfigParser()
45-
config.read(&#39;configs/main.ini&#39;)
46-
stable_version = config.get(&#39;api&#39;, &#39;stable&#39;)
47-
api_url = config.get(&#39;api&#39;, &#39;url&#39;)
44+
stable_version = CONFIG.get(&#39;stable&#39;)
45+
api_url = CONFIG.get(&#39;url&#39;)
4846

4947

5048
class ReportsApi:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = lc-sdk-python
3-
version = 0.2.0
3+
version = 0.2.1
44
description = Package which lets to work with LiveChat API.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

0 commit comments

Comments
 (0)