Skip to content

Commit 8123551

Browse files
committed
corrections for top entity naming
1 parent 9f07b5d commit 8123551

File tree

8 files changed

+289
-43
lines changed

8 files changed

+289
-43
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Initializing
3939
~~~~~~~~~~~~
4040

4141
Import the package at the top of any file where you will use it. At the very least you will need the
42-
``Client`` class from the opentok module. Then initialize an opentok Client instance with your own API Key and API Secret.
42+
``Client`` class. Then initialize an Client instance with your own API Key and API Secret.
4343

4444
.. code:: python
4545
@@ -300,7 +300,7 @@ The method returns a StreamList object that contains a list of all the streams
300300
print stream.name #stream name
301301
print stream.layoutClassList #['full']
302302
303-
You can change the layout classes for streams in a session by calling the `set_stream_class_lists(session_id, stream_list)` method of the `OpenTok` class.
303+
You can change the layout classes for streams in a session by calling the `set_stream_class_lists(session_id, stream_list)` method of the `Client` class.
304304

305305
The layout classes define how the stream is displayed in the layout of a composed OpenTok archive.
306306

opentok/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ForceDisconnectError,
88
ArchiveError,
99
SetStreamClassError,
10-
BroadcastError,
10+
BroadcastError
1111
)
1212
from .version import __version__
1313
from .stream import Stream

opentok/endpoints.py

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import warnings
2+
3+
14
class Endpoints(object):
25
"""
36
For internal use.
@@ -8,17 +11,34 @@ def __init__(self, api_url, api_key):
811
self.api_url = api_url
912
self.api_key = api_key
1013

11-
def session_url(self):
14+
def get_session_url(self):
1215
url = self.api_url + "/session/create"
1316
return url
1417

15-
def archive_url(self, archive_id=None):
18+
def session_url(self):
19+
warnings.warn(
20+
"endpoints.session_url is deprecated (use endpoints.get_session_url instead).",
21+
DeprecationWarning,
22+
stacklevel=2,
23+
)
24+
25+
return self.get_session_url()
26+
27+
def get_archive_url(self, archive_id=None):
1628
url = self.api_url + "/v2/project/" + self.api_key + "/archive"
1729
if archive_id:
1830
url = url + "/" + archive_id
1931
return url
2032

21-
def signaling_url(self, session_id, connection_id=None):
33+
def archive_url(self, archive_id=None):
34+
warnings.warn(
35+
"endpoints.archive_url is deprecated (use endpoints.get_archive_url instead).",
36+
DeprecationWarning,
37+
stacklevel=2,
38+
)
39+
return self.get_archive_url(archive_id)
40+
41+
def get_signaling_url(self, session_id, connection_id=None):
2242
url = self.api_url + "/v2/project/" + self.api_key + "/session/" + session_id
2343

2444
if connection_id:
@@ -27,6 +47,14 @@ def signaling_url(self, session_id, connection_id=None):
2747
url += "/signal"
2848
return url
2949

50+
def signaling_url(self, session_id, connection_id=None):
51+
warnings.warn(
52+
"endpoints.signaling_url is deprecated (use endpoints.get_signaling_url instead).",
53+
DeprecationWarning,
54+
stacklevel=2,
55+
)
56+
return self.get_signaling_url(session_id, connection_id)
57+
3058
def get_stream_url(self, session_id, stream_id=None):
3159
""" this method returns the url to get streams information """
3260
url = (
@@ -41,6 +69,14 @@ def get_stream_url(self, session_id, stream_id=None):
4169
url = url + "/" + stream_id
4270
return url
4371

72+
def broadcast_url(self, broadcast_id=None, stop=False, layout=False):
73+
warnings.warn(
74+
"endpoints.broadcast_url is deprecated (use endpoints.get_broadcast_url instead).",
75+
DeprecationWarning,
76+
stacklevel=2,
77+
)
78+
return self.get_broadcast_url(broadcast_id, stop, layout)
79+
4480
def force_disconnect_url(self, session_id, connection_id):
4581
""" this method returns the force disconnect url endpoint """
4682
url = (
@@ -83,7 +119,7 @@ def set_stream_class_lists_url(self, session_id):
83119
)
84120
return url
85121

86-
def broadcast_url(self, broadcast_id=None, stop=False, layout=False):
122+
def get_broadcast_url(self, broadcast_id=None, stop=False, layout=False):
87123
""" this method returns urls for working with broadcast """
88124
url = self.api_url + "/v2/project/" + self.api_key + "/broadcast"
89125

0 commit comments

Comments
 (0)